<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.31 2000/11/01 21:14:00 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.32 2000/11/08 17:57:45 petere Exp $
-->
<Chapter Id="runtime">
A second way to set these configuration parameters is to give them
as a command line option to the postmaster, such as
<programlisting>
-postmaster --log-connections=yes --syslog=2
+postmaster -c log_connections=yes -c syslog=2
</programlisting>
which would have the same effect as the previous example.
</para>
<envar>PGOPTIONS</envar> can be used for this purpose on the
client side:
<programlisting>
-env PGOPTIONS='--geqo=off' psql
+env PGOPTIONS='-c geqo=off' psql
</programlisting>
(This works for any client application, not just
<application>psql</application>.) Note that this won't work for
*
*
* 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
*
* 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)
{
#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)
{
*/
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);
printf(" -A 1|0 enable/disable runtime assert checking\n");
#endif
printf(" -B <buffers> number of shared buffers\n");
+ printf(" -c <name>=<value> set run-time parameter\n");
printf(" -d 1-5 debugging level\n");
printf(" -D <directory> database directory\n");
printf(" -F turn fsync off\n");
#endif
printf(" -N <number> maximum number of allowed connections (1..%d, default %d)\n",
MAXBACKENDS, DEF_MAXBACKENDS);
- printf(" -o <option> pass `option' to each backend server\n");
+ printf(" -o <option> pass 'option' to each backend server\n");
printf(" -p <port> port number to listen on\n");
printf(" -S silent mode (dissociate from tty)\n");
printf(" -n don't reinitialize shared memory after abnormal exit\n");
printf(" -s send SIGSTOP to all backend servers if one dies\n");
- printf("\nPlease read the documentation for the complete list of runtime\n"
+ printf("\nPlease read the documentation for the complete list of run-time\n"
"configuration settings and how to set them on the command line or in\n"
"the configuration file.\n\n");
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.186 2000/11/06 22:18:08 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.187 2000/11/08 17:57:46 petere Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
fprintf(stderr, "\t-A on\t\tenable/disable assert checking\n");
#endif
fprintf(stderr, "\t-B buffers\tset number of buffers in buffer pool\n");
+ fprintf(stderr, "\t-c name=value\tset run-time parameter\n");
fprintf(stderr, "\t-C \t\tsuppress version info\n");
fprintf(stderr, "\t-D dir\t\tdata directory\n");
fprintf(stderr, "\t-E \t\techo query before execution\n");
optind = 1; /* reset after postmaster's usage */
- while ((flag = getopt(argc, argv, "A:B:CD:d:Eef:FiLNOPo:p:S:st:v:VW:x:-:?")) != EOF)
+ while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiLNOPo:p:S:st:v:VW:x:-:?")) != EOF)
switch (flag)
{
case 'A':
#endif
break;
+ case 'c':
case '-':
{
char *name, *value;
exit(0);
}
if (!value)
- elog(ERROR, "--%s requires argument", optarg);
+ {
+ if (flag == '-')
+ elog(ERROR, "--%s requires argument", optarg);
+ else
+ elog(ERROR, "-c %s requires argument", optarg);
+ }
SetConfigOption(name, value, PGC_BACKEND);
free(name);
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.186 $ $Date: 2000/11/06 22:18:08 $\n");
+ puts("$Revision: 1.187 $ $Date: 2000/11/08 17:57:46 $\n");
}
/*