Fix a couple remaining places where GUC variables were assigned to

directly, rather than through SetConfigOption().
This commit is contained in:
Tom Lane 2001-06-25 22:56:05 +00:00
parent 4d58a7ca87
commit 2e67a67715
2 changed files with 15 additions and 17 deletions

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.227 2001/06/23 22:23:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.228 2001/06/25 22:56:05 tgl Exp $
* *
* NOTES * NOTES
* *
@ -371,7 +371,7 @@ PostmasterMain(int argc, char *argv[])
/* PGPORT environment variable, if set, overrides GUC setting */ /* PGPORT environment variable, if set, overrides GUC setting */
if (getenv("PGPORT")) if (getenv("PGPORT"))
PostPortNumber = atoi(getenv("PGPORT")); SetConfigOption("port", getenv("PGPORT"), PGC_POSTMASTER, true);
potential_DataDir = getenv("PGDATA"); /* default value */ potential_DataDir = getenv("PGDATA"); /* default value */
@ -447,7 +447,6 @@ PostmasterMain(int argc, char *argv[])
/* already done above */ /* already done above */
break; break;
case 'd': case 'd':
/* /*
* Turn on debugging for the postmaster and the backend * Turn on debugging for the postmaster and the backend
* servers descended from it. * servers descended from it.
@ -561,7 +560,6 @@ PostmasterMain(int argc, char *argv[])
*/ */
if (NBuffers < 2 * MaxBackends || NBuffers < 16) if (NBuffers < 2 * MaxBackends || NBuffers < 16)
{ {
/* /*
* Do not accept -B so small that backends are likely to starve * Do not accept -B so small that backends are likely to starve
* for lack of buffers. The specific choices here are somewhat * for lack of buffers. The specific choices here are somewhat

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.225 2001/06/23 22:23:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.226 2001/06/25 22:56:04 tgl Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
@ -1108,7 +1108,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
int flag; int flag;
const char *DBName = NULL; const char *DBName = NULL;
bool secure = true; bool secure;
int errs = 0; int errs = 0;
GucContext ctx; GucContext ctx;
char *tmp; char *tmp;
@ -1121,9 +1121,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
char *potential_DataDir = NULL; char *potential_DataDir = NULL;
/* all options are allowed until '-p' */
ctx = PGC_POSTMASTER;
/* /*
* Catch standard options before doing much else. This even works on * Catch standard options before doing much else. This even works on
* systems without getopt_long. * systems without getopt_long.
@ -1190,6 +1187,10 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
* ---------------- * ----------------
*/ */
/* all options are allowed until '-p' */
secure = true;
ctx = PGC_POSTMASTER;
optind = 1; /* reset after postmaster's usage */ optind = 1; /* reset after postmaster's usage */
while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiLNOPo:p:S:st:v:W:x:-:")) != EOF) while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiLNOPo:p:S:st:v:W:x:-:")) != EOF)
@ -1225,18 +1226,17 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
break; break;
case 'd': /* debug level */ case 'd': /* debug level */
tmp = "true";
SetConfigOption("debug_level", optarg, ctx, true); SetConfigOption("debug_level", optarg, ctx, true);
if (DebugLvl >= 1) if (DebugLvl >= 1)
SetConfigOption("log_connections", tmp, ctx, true); SetConfigOption("log_connections", "true", ctx, true);
if (DebugLvl >= 2) if (DebugLvl >= 2)
SetConfigOption("debug_print_query", tmp, ctx, true); SetConfigOption("debug_print_query", "true", ctx, true);
if (DebugLvl >= 3) if (DebugLvl >= 3)
SetConfigOption("debug_print_parse", tmp, ctx, true); SetConfigOption("debug_print_parse", "true", ctx, true);
if (DebugLvl >= 4) if (DebugLvl >= 4)
SetConfigOption("debug_print_plan", tmp, ctx, true); SetConfigOption("debug_print_plan", "true", ctx, true);
if (DebugLvl >= 5) if (DebugLvl >= 5)
SetConfigOption("debug_print_rewritten", tmp, ctx, true); SetConfigOption("debug_print_rewritten", "true", ctx, true);
break; break;
case 'E': case 'E':
@ -1491,7 +1491,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
(Show_parser_stats || Show_planner_stats || Show_executor_stats)) (Show_parser_stats || Show_planner_stats || Show_executor_stats))
{ {
fprintf(stderr, "Query statistics are disabled because parser, planner, or executor statistics are on.\n"); fprintf(stderr, "Query statistics are disabled because parser, planner, or executor statistics are on.\n");
Show_query_stats = false; SetConfigOption("show_query_stats", "false", ctx, true);
} }
if (!IsUnderPostmaster) if (!IsUnderPostmaster)
@ -1714,7 +1714,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if (!IsUnderPostmaster) if (!IsUnderPostmaster)
{ {
puts("\nPOSTGRES backend interactive interface "); puts("\nPOSTGRES backend interactive interface ");
puts("$Revision: 1.225 $ $Date: 2001/06/23 22:23:49 $\n"); puts("$Revision: 1.226 $ $Date: 2001/06/25 22:56:04 $\n");
} }
/* /*