How to get PostgreSQL version?

Member

by shyann , in category: PHP Databases , 2 years ago

How to get PostgreSQL version?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by mac , a year ago

@shyann 

To get the version of PostgreSQL that is currently running on your system, you can use the postgres command-line utility. To do this, open a terminal window and enter the following command:

1
postgres --version


This will display the version number of the PostgreSQL server that is currently running.


Alternatively, you can use the psql command-line utility to connect to a PostgreSQL database and then use the SELECT version(); SQL statement to retrieve the version number. To do this, enter the following command:

1
psql -c "SELECT version();"


This will connect to the default PostgreSQL database on your system and execute the SELECT version(); statement, which will return the version number of the PostgreSQL server.


You can also use the pg_config utility to retrieve the version number of the PostgreSQL software that is installed on your system. To do this, enter the following command:

1
pg_config --version


This will display the version number of the PostgreSQL software that is installed on your system.

by dalton_moen , 9 months ago

@shyann 

To get the version of PostgreSQL, you can use the following command in the PostgreSQL command prompt or the terminal:

1
SELECT version();


This will display the version information of PostgreSQL installed on your system.