From b25e60d8874e5a32faa43493f95027ff85fcee76 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Fri, 23 Feb 2001 20:38:35 +0000
Subject: [PATCH] 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
---
 contrib/README                               |   4 +
 contrib/pg_controldata/Makefile              |  36 ++++++
 contrib/pg_controldata/README.pg_controldata |  19 +++
 contrib/pg_controldata/pg_controldata        | Bin 0 -> 11795 bytes
 contrib/pg_controldata/pg_controldata.c      | 123 +++++++++++++++++++
 contrib/pg_controldata/pg_controldata.o      | Bin 0 -> 8368 bytes
 6 files changed, 182 insertions(+)
 create mode 100644 contrib/pg_controldata/Makefile
 create mode 100644 contrib/pg_controldata/README.pg_controldata
 create mode 100755 contrib/pg_controldata/pg_controldata
 create mode 100644 contrib/pg_controldata/pg_controldata.c
 create mode 100644 contrib/pg_controldata/pg_controldata.o

diff --git a/contrib/README b/contrib/README
index 1988c068abe..79d95b2e3e1 100644
--- a/contrib/README
+++ b/contrib/README
@@ -85,6 +85,10 @@ oid2name -
 	maps numeric files to table names
 	by B Palmer <bpalmer@crimelabs.net>
 
+pg_controldata -
+	Dump internal database site structures
+	by Oliver Elphick <olly@lfix.co.uk>
+
 pg_dumplo -
 	Dump large objects
 	by Karel Zak <zakkr@zf.jcu.cz>
diff --git a/contrib/pg_controldata/Makefile b/contrib/pg_controldata/Makefile
new file mode 100644
index 00000000000..fde5ab1e73b
--- /dev/null
+++ b/contrib/pg_controldata/Makefile
@@ -0,0 +1,36 @@
+#
+# $Header: /cvsroot/pgsql/contrib/pg_controldata/Attic/Makefile,v 1.1 2001/02/23 20:38:35 momjian Exp $
+#
+
+subdir = contrib/pg_controldata
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+
+override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
+
+OBJS	= pg_controldata.o
+
+all: pg_controldata
+
+pg_controldata: $(OBJS) $(libpq_builddir)/libpq.a
+	$(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@
+
+install: all installdirs
+	$(INSTALL_PROGRAM) pg_controldata$(X)	$(bindir)
+	$(INSTALL_DATA) README.pg_controldata	$(docdir)/contrib
+
+installdirs:
+	$(mkinstalldirs) $(bindir) $(docdir)/contrib
+
+uninstall:
+	rm -f $(bindir)/pg_controldata$(X) $(docdir)/contrib/README.pg_controldata
+
+clean distclean maintainer-clean:
+	rm -f pg_controldata$(X) $(OBJS)
+
+depend dep:
+	$(CC) -MM -MG $(CFLAGS) *.c > depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif
diff --git a/contrib/pg_controldata/README.pg_controldata b/contrib/pg_controldata/README.pg_controldata
new file mode 100644
index 00000000000..e1c4192cfea
--- /dev/null
+++ b/contrib/pg_controldata/README.pg_controldata
@@ -0,0 +1,19 @@
+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                 <olly@lfix.co.uk>
diff --git a/contrib/pg_controldata/pg_controldata b/contrib/pg_controldata/pg_controldata
new file mode 100755
index 0000000000000000000000000000000000000000..59f2e4d14d0b877646722b816dbfb54fd0d1815a
GIT binary patch
literal 11795
zcmbta4UC+{c^><Y#F+9A1(K4k0;XWjcl+(%?d|5M?fWrK58w4}4LCLZ*#BL;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ssp-H6n@ZCnRWfg5#$DbI6x&D^Nq7IIF%3F&(1+m7@J^oQ1WncQYP
z1$mAn^FM)<>je_jcd4vPeB7huFIR151i{od8r;d#-VX9eoBAFB&G9hhPlB!?|Gnz_
z6XdggEq|H%OVB2;zVCtPg};m<<!Jo_qWuo=UqPGk<-5KA0DUv$xn5KLHAMRz<9X1=
z-zfh!=osX=o=|>0CX(@AzLVsm3j5vQ6`)5UZ{9s#5Be-<-pF2s{s@7#-yPl#+KlfN
z$d7=|Kpx^!-ymrFUF9~=_PfKoKo=l?dmw)gXugT)Maug2A~o%~3iBri+I|OF1^pn(
zn|F>a(6;`0&}P1{KOP2cziT`J+J1-mMbIapuM^nw70@TG_TbNe@8DW!&E1a62Zl;-
zpdf)afsk?CLeteRm#}}uKFH0s4}v?AnVfdVc8$8Y8pBgbx6rQF=M~;5<#CMGbY<h@
zx}z&n(3r!icVmrC*;EBOMS5cAOa@B14-1qAl?55AFQ}j`cqi$Z2b0~GovYt%>c@}4
zV@;e6;I*cCA!%N6;^0<4hg^9?8F1uD=gQMh`|YG$tMN~U?8$>Cqrt08>*=NLkPE*x
O<?G8;k3U!5lKwB(UKWV}

literal 0
HcmV?d00001

diff --git a/contrib/pg_controldata/pg_controldata.c b/contrib/pg_controldata/pg_controldata.c
new file mode 100644
index 00000000000..9cd148f6f48
--- /dev/null
+++ b/contrib/pg_controldata/pg_controldata.c
@@ -0,0 +1,123 @@
+/* pg_controldata
+ *
+ * reads the data from $PGDATA/global/pg_control
+ *
+ * copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
+ * licence: BSD
+ *
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+
+typedef unsigned int uint32;
+
+#include "config.h"
+#include "access/xlogdefs.h"
+
+/*
+ * #include "access/xlog.h"
+ * #include "c.h"
+ */
+
+/* The following definitions are extracted from access/xlog.h and its
+ * recursive includes. There is too much initialisation needed if
+ * they are included direct. Perhaps someone more knowledgeable can
+ * fix that.
+ */
+typedef struct crc64
+{
+	uint32      crc1;
+	uint32      crc2;
+} crc64;
+
+#define LOCALE_NAME_BUFLEN  128
+
+typedef enum DBState
+{
+	DB_STARTUP = 0,
+	DB_SHUTDOWNED,
+	DB_SHUTDOWNING,
+	DB_IN_RECOVERY,
+	DB_IN_PRODUCTION
+} DBState;
+
+
+typedef struct ControlFileData
+{
+   crc64    crc;
+   uint32      logId;         /* current log file id */
+   uint32      logSeg;        /* current log file segment (1-based) */
+   struct 
+	XLogRecPtr	checkPoint;    /* last check point record ptr */
+   time_t      time;       /* time stamp of last modification */
+   DBState     state;         /* see enum above */
+
+   /*
+    * this data is used to make sure that configuration of this DB is
+    * compatible with the backend executable
+    */
+   uint32      blcksz;        /* block size for this DB */
+   uint32      relseg_size;   /* blocks per segment of large relation */
+   uint32      catalog_version_no;     /* internal version number */
+   /* active locales --- "C" if compiled without USE_LOCALE: */
+   char     lc_collate[LOCALE_NAME_BUFLEN];
+   char     lc_ctype[LOCALE_NAME_BUFLEN];
+
+   /*
+    * important directory locations
+    */
+   char     archdir[MAXPGPATH];     /* where to move offline log files */
+} ControlFileData;
+
+int main() {
+	ControlFileData ControlFile;
+	int fd;
+	char ControlFilePath[MAXPGPATH];
+	char *DataDir;
+	char tmdt[32];
+
+	DataDir = getenv("PGDATA");
+	if ( DataDir == NULL ) {
+		fprintf(stderr,"PGDATA is not defined\n");
+		exit(1);
+	}
+
+	snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
+
+	if ((fd = open(ControlFilePath, O_RDONLY)) == -1) {
+		perror("Failed to open $PGDATA/global/pg_control for reading");
+		exit(2);
+	}
+
+	read(fd, &ControlFile, sizeof(ControlFileData));
+	strftime(tmdt, 32, "%c", localtime(&(ControlFile.time)));
+
+	printf("Log file id:                          %u\n"
+	       "Log file segment:                     %u\n"
+			 "Last modified:                        %s\n"
+			 "Database block size:                  %u\n"
+			 "Blocks per segment of large relation: %u\n"
+			 "Catalog version number:               %u\n"
+			 "LC_COLLATE:                           %s\n"
+			 "LC_CTYPE:                             %s\n"
+			 "Log archive directory:                %s\n",
+			 ControlFile.logId,
+			 ControlFile.logSeg,
+			 tmdt,
+			 ControlFile.blcksz,
+			 ControlFile.relseg_size,
+			 ControlFile.catalog_version_no,
+			 ControlFile.lc_collate,
+			 ControlFile.lc_ctype,
+			 ControlFile.archdir);
+	
+	return (0);
+}
+
diff --git a/contrib/pg_controldata/pg_controldata.o b/contrib/pg_controldata/pg_controldata.o
new file mode 100644
index 0000000000000000000000000000000000000000..fd6b532b940f4cd363d9733eb1aac48e0702a0b5
GIT binary patch
literal 8368
zcmds6eT*Gd6~Eio52^?j5e=w=p$K)m`{wI?@}TX$Z7D9>$M!94L*em0=DnTnyf@pK
zdE4$L>XK&Frc{CW7p95?4T;7eAx0DbAke6P7y|_T2MrjNn9#%+i4v@?zjN-)?A>jt
zAAfq&*ZG}u&pG$pbI(0@_Ri<WCw31F4T+=;iH%~F5@OSJvd7}bP2vOMeTgVPr%(Rj
zfpZg=39)~M=s%ucSy?%8cGL2+gRL{~0b`YWWQaT8xcnitRcAiVQk#T0edguAuB_~5
zsUt!@Pd<0z>_<+#y)w9F#!So~*}x*Fe*lJ<8GaWumtTH+Wu-bL`OD{sU|gM{@sDVy
z&peZwK5<q%y)58o_4M-6-}xcvaccQI>781BOFrJD$Np2xuSxRP^q84VoY0>=b>=D9
zJbCWk=if_?pi$g1`bb8Pu@H}or>+!Y3+Og})b7MD!S?~*LQJ$CeoF+<zJlKp0km)8
zw?qK#XZS4<K>ICzO9aqX@LM8)HU=k_7zy!31%FGyKUMJW6)ZNa>TXf+Rt4Xx;8_KK
zLBWqJ_^g6oV0<%s_bTIUjL$L7F#a23iXd`tBl%-6zJf93fDqR)mKpge#y0aU#(BoK
zF)lEkV0;_ngN%1D?l9iTIAFYs@e<=P#t$;CFn*Nr9>(8hd^_W37=MQGbBv{*KW8lc
z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