Contents
PG_VERSION (file)
A standard data directory file containing the PostgreSQL major version
PG_VERSION
is a plain-text file located at the top level of every PostgreSQL data directory containing the major PostgreSQL version of the server using the data directory.
Source code
PG_VERSION
is parsed by ValidatePgVersion()
in src/backend/utils/init/miscinit.c.
Examples
In PostgreSQL 10 and later, the version is always a single number:
$ cat /var/lib/pgsql/data/PG_VERSION 13
In PostgreSQL 9.6 and earlier, the value shows the version expressed in series.major_release
format:
$ cat /var/lib/pgsql/data/PG_VERSION 9.6
Categories
See also
PG_VERSION (constant)