Move pg_controldata from /contrib to src/bin.
authorBruce Momjian
Fri, 16 Aug 2002 20:34:06 +0000 (20:34 +0000)
committerBruce Momjian
Fri, 16 Aug 2002 20:34:06 +0000 (20:34 +0000)
contrib/pg_controldata/README.pg_controldata [deleted file]
doc/src/sgml/ref/allfiles.sgml
doc/src/sgml/ref/pg_controldata.sgml [new file with mode: 0644]
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/reference.sgml
src/bin/pg_controldata/Makefile [new file with mode: 0644]
src/bin/pg_controldata/pg_controldata.c [moved from contrib/pg_controldata/pg_controldata.c with 97% similarity]

diff --git a/contrib/pg_controldata/README.pg_controldata b/contrib/pg_controldata/README.pg_controldata
deleted file mode 100644 (file)
index 85ca0e1..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-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                 
index 502cdb0e42c713cd508f1a2407af916995bfbdf0..47afe90c9015a52512cb83d4ddf6f794069a181c 100644 (file)
@@ -1,5 +1,5 @@
 
@@ -132,6 +132,7 @@ Complete list of usable sgml source files in this directory.
 
 
 
+
 
 
 
diff --git a/doc/src/sgml/ref/pg_controldata.sgml b/doc/src/sgml/ref/pg_controldata.sgml
new file mode 100644 (file)
index 0000000..2062c06
--- /dev/null
@@ -0,0 +1,74 @@
+
+
+
+  pg_controldata
+  1
+  Application
+
+  pg_controldata
+  display server-wide control information
+
+  
+   pg_controldata
+   datadir
+  
+
+  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
+     
+    
+   
+
+  
+
+
+
index 4ddc70d212024da0aee7d5b87e63448edf285be3..553d3e7dac8fbe2280a71d8acf5dc2889bc3321b 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -22,7 +22,7 @@ PostgreSQL documentation
    psql
    options
    dbname
-     user
+   user
   
  
 
index 3c6af16730b4d9e41aeaf6b45d80a98fd3f74ce5..b8605220025de44bb5d4d5919f5341f63c1d7ca4 100644 (file)
@@ -1,5 +1,5 @@
 
@@ -201,6 +201,7 @@ Disable this chapter until we have more functions documented.
    &initlocation;
    &ipcclean;
    &pgCtl;
+   &pgControldata;
    &postgres;
    &postmaster;
 
diff --git a/src/bin/pg_controldata/Makefile b/src/bin/pg_controldata/Makefile
new file mode 100644 (file)
index 0000000..d1e3d65
--- /dev/null
@@ -0,0 +1,35 @@
+#-------------------------------------------------------------------------
+#
+# 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
similarity index 97%
rename from contrib/pg_controldata/pg_controldata.c
rename to src/bin/pg_controldata/pg_controldata.c
index b1ac873d2418d58b9c53eeca7317b6573ccde387..a77c2e22fa6694beaefa2bfb073615ffca711b92 100644 (file)
@@ -6,7 +6,7 @@
  * 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"