Basically, when I run psql --version, I get PostgreSQL 9.5.4. But with sudo su postgres and psql, the terminal throws me psql (10.0). Could anyone tell me what exactly going on here?
What makes me more confused is that there's no ./9.5 under the directory /etc/postgresql/. The only version I manually installed on my machine is postgresql-10, and I have no clue why "9.5" pops up when I run psql --version
And if I had multiple postgresql (i.e. postgresql-9.5, postgresql-9.6) installed, what is the correct way to use a certain version of postgresql?
1 Answer
When you are getting the PostgreSQL 9.5.4 when using psql --version, try to locate the path of psql using either of these which psql or locate psql.
You should be able to see which installation of postgres is providing the output.
2