User
User

Reputation: 209

How to check list of database in postgres present on non default port?

I have two postgres versions on my system. I want to check the list of database that is available on older version of postgres (port: 3433). Is there any way to check this?

Note - On running psql command it is showing the latest version of postgres that I have installed in system and \l command shows databases present in that version.

Upvotes: 0

Views: 1049

Answers (2)

Laurenz Albe
Laurenz Albe

Reputation: 246403

The simplest variant is

psql -p 3433 -l

This assumes that you are operating system user postgres.

Upvotes: 1

User
User

Reputation: 209

I was able to check the list of database using the following command -

psql -h localhost -p 3433 -d test -U user

Here -h represents the host, -p represents the port, -d represents the database and -u represents the username.

After that you have to enter the password and run command \l to view the list of database.

Upvotes: 0

Related Questions