diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 7544a6489c..5391647586 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ @@ -411,7 +411,7 @@ syslog = 2 A second way to set these configuration parameters is to give them as a command line option to the postmaster, such as -postmaster --log-connections=yes --syslog=2 +postmaster -c log_connections=yes -c syslog=2 which would have the same effect as the previous example. @@ -422,7 +422,7 @@ postmaster --log-connections=yes --syslog=2 PGOPTIONS can be used for this purpose on the client side: -env PGOPTIONS='--geqo=off' psql +env PGOPTIONS='-c geqo=off' psql (This works for any client application, not just psql.) Note that this won't work for diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 192e5205a1..07e0548509 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.179 2000/11/06 22:18:06 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.180 2000/11/08 17:57:46 petere Exp $ * * NOTES * @@ -372,7 +372,7 @@ PostmasterMain(int argc, char *argv[]) * will occur. */ opterr = 1; - while ((opt = getopt(argc, argv, "A:a:B:b:D:d:Film:MN:no:p:SsV-:?")) != EOF) + while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Film:MN:no:p:SsV-:?")) != EOF) { switch(opt) { @@ -428,7 +428,7 @@ PostmasterMain(int argc, char *argv[]) #ifdef HAVE_INT_OPTRESET optreset = 1; #endif - while ((opt = getopt(argc, argv, "A:a:B:b:D:d:Film:MN:no:p:SsV-:?")) != EOF) + while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Film:MN:no:p:SsV-:?")) != EOF) { switch (opt) { @@ -530,13 +530,19 @@ PostmasterMain(int argc, char *argv[]) */ SendStop = true; break; + case 'c': case '-': { char *name, *value; ParseLongOption(optarg, &name, &value); if (!value) - elog(ERROR, "--%s requires argument", optarg); + { + if (opt == '-') + elog(ERROR, "--%s requires argument", optarg); + else + elog(ERROR, "-c %s requires argument", optarg); + } SetConfigOption(name, value, PGC_POSTMASTER); free(name); @@ -766,6 +772,7 @@ usage(const char *progname) printf(" -A 1|0 enable/disable runtime assert checking\n"); #endif printf(" -B number of shared buffers\n"); + printf(" -c = set run-time parameter\n"); printf(" -d 1-5 debugging level\n"); printf(" -D database directory\n"); printf(" -F turn fsync off\n"); @@ -775,7 +782,7 @@ usage(const char *progname) #endif printf(" -N maximum number of allowed connections (1..%d, default %d)\n", MAXBACKENDS, DEF_MAXBACKENDS); - printf(" -o