adjust postgresql upgrade readme steps; edit pg_hba.conf to support

connecting without passwords *before* copying to the new dir. saves
manually making the same change to two copies of the same file.
ok pea@
This commit is contained in:
sthen 2020-11-14 13:03:49 +00:00
parent 2f847d7fbd
commit bf8415787b
2 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.265 2020/11/13 19:00:10 pea Exp $
# $OpenBSD: Makefile,v 1.266 2020/11/14 13:03:49 sthen Exp $
COMMENT-main= PostgreSQL RDBMS (client)
COMMENT-server= PostgreSQL RDBMS (server)
@ -16,6 +16,7 @@ PKGNAME-docs= postgresql-docs-${VERSION}
PKGNAME-contrib=postgresql-contrib-${VERSION}
PKGNAME-plpython=postgresql-plpython-${VERSION}
PKGNAME-pg_upgrade=postgresql-pg_upgrade-${VERSION}
REVISION-server= 0
CATEGORIES= databases

View File

@ -1,4 +1,4 @@
$OpenBSD: README-server,v 1.30 2020/06/14 10:19:46 jasper Exp $
$OpenBSD: README-server,v 1.31 2020/11/14 13:03:49 sthen Exp $
+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
@ -169,24 +169,24 @@ faster than a dump and reload, especially for large databases.
in a UTF-8 locale; if that is the case and you require an ASCII database
environment, use "initdb --locale=C /var/postgresql/data [...]").
5) Restore your old pg_hba.conf and (if used) SSL certificates
5) Temporarily support connecting without a password for local users by
editing pg_hba.conf to include "local all postgres trust"
# vi /var/postgresql/data-${PREV_MAJOR}/pg_hba.conf
6) Restore your old pg_hba.conf and (if used) SSL certificates
# cp -p /var/postgresql/data-${PREV_MAJOR}/pg_hba.conf /var/postgresql/data/
# cp -p /var/postgresql/data-${PREV_MAJOR}/server.{crt,key} /var/postgresql/data/
Some postgresql.conf settings changed or disappeared in this version.
Examine your old file for local changes and apply them to the new version.
6) Temporarily support connecting without a password for local users by
editing pg_hba.conf to include "local all postgres trust"
# vi /var/postgresql/data{,-${PREV_MAJOR}}/pg_hba.conf
7) Run pg_upgrade:
# su _postgresql -c "cd /var/postgresql && \
pg_upgrade -b /usr/local/bin/postgresql-${PREV_MAJOR}/ -B /usr/local/bin \
-U postgres -d /var/postgresql/data-${PREV_MAJOR}/ -D /var/postgresql/data"
8) Remove "local all postgres trust" line from pg_hba.conf
# vi /var/postgresql/data{,-${PREV_MAJOR}}/pg_hba.conf
# vi /var/postgresql/data/pg_hba.conf
9) Start PostgreSQL:
# rcctl start postgresql