Re: pg_upgrade -c cannot be run if old cluster is running - Mailing list pgsql-docs

From Tom Lane
Subject Re: pg_upgrade -c cannot be run if old cluster is running
Date
Msg-id 1847617.1725549198@sss.pgh.pa.us
Whole thread Raw
In response to RE: pg_upgrade -c cannot be run if old cluster is running  (Alain Bourgeois <alain.bourgeois@zetes.com>)
List pgsql-docs
Alain Bourgeois <alain.bourgeois@zetes.com> writes:
> When the cluster was created, we did initdb  /var/lib/pgsql10/data, the storagebox was not available.
> Then storagebox was delivered, we copied data folder to storagebox in /mnt/pgdata/pgdir and changed postgresql.conf.
Wedidn't delete existing datafiles from /var/lib/pgsql10/data (db was empty). 

Yeah, after further experimentation I saw that pg_upgrade would fail
in a pretty obvious way unless the supposedly-config-only directory
also contains a full set of subdirectories (base, pg_wal, etc).

We could imagine removing that check for PG_VERSION.  I don't think
that the ensuing call of "postgres -C data_directory" would add
anything meaningful to pg_upgrade's runtime.  But then you'd see
"Finding the real data directory" every time, indeed twice (for
source and target directories).  That seems like it would create
more confusion than is justified.

On the whole I think this is self-inflicted damage.  Leaving that
stuff around was just asking for confusion.

            regards, tom lane



pgsql-docs by date:

Previous
From: Alain Bourgeois
Date:
Subject: RE: pg_upgrade -c cannot be run if old cluster is running
Next
From: Tom Lane
Date:
Subject: Re: DocBook 5.2