mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Move pg_controldata from /contrib to src/bin.
This commit is contained in:
@ -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 <olly@lfix.co.uk>
|
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.44 2002/08/04 04:31:44 momjian Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/allfiles.sgml,v 1.45 2002/08/16 20:34:06 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
Complete list of usable sgml source files in this directory.
|
Complete list of usable sgml source files in this directory.
|
||||||
-->
|
-->
|
||||||
@ -132,6 +132,7 @@ Complete list of usable sgml source files in this directory.
|
|||||||
<!entity ipcclean system "ipcclean.sgml">
|
<!entity ipcclean system "ipcclean.sgml">
|
||||||
<!entity pgAccess system "pgaccess-ref.sgml">
|
<!entity pgAccess system "pgaccess-ref.sgml">
|
||||||
<!entity pgConfig system "pg_config-ref.sgml">
|
<!entity pgConfig system "pg_config-ref.sgml">
|
||||||
|
<!entity pgControldata system "pg_controldata.sgml">
|
||||||
<!entity pgCtl system "pg_ctl-ref.sgml">
|
<!entity pgCtl system "pg_ctl-ref.sgml">
|
||||||
<!entity pgDump system "pg_dump.sgml">
|
<!entity pgDump system "pg_dump.sgml">
|
||||||
<!entity pgDumpall system "pg_dumpall.sgml">
|
<!entity pgDumpall system "pg_dumpall.sgml">
|
||||||
|
74
doc/src/sgml/ref/pg_controldata.sgml
Normal file
74
doc/src/sgml/ref/pg_controldata.sgml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<!--
|
||||||
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_controldata.sgml,v 1.1 2002/08/16 20:34:06 momjian Exp $
|
||||||
|
PostgreSQL documentation
|
||||||
|
-->
|
||||||
|
|
||||||
|
<refentry id="APP-PGCONTROLDATA">
|
||||||
|
<refmeta>
|
||||||
|
<refentrytitle id="APP-PGCONTROLDATA-TITLE"><application>pg_controldata</application></refentrytitle>
|
||||||
|
<manvolnum>1</manvolnum>
|
||||||
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
|
</refmeta>
|
||||||
|
|
||||||
|
<refnamediv>
|
||||||
|
<refname>pg_controldata</refname>
|
||||||
|
<refpurpose>display server-wide control information</refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<cmdsynopsis>
|
||||||
|
<command>pg_controldata</command>
|
||||||
|
<arg><replaceable class="parameter">datadir</replaceable></arg>
|
||||||
|
</cmdsynopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-PGCONTROLDATA-1">
|
||||||
|
<title>Description</title>
|
||||||
|
<para>
|
||||||
|
<command>pg_controldata</command> returns information initialized during
|
||||||
|
<application>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.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
You can specify the data directory on the command line, or use
|
||||||
|
the environment variable <envar>PGDATA</>.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Environment</title>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><envar>PGDATA</envar></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Default data direction location
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.71 2002/08/10 19:35:00 tgl Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.72 2002/08/16 20:34:06 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ PostgreSQL documentation
|
|||||||
<command>psql</command>
|
<command>psql</command>
|
||||||
<arg><replaceable class="parameter">options</replaceable></arg>
|
<arg><replaceable class="parameter">options</replaceable></arg>
|
||||||
<arg><replaceable class="parameter">dbname</replaceable>
|
<arg><replaceable class="parameter">dbname</replaceable>
|
||||||
<arg><replaceable class="parameter">user</replaceable></arg></arg>
|
<arg><replaceable class="parameter">user</replaceable></arg></arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!-- reference.sgml
|
<!-- reference.sgml
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/reference.sgml,v 1.33 2002/08/04 04:31:44 momjian Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/reference.sgml,v 1.34 2002/08/16 20:34:06 momjian Exp $
|
||||||
|
|
||||||
PostgreSQL Reference Manual
|
PostgreSQL Reference Manual
|
||||||
-->
|
-->
|
||||||
@ -201,6 +201,7 @@ Disable this chapter until we have more functions documented.
|
|||||||
&initlocation;
|
&initlocation;
|
||||||
&ipcclean;
|
&ipcclean;
|
||||||
&pgCtl;
|
&pgCtl;
|
||||||
|
&pgControldata;
|
||||||
&postgres;
|
&postgres;
|
||||||
&postmaster;
|
&postmaster;
|
||||||
|
|
||||||
|
35
src/bin/pg_controldata/Makefile
Normal file
35
src/bin/pg_controldata/Makefile
Normal file
@ -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
|
@ -6,7 +6,7 @@
|
|||||||
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
|
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
|
||||||
* licence: BSD
|
* 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"
|
#include "postgres.h"
|
||||||
|
|
Reference in New Issue
Block a user