patternsqlMinor
pg_dump is not the same version as psql
Viewed 0 times
samepg_dumptheversionpsqlnot
Problem
I updated postgres to version 14 with
But
Any idea why that is?
I also purged everything postgres and reinstalled
But then:
Running Ubuntu 20.04.
Update:
Adding results of running
sudo apt upgrade.psql --version
psql (PostgreSQL) 14.1 (Ubuntu 14.1-2.pgdg20.04+1)But
pg_dump did not upgrade with everything else:pg_dump --version
pg_dump (PostgreSQL) 12.9 (Ubuntu 12.9-2.pgdg20.04+1)Any idea why that is?
I also purged everything postgres and reinstalled
postgresql-14:sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql-14But then:
pg_dump --version
Error: PostgreSQL version 12 is not installedRunning Ubuntu 20.04.
Update:
Adding results of running
pg_lsclusterspg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
14 main 5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.logSolution
The output of
The removal scripts takes special care not to destroy your data when you're uninstalling, which is why an instance and its data can be a bit sticky.
To remove the "zombie" instance, use
Then only the
You may also want to relocate your
pg_lsclusters indicates that Postgres 12 binaries were uninstalled without removing the Postgres 12 instance first. Notice how the Status column says binaries_missing.The removal scripts takes special care not to destroy your data when you're uninstalling, which is why an instance and its data can be a bit sticky.
To remove the "zombie" instance, use
$ sudo pg_dropcluster 12 mainThen only the
14/main instance will remain in the pg_lsclusters list, and pg_dump and other client apps that go through the Debian/Ubuntu pg_wrapper script will stop choosing the 12/main instance first.You may also want to relocate your
14/main instance to the 5432 port, as it's the default port for Postgres and if you don't plan to have several instances on the same host, using the default port will make your life easier.Code Snippets
$ sudo pg_dropcluster 12 mainContext
StackExchange Database Administrators Q#303607, answer score: 3
Revisions (0)
No revisions yet.