Getting the database cluster and client tools version
The PostgreSQL version allows the developer to know the supported features and helps them write compatible SQL queries for different versions. For example, the process ID attribute name in the pg_stat_activity
view in PostgreSQL versions older than 9.2 is procpid
; in PostgreSQL version 9.2, this attribute name is pid
.
Getting ready
Getting the database and build version right is important because it allows the developer to know the supported features and compatibility between client tools and the backend version.
How to do it…
The version()
function, as shown in the following query, shows the version information as well as build system:
car_portal=# SELECT version (); version ------------------------------------------------------------- PostgreSQL 9.4.1, compiled by Visual C++ build 1800, 64-bit (1 row)
There's more…
It is also important to check the client tools' version, whether it is pg_restore
, pg_dumpall
or...