0

I had Postgres version 13 installed on my windows machine. I've upgraded to version 14 and left the old version there. I've updated my path variable to the new version.

In PGAdmin 4 I created a new database called education_system and can use it there. But when I log into the psql command line I only see the old databases I had under 13 and not the one I created under PGAdmin 4 under version 14.

If I check the version on the command line it shows the correct version:

psql -V
psql (PostgreSQL) 14.1

But when I log into psql it shows that I am on the cli version 14.1 but the server version 13.2

psql -U postgres
Password for user postgres:
psql (14.1, server 13.2)

Listing the databases shows only the ones I had under version 13

postgres=# \l
                                                     List of databases
       Name        |  Owner   | Encoding |          Collate           |           Ctype            |   Access privileges
-------------------+----------+----------+----------------------------+----------------------------+-----------------------
 analysis          | postgres | UTF8     | English_United States.1252 | English_United States.1252 |
 animals           | postgres | UTF8     | English_United States.1252 | English_United States.1252 |
 aws_inventories   | postgres | UTF8     | en_US.UTF-8                | en_US.UTF-8                |
 azr_inventories   | postgres | UTF8     | en_US.UTF-8                | en_US.UTF-8                |
 gcp_inventories   | postgres | UTF8     | en_US.UTF-8                | en_US.UTF-8                |
 postgis_31_sample | postgres | UTF8     | English_United States.1252 | English_United States.1252 |
 postgres          | postgres | UTF8     | English_United States.1252 | English_United States.1252 |
 template0         | postgres | UTF8     | English_United States.1252 | English_United States.1252 | =c/postgres          +
                   |          |          |                            |                            | postgres=CTc/postgres
 template1         | postgres | UTF8     | English_United States.1252 | English_United States.1252 | =c/postgres          +
                   |          |          |                            |                            | postgres=CTc/postgres
(9 rows)

And the education_system database is nowhere to be found. How can I get the server version to match the version I have on the command line?

bluethundr
  • 1,005
  • 17
  • 68
  • 141
  • 2
    By using the correct port. The `13.2` version was installed first so it is using the default port of `5432` which is what you connect to when you do: `psql -U postgres`. You will need to find what `port` the `14.1` instance is running on and then do: `psql -U postgres -p `. Probably easiest to look at the connection settings in `pgAdmin` for the `14.1` server. – Adrian Klaver Jan 21 '22 at 17:44
  • Thank you very much! That worked! – bluethundr Jan 21 '22 at 18:23

1 Answers1

1

ALTER DATABASE template1 REFRESH COLLATION VERSION

Zhanibek
  • 26
  • 1