Thanks for the bug report and trying to make Ubuntu better.

I tried to reproduce this locally without success. Could you please
share the exact same steps you did so we can try to follow them?

I installed postgresql-14 in a jammy (22.04) container, upgraded it to
noble (24.04), and installed postgresql-16:

root@postgres-upgrade:~# dpkg -l | grep postgres
ii  postgresql-14                   14.13-0ubuntu0.22.04.1                  
amd64        The World's Most Advanced Open Source Relational Database
ii  postgresql-16                   16.4-0ubuntu0.24.04.2                   
amd64        The World's Most Advanced Open Source Relational Database
ii  postgresql-client-14            14.13-0ubuntu0.22.04.1                  
amd64        front-end programs for PostgreSQL 14
ii  postgresql-client-16            16.4-0ubuntu0.24.04.2                   
amd64        front-end programs for PostgreSQL 16
ii  postgresql-client-common        257build1.1                             all 
         manager for multiple PostgreSQL client versions
ii  postgresql-common               257build1.1                             all 
         PostgreSQL database-cluster manager
root@postgres-upgrade:~# man pg_upgradecluster
root@postgres-upgrade:~# pg_lsclusters 
Ver Cluster Port Status Owner    Data directory              Log file
14  main    5432 online postgres /var/lib/postgresql/14/main 
/var/log/postgresql/postgresql-14-main.log
16  main    5433 online postgres /var/lib/postgresql/16/main 
/var/log/postgresql/postgresql-16-main.log
root@postgres-upgrade:~# pg_upgradecluster 14 main
Error: target cluster 16/main already exists
root@postgres-upgrade:~# pg_dropcluster --stop 16 main
root@postgres-upgrade:~# pg_upgradecluster 14 main
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start 
operation
Creating new PostgreSQL cluster 16/main ...
/usr/lib/postgresql/16/bin/initdb -D /var/lib/postgresql/16/main --auth-local 
peer --auth-host scram-sha-256 --no-instructions --encoding UTF8 --lc-collate 
C.UTF-8 --lc-ctype C.UTF-8
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/16/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Copying old configuration files...
Copying old start.conf...
Copying old pg_ctl.conf...
Starting new cluster...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start 
operation
Running init phase upgrade hook scripts ...

Roles, databases, schemas, ACLs...
 set_config 
------------
 
(1 row)

 set_config 
------------
 
(1 row)

Fixing hardcoded library paths for stored procedures...
Upgrading database postgres...
Fixing hardcoded library paths for stored procedures...
Upgrading database template1...
Stopping target cluster...
Stopping old cluster...
Disabling automatic startup of old cluster...
Starting upgraded cluster on port 5432...
Running finish phase upgrade hook scripts ...
vacuumdb: processing database "postgres": Generating minimal optimizer 
statistics (1 target)
vacuumdb: processing database "template1": Generating minimal optimizer 
statistics (1 target)
vacuumdb: processing database "postgres": Generating medium optimizer 
statistics (10 targets)
vacuumdb: processing database "template1": Generating medium optimizer 
statistics (10 targets)
vacuumdb: processing database "postgres": Generating default (full) optimizer 
statistics
vacuumdb: processing database "template1": Generating default (full) optimizer 
statistics

Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with
    pg_dropcluster 14 main

Ver Cluster Port Status Owner    Data directory              Log file
14  main    5433 down   postgres /var/lib/postgresql/14/main 
/var/log/postgresql/postgresql-14-main.log
Ver Cluster Port Status Owner    Data directory              Log file
16  main    5432 online postgres /var/lib/postgresql/16/main 
/var/log/postgresql/postgresql-16-main.log
root@postgres-upgrade:~# pg_lsclusters 
Ver Cluster Port Status Owner    Data directory              Log file
14  main    5433 down   postgres /var/lib/postgresql/14/main 
/var/log/postgresql/postgresql-14-main.log
16  main    5432 online postgres /var/lib/postgresql/16/main 
/var/log/postgresql/postgresql-16-main.log
root@postgres-upgrade:~#


As you can see above, I was able to upgrade the postgresql cluster from version 
14 to 16 after removing the default 16 cluster automatically created by the 
package. Did you follow different steps to upgrade your cluster?

** Changed in: postgresql-16 (Ubuntu)
       Status: Confirmed => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2078494

Title:
  After upgrade to 24.04.1 LTS pg_upgradecluster fails

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-16/+bug/2078494/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to