postgresql/contrib/pg_controldata
Thomas G. Lockhart fe92e018d7 Add a few new lines to display recently added fields in the ControlFile
structure.
Now includes the following new fields:
 integer/float date/time storage
 maximum length of names (+1; they must also include a null termination)
 maximum number of function arguments
 maximum length of locale name
2002-07-05 15:31:16 +00:00
..
Makefile To fix the perpetually broken makefiles in the contrib tree, I have 2001-09-06 10:49:30 +00:00
pg_controldata.c Add a few new lines to display recently added fields in the ControlFile 2002-07-05 15:31:16 +00:00
README.pg_controldata Update for new pg_control format. 2001-03-13 01:17:40 +00:00

I had a need to read such things as the backend locale and the catalog
version number from the current database, and couldn't find any existing
program to do that.

The attached utility produces output like this:

$ pg_controldata
pg_control version number:            71
Catalog version number:               200101061
Database state:                       IN_PRODUCTION
pg_control last modified:             Sat Mar 10 00:07:55 2001
Current log file id:                  0
Next log file segment:                9
Latest checkpoint location:           0/88CAA20
Prior checkpoint location:            0/70A5D48
Latest checkpoint's REDO location:    0/88CAA20
Latest checkpoint's UNDO location:    0/0
Latest checkpoint's StartUpID:        22
Latest checkpoint's NextXID:          4711
Latest checkpoint's NextOID:          444704
Time of latest checkpoint:            Sat Mar 10 00:07:52 2001
Database block size:                  8192
Blocks per segment of large relation: 131072
LC_COLLATE:                           C
LC_CTYPE:                             C


To access the pg_control file, the program must be run as the Postgres user,
and PGDATA must be set correctly in its environment.

--
Oliver Elphick                 <olly@lfix.co.uk>