For development reasons I have both Postgres 12 and 14 installed on my local machine. However, often I also need to use the pg_dump
utility to create backups.
pg_dump 12
won't connect to a Postgres 14 database and viceversa.
If I simply run pg_dump
, Ubuntu will use the one in /bin
by default which is pg_dump@12
.
If I want to run version 14 I have to manually type:
/usr/lib/postgresql/14/bin/pg_dump
Is there any way I can quickly switch between them?
Something like:
pg_dump@14