I'm pretty new to using postgresql and seemed to have installed two versions that are running at the same time. Both 12 and 14.
Below is the list of commands that I've run, and the results they've yielded.
From WSL-2 Ubuntu 20.04 CLI
➜ which psql
/usr/bin/psql
➜ pg_config --version
PostgreSQL 14.4 (Ubuntu 14.4-1.pgdg20.04+1)
➜ psql --version
psql (PostgreSQL) 14.4 (Ubuntu 14.4-1.pgdg20.04+1)
From psql
=# SHOW server_version;
server_version
------------------------------------
12.11 (Ubuntu 12.11-1.pgdg20.04+1)
(1 row)
=# SELECT version();
version
-------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 12.11 (Ubuntu 12.11-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
(1 row)
I've have some persistent issues with my odoo 15 db and think this may be the cause but am unsure.
Any recommendations on how to transition from 12.11 server to 14.4 server and remove 12.11 server would be greatly appreciated.
Thanks to all the above for the help!
Commands I ran to fix on Ubuntu 20.04 / Windows-11 WSL-2:
pg_dumpall > export.sql
sudo apt-get --purge remove postgresql\*
sudo apt-get install postgresql-14
(or -version preferred)sudo -u postgres -i
psql
CREATE ROLE username superuser
ALTER ROLE username WITH LOGIN;
\password username;
\q
exit