Catalog version number
catalog version number is a number defining the system catalog version.
Purpose of the
catalog version number is to prevent a PostgreSQL instance being started up against a data directory with an incompatible format. This is usually only relevant when running pre-release development versions.
catalog version number remains stable throughout the lifetime of a major release.
catalog version number is in
YYYYMMDDN format, representing the date the number was changed, with N representing a simple counter to accomodate for more than one change on the same date.
Obtaining the catalog version number
See below for examples.
catalog version number is an internal implementation detail and is of no particular relevance for normal database operations.
The only place it is likely to be visible to any extent is as part of the internal directory name created within a tablespace directory.
catalog version number is defined in src/include/catalog/catversion.h.
Obtaining the catalogue version number from pg_control:
pg_controldata -D /var/lib/pgsql/data pg_control version number: 1300 Catalog version number: 202010291 Database system identifier: 6891881161586929758 ...
Obtaining the catalogue version number from pg_control_system():
postgres=# SELECT catalog_version_no FROM pg_control_system(); catalog_version_no -------------------- 202010291 (1 row)