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

From Alain Bourgeois
Subject RE: pg_upgrade -c cannot be run if old cluster is running
Date
Msg-id PAXP191MB1712B2F0354E98E4396CC739F09D2@PAXP191MB1712.EURP191.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: pg_upgrade -c cannot be run if old cluster is running  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_upgrade -c cannot be run if old cluster is running
List pgsql-docs
Here is what can be said about config (no extension, nothing special)
There are already one postgresql-15 services (separate cluster, on ports <>5432) that run on this machine, and there is
alsoone postgres 10 cluster (on port 5432). 
The aim is to update the 10 to 15 to get rid of v10.
So we created a new psql 15 cluster.

/usr/lib/systemd/system/postgresql-10.service has PGDATA=/var/lib/pgsql/10/data/,
/var/lib/pgsql/10/data/postgtresql.confholds data_directory = '/mnt/pgdata/pgdir' 

The new psql-15 cluster,/usr/lib/systemd/system/postgresql-15-bc.service, has PGDATA=/mnt/pgdata/pgdirbc15/

Initdb has been run on /mnt/pgdata/pgdirbc15/, postgresql.conf holds data_directory = '/mnt/pgdata/pgdirbc15/',
hba_file= '/mnt/pgdata/pgdirbc15/pg_hba.conf'  
pg_hba.conf has been copied from psql10 data dir
postgresql.conf has been adapted to match the v10 one: listen_addresses = '*', port=5455, max_connections=150,
password_encryption= md5, ssl=on (certificates have been copied from previous cluster to new one), wal_level=replica. I
leftarchive_mode=off on new server although it is on on the old one. 
For new cluster postgresql.conf is in PGDATA directory (which is not the case of the old one).
systemctl start postgresql-15-bc works without any problem. It has been stopped before pg_upgrade --check.

Postgres 10 cannot be stopped, it is a live prod system.




pgsql-docs by date:

Previous
From: Kirk Parker
Date:
Subject: Re: Behavior of ON DELETE CASCADE in CTEs
Next
From: Alain Bourgeois
Date:
Subject: RE: pg_upgrade -c cannot be run if old cluster is running