Sorry for yet another one of these! I think I send a new diff for
this every time I have to go through the pg_upgrade process :)

If we add "local all postgres trust" before copying pg_hba.conf from the
old to new dir, we can avoid editing twice. And we only need to remove
it again from the new one. OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/postgresql/Makefile,v
retrieving revision 1.261
diff -u -p -r1.261 Makefile
--- Makefile    18 Feb 2020 15:27:03 -0000      1.261
+++ Makefile    28 Feb 2020 23:21:09 -0000
@@ -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
 SHARED_LIBS=   ecpg            7.10 \
Index: pkg/README-server
===================================================================
RCS file: /cvs/ports/databases/postgresql/pkg/README-server,v
retrieving revision 1.29
diff -u -p -r1.29 README-server
--- pkg/README-server   12 Feb 2020 13:20:34 -0000      1.29
+++ pkg/README-server   28 Feb 2020 23:21:09 -0000
@@ -169,24 +169,24 @@ faster than a dump and reload, especiall
 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


Reply via email to