A server utility to show global state information for a database cluster

pg_controldata is a server utility which displays global state information about a database cluster stored in the global/pg_control file. This information includes cluster characteristics fixed during the initdb process such as blocksize as well as WAL / checkpoint-related data and data page checksums.

pg_controldata is included with the PostgreSQL core distribution; prior to PostgreSQL 7.3 it was a contrib module.

SQL alternatives

From PostgreSQL 9.6 the contents of pg_control can be directly queried with the following functions:

Change history


Example output:

$ pg_controldata -D /path/to/pgdata
pg_control version number:            1201
Catalog version number:               201909212
Database system identifier:           6872135480623396628
Database cluster state:               in archive recovery
pg_control last modified:             Mon 14 Sep 2020 09:35:29 AM UTC
Latest checkpoint location:           0/2000060
Latest checkpoint's REDO location:    0/2000028
Latest checkpoint's REDO WAL file:    000000010000000000000002
Latest checkpoint's TimeLineID:       1
Latest checkpoint's PrevTimeLineID:   1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:          0:495
Latest checkpoint's NextOID:          24576
Latest checkpoint's NextMultiXactId:  1
Latest checkpoint's NextMultiOffset:  0
Latest checkpoint's oldestXID:        479
Latest checkpoint's oldestXID's DB:   1
Latest checkpoint's oldestActiveXID:  495
Latest checkpoint's oldestMultiXid:   1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint:            Mon 14 Sep 2020 09:35:28 AM UTC
Fake LSN counter for unlogged rels:   0/3E8
Minimum recovery ending location:     0/2000100
Min recovery ending loc's timeline:   1
Backup start location:                0/0
Backup end location:                  0/0
End-of-backup record required:        no
wal_level setting:                    replica
wal_log_hints setting:                on
max_connections setting:              20
max_worker_processes setting:         8
max_wal_senders setting:              10
max_prepared_xacts setting:           10
max_locks_per_xact setting:           64
track_commit_timestamp setting:       off
Maximum data alignment:               8
Database block size:                  8192
Blocks per segment of large relation: 131072
WAL block size:                       8192
Bytes per WAL segment:                16777216
Maximum length of identifiers:        64
Maximum columns in an index:          32
Maximum size of a TOAST chunk:        1996
Size of a large-object chunk:         2048
Date/time type storage:               64-bit integers
Float4 argument passing:              by value
Float8 argument passing:              by value
Data page checksum version:           1
Mock authentication nonce:            f5f96b5d2aee1c18e95333fb089ac55415aa1aef63158456fdcd09044f00bb32


Management / adminstration, PostgreSQL internals, Replication, Server utility

See also

pg_control_system(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), IDENTIFY_SYSTEM