Package: postgresql
Version: 17+270
I've experienced this when upgrading my system from stable to testing.
Somehow the stable's version (postgresql-15) was removed before the
install of the testing's version (postgresql-17). When configuring, it
couldn't complete the cluster upgrade because it didn't found
pg_controldata from version 15.
Even though the configuration dialog also described the alternative to
do the upgrade from cli tools, it was also not feasible to execute,
because of the same problem. It is important to also note that version
15 is not present anymore in testing, which renders the database cluster
in failure state. You you cannot start the new version 17, because the
debconf configuration hasn't finished correctly and the SystemD files
are not in place.
I've solved the issue by manually downloading the stable package file
for postgresql-15 and installing it using dpkg, so that pg_controldata
is available. Then, I was able to reconfigure version 17 and do the
cluster upgrade from debconf, which finished with no errors.