+++ /dev/null
-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.
-
---
--- /dev/null
+
+
+
+
+ 1
+ Application
+
+
+
+ pg_controldata
+ display server-wide control information
+
+
+
+
+ pg_controldata
+
+
+
+
+
Description
+ pg_controldata returns information initialized during
+
initdb>. such as the catalog version and server encoding.
+ It also shows information about write-ahead logging and checkpoint
+ processing. This information is server-wide, and not specific to any one
+ database.
+
+
+ You can specify the data directory on the command line, or use
+ the environment variable PGDATA>.
+
+
+
+
+
Environment
+
+
+
+ PGDATA
+
+
+ Default data direction location
+
+
+
+
+
+
+
+
+
&initlocation;
&ipcclean;
&pgCtl;
+ &pgControldata;
&postgres;
&postmaster;
--- /dev/null
+#-------------------------------------------------------------------------
+#
+# Makefile for src/bin/pg_controldata
+#
+# Copyright (c) 1998, PostgreSQL Global Development Group
+#
+# $Header: /cvsroot/pgsql/src/bin/pg_controldata/Makefile,v 1.1 2002/08/16 20:34:06 momjian Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/bin/pg_controldata
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+OBJS= pg_controldata.o pg_crc.o
+
+pg_crc.c: $(top_builddir)/src/backend/utils/hash/pg_crc.c
+ rm -f $@ && $(LN_S) $< .
+
+all: submake-libpq submake-libpgport pg_controldata
+
+pg_controldata: $(OBJS)
+ $(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@
+
+install: all installdirs
+ $(INSTALL_PROGRAM) pg_controldata$(X) $(DESTDIR)$(bindir)/pg_controldata$(X)
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+
+uninstall:
+ rm -f $(DESTDIR)$(bindir)/pg_controldata$(X)
+
+clean distclean maintainer-clean:
+ rm -f pg_controldata$(X) pg_controldata.o pg_crc.o pg_crc.c
* copyright (c) Oliver Elphick
, 2001;
* licence: BSD
*
- * $Header: /cvsroot/pgsql/contrib/pg_controldata/Attic/pg_controldata.c,v 1.7 2002/08/14 03:01:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.1 2002/08/16 20:34:06 momjian Exp $
*/
#include "postgres.h"