head	1.3;
access;
symbols
	REL7_2_8:1.2
	REL7_2_7:1.2
	REL7_2_6:1.2
	REL7_2_5:1.2
	REL7_2_4:1.2
	REL7_2_3:1.2
	REL7_2_STABLE:1.2.0.4
	REL7_2:1.2
	REL7_2_RC2:1.2
	REL7_2_RC1:1.2
	REL7_2_BETA5:1.2
	REL7_2_BETA4:1.2
	REL7_2_BETA3:1.2
	REL7_2_BETA2:1.2
	REL7_2_BETA1:1.2
	REL7_1_2:1.2
	REL7_1_STABLE:1.2.0.2
	REL7_1:1.2;
locks; strict;
comment	@# @;


1.3
date	2002.08.16.20.34.06;	author momjian;	state dead;
branches;
next	1.2;

1.2
date	2001.03.13.01.17.40;	author tgl;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.23.20.38.35;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Move pg_controldata from /contrib to src/bin.
@
text
@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>
@


1.2
log
@Update for new pg_control format.
@
text
@@


1.1
log
@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.

linda:~$ pg_controldata
Log file id:                          0
Log file segment:                     5
Last modified:                        Wed Feb  7 19:35:47 2001
Database block size:                  8192
Blocks per segment of large relation: 131072
Catalog version number:               200101061
LC_COLLATE:                           en_GB
LC_CTYPE:                             en_GB
Log archive directory:

Oliver Elphick                                Oliver.Elphick@@lfix.co.uk
@
text
@d5 1
a5 1
The attached utility produces this output:
d7 15
a21 4
linda:~$ pg_controldata
Log file id:                          0
Log file segment:                     5
Last modified:                        Wed Feb  7 19:35:47 2001
d24 6
a29 4
Catalog version number:               200101061
LC_COLLATE:                           en_GB
LC_CTYPE:                             en_GB
Log archive directory:                
@
