summaryrefslogtreecommitdiff
path: root/src/backend/main/main.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-07-04 16:41:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-07-04 16:41:22 +0000
commitb700a672feadbb6f122b7c7249967fb0f58dda2b (patch)
tree85013f1378d8edaa12cf35b039c4aa768bc9b4a9 /src/backend/main/main.c
parentefbbd107c7b08b7a1351c0199ee4602182e09f05 (diff)
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.
Diffstat (limited to 'src/backend/main/main.c')
-rw-r--r--src/backend/main/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index c86b45b132f..e03633a3261 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.57 2003/05/15 16:35:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.58 2003/07/04 16:41:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -37,6 +37,7 @@
#include "miscadmin.h"
#include "bootstrap/bootstrap.h"
#include "tcop/tcopprot.h"
+#include "utils/help_config.h"
#include "utils/ps_status.h"
@@ -198,7 +199,7 @@ main(int argc, char *argv[])
}
/*
- * Now dispatch to one of PostmasterMain, PostgresMain, or
+ * Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain, or
* BootstrapMain depending on the program name (and possibly first
* argument) we were called with. The lack of consistency here is
* historical.
@@ -219,6 +220,14 @@ main(int argc, char *argv[])
exit(BootstrapMain(argc - 1, new_argv + 1));
/*
+ * If the first argument is "--help-config", then invoke runtime
+ * configuration option display mode.
+ * We remove "--help-config" from the arguments passed on to GucInfoMain.
+ */
+ if (argc > 1 && strcmp(new_argv[1], "--help-config") == 0)
+ exit(GucInfoMain(argc - 1, new_argv + 1));
+
+ /*
* Otherwise we're a standalone backend. Invoke PostgresMain,
* specifying current userid as the "authenticated" Postgres user
* name.