Display PostgreSQL/PgSQL version


To display the PostgreSQL version number (and other information like compiler version used to build PgSQL) issue the following SQL statement from within psql:

SELECT version();

To quickly determine just the PostgreSQL version number, run this command from the OS command line:

psql --version

The Conversation

Follow the reactions below and share your own thoughts.

  • Valentin LAB

    Warning, “psql –version“ is the version of the psql client, whereas using “SELECT version();“ will issue the version of the postgres server. This is notoriously different in Ubuntu installation where multiple servers can be installed on the same host and where the psql client is always the last one, but will be used to access older version still available on the same server.