I am fairly new to PostgreSQL but I have some knowledge of SQL. I've been using a database with tables and data on postgres that (I'm assuming) comes with MacOS because when I start the server, access a given database and run SELECT version();
on terminal I get the following:
PostgreSQL 12.3 on x86_64-apple-darwin19.4.0, compiled by Apple clang version 11.0.3 (clang-1103.0.32.59), 64-bit
However, I can't see it in Library/PostgreSQL
because it doesn't exist.
So now I installed PostgreSQL 13 to work with while taking a course and also installed pgAdmin. It should have been installed under Library/PostgreSQL/13/
but it also doesn't exist. Nevertheless, I can access the servers for both 12 (port 5432) and 13 (port 5433) via pgAdmin and all its tables. I can access the tables from the 12 in pgAdmin and on the terminal.
I am a little confused with how everything was set up and I couldn't find a proper tutorial to solve it so I have a few questions:
- How can I get rid of two versions and run only one with all my databases in the same? It feels like it would be more organized.
- How do I access the server of version 13 through the terminal?
- How can I uninstall version 12? I tried running
open uninstall_postgresql.app
but the folder doesn't exist anymore. - If I access via:
psql -U postgres -p 5433
: thenpsql (12.3, server 13.0) WARNING: psql major version 12, server major version 13.
why is that?