On 07/08 11:15, Stuart Henderson wrote:
> On 2026/07/08 10:26, Olivier Cherrier wrote:
> > ??? Hello,
> > 
> > While upgrading using method 1 (dump / restore),
> > the 'postgresql-pg_upgrade' pkg is not installed.
> > 
> > Please see attached patch.
> 
> > @@ -120,7 +120,7 @@ Examine your old file for local changes 
> >  (/var/postgresql/data/postgresql.conf). The following command may help
> >  identify them:
> >  
> > -# diff -wu 
> > ${LOCALBASE}/share/postgresql-${PREV_MAJOR}/postgresql.conf.sample \
> > +# diff -wu ${LOCALBASE}/share/postgresql/postgresql.conf.sample \
> >      /var/postgresql/data-${PREV_MAJOR}/postgresql.conf
> 
> It's probably better to install postgresql-pg_upgrade. This will allow
> comparing the live config file against a default one with fewer
> differences as it's from a more similar version. e.g.

I don't think we should recommend pg_upgrade in the non-pg_upgrade case.
I think we should move the configuration difference instructions before
pkg_add -ui. Then we don't need pg_upgrade. What are your thoughts on
that?

Best,
Jeremy

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/databases/postgresql/Makefile,v
> diff -u -p -r1.319 Makefile
> --- Makefile  25 May 2026 00:36:13 -0000      1.319
> +++ Makefile  8 Jul 2026 10:14:17 -0000
> @@ -10,6 +10,8 @@ PREV_MAJOR= 17
>  DISTNAME=    postgresql-${VERSION}
>  PKGNAME-main=        postgresql-client-${VERSION}
>  
> +REVISION-server=0
> +
>  DPB_PROPERTIES=      parallel
>  
>  CATEGORIES=  databases
> Index: pkg/README-server
> ===================================================================
> RCS file: /cvs/ports/databases/postgresql/pkg/README-server,v
> diff -u -p -r1.39 README-server
> --- pkg/README-server 22 Jan 2026 01:24:20 -0000      1.39
> +++ pkg/README-server 8 Jul 2026 10:14:17 -0000
> @@ -97,8 +97,11 @@ to the current version.
>  2) Shutdown the server:
>  # rcctl stop postgresql
>  
> -3) Upgrade your PostgreSQL package with pkg_add.
> +3) Upgrade your PostgreSQL package with pkg_add. Even though you're not
> +using pg_upgrade for the update, install it to provide an unmodified
> +configuration file from a closer version for step 6.
>  # pkg_add -ui postgresql-server
> +# pkg_add postgresql-pg_upgrade
>  
>  4) Backup your old data directory and rename:
>  # cd /var/postgresql && tar cf - data | gzip -1 > data.tar.gz
> @@ -144,7 +147,7 @@ faster than a dump and reload, especiall
>     enabled by default until PostgreSQL 18):
>  # su _postgresql -c '/usr/local/bin/pg_checksums -e -D /var/postgresql/data'
>  
> -3) Upgrade your PostgreSQL package with pkg_add.
> +3) Install the PostgreSQL pg_upgrade package with pkg_add.
>  # pkg_add postgresql-pg_upgrade
>  
>  4) Backup your old data directory:

Reply via email to