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 this output:

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
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "But the LORD is in his holy temple; let all the earth 
      keep silence before him."           Habakkuk 2:20
Wed, 07 Feb 2001 21:36:31 +0000
"Oliver Elphick" <olly@lfix.co.uk>
Utility program to read parameters of the current database
I have added this to /contrib.  It meets the needs of several posters.


> 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 this output:
> 
> 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:                
> 
> 
Content-Description: pg_controldata.c

[ Attachment, skipping... ]

> Oliver Elphick                                Oliver.Elphick@lfix.co.uk
> Isle of Wight                              http://www.lfix.co.uk/oliver
> PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
> GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
>                  ========================================
>      "But the LORD is in his holy temple; let all the earth 
>       keep silence before him."           Habakkuk 2:20 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 23 Feb 2001 15:38:45 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Utility program to read parameters of the current database