Score:0

pg_dump is not the same version as psql

in flag

I updated postgres to version 14 by simply 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? If I completely uninstalled postgres to do a fresh install would I lose any local databases as well?

Update: I 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-14
pg_dump --version      
Error: PostgreSQL version 12 is not installed

Currently on Ubuntu 20.04.

Ginnungagap avatar
gu flag
What OS+version are you running? How did you update PostgreSQL? Were there any warnings during the upgrade? Where is the package from?
Leonardo Petrucci avatar
in flag
Added both, sorry for the missing info.
Score:0
hu flag

Use sudo apt-get install postgresql-client-14. pg_dump utility comes from there, not from postgresql.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.