Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b700a67

Browse files
committed
Add --help-config facility to dump information about GUC parameters
without needing a running backend. Reorder postgresql.conf.sample to match new layout of runtime.sgml. This commit re-adds work lost in Wednesday's crash.
1 parent efbbd10 commit b700a67

File tree

10 files changed

+1898
-685
lines changed

10 files changed

+1898
-685
lines changed

doc/src/sgml/runtime.sgml

Lines changed: 268 additions & 268 deletions
Large diffs are not rendered by default.

src/backend/main/main.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*
1515
* IDENTIFICATION
16-
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.57 2003/05/15 16:35:28 momjian Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.58 2003/07/04 16:41:21 tgl Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -37,6 +37,7 @@
3737
#include "miscadmin.h"
3838
#include "bootstrap/bootstrap.h"
3939
#include "tcop/tcopprot.h"
40+
#include "utils/help_config.h"
4041
#include "utils/ps_status.h"
4142

4243

@@ -198,7 +199,7 @@ main(int argc, char *argv[])
198199
}
199200

200201
/*
201-
* Now dispatch to one of PostmasterMain, PostgresMain, or
202+
* Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain, or
202203
* BootstrapMain depending on the program name (and possibly first
203204
* argument) we were called with. The lack of consistency here is
204205
* historical.
@@ -218,6 +219,14 @@ main(int argc, char *argv[])
218219
if (argc > 1 && strcmp(new_argv[1], "-boot") == 0)
219220
exit(BootstrapMain(argc - 1, new_argv + 1));
220221

222+
/*
223+
* If the first argument is "--help-config", then invoke runtime
224+
* configuration option display mode.
225+
* We remove "--help-config" from the arguments passed on to GucInfoMain.
226+
*/
227+
if (argc > 1 && strcmp(new_argv[1], "--help-config") == 0)
228+
exit(GucInfoMain(argc - 1, new_argv + 1));
229+
221230
/*
222231
* Otherwise we're a standalone backend. Invoke PostgresMain,
223232
* specifying current userid as the "authenticated" Postgres user

src/backend/tcop/postgres.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.348 2003/06/20 21:58:02 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.349 2003/07/04 16:41:21 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1910,6 +1910,7 @@ usage(char *progname)
19101910
printf(" -P disable system indexes\n");
19111911
printf(" -s show statistics after each query\n");
19121912
printf(" -S SORT-MEM set amount of memory for sorts (in kbytes)\n");
1913+
printf(" --help-config show configuration options, then exit. Details: --help-config -h\n");
19131914
printf(" --help show this help, then exit\n");
19141915
printf(" --version output version information, then exit\n");
19151916
printf("\nDeveloper options:\n");
@@ -2547,7 +2548,7 @@ PostgresMain(int argc, char *argv[], const char *username)
25472548
if (!IsUnderPostmaster)
25482549
{
25492550
puts("\nPOSTGRES backend interactive interface ");
2550-
puts("$Revision: 1.348 $ $Date: 2003/06/20 21:58:02 $\n");
2551+
puts("$Revision: 1.349 $ $Date: 2003/07/04 16:41:21 $\n");
25512552
}
25522553

25532554
/*

src/backend/utils/misc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.20 2002/11/01 22:52:33 tgl Exp $
1+
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.21 2003/07/04 16:41:21 tgl Exp $
22

33
subdir = src/backend/utils/misc
44
top_builddir = ../../../..
55
include $(top_builddir)/src/Makefile.global
66

77
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
88

9-
OBJS = database.o superuser.o guc.o ps_status.o
9+
OBJS = database.o superuser.o guc.o help_config.o ps_status.o
1010

1111
# This location might depend on the installation directories. Therefore
1212
# we can't subsitute it into config.h.

0 commit comments

Comments
 (0)