How to check Postgres version

Postgres releases a new major version about once a year. For psql, it works best with servers of the same or an older major version.

There are multiple ways to check the Postgres server version.

With psql

The most common way is to use psql:

psql -c "SELECT version();"

or

psql -c "SHOW server_version;"

To check the psql client version:

psql --version

Without psql

pg_config --version

or

postgres --version

References

Edit this page on GitHub

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.