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

Commit 2e67a67

Browse files
committed
Fix a couple remaining places where GUC variables were assigned to
directly, rather than through SetConfigOption().
1 parent 4d58a7c commit 2e67a67

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.227 2001/06/23 22:23:49 momjian Exp $
40+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.228 2001/06/25 22:56:05 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -371,7 +371,7 @@ PostmasterMain(int argc, char *argv[])
371371

372372
/* PGPORT environment variable, if set, overrides GUC setting */
373373
if (getenv("PGPORT"))
374-
PostPortNumber = atoi(getenv("PGPORT"));
374+
SetConfigOption("port", getenv("PGPORT"), PGC_POSTMASTER, true);
375375

376376
potential_DataDir = getenv("PGDATA"); /* default value */
377377

@@ -447,7 +447,6 @@ PostmasterMain(int argc, char *argv[])
447447
/* already done above */
448448
break;
449449
case 'd':
450-
451450
/*
452451
* Turn on debugging for the postmaster and the backend
453452
* servers descended from it.
@@ -561,7 +560,6 @@ PostmasterMain(int argc, char *argv[])
561560
*/
562561
if (NBuffers < 2 * MaxBackends || NBuffers < 16)
563562
{
564-
565563
/*
566564
* Do not accept -B so small that backends are likely to starve
567565
* for lack of buffers. The specific choices here are somewhat

src/backend/tcop/postgres.c

Lines changed: 13 additions & 13 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.225 2001/06/23 22:23:49 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.226 2001/06/25 22:56:04 tgl Exp $
1212
*
1313
* NOTES
1414
* 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
11081108
int flag;
11091109

11101110
const char *DBName = NULL;
1111-
bool secure = true;
1111+
bool secure;
11121112
int errs = 0;
11131113
GucContext ctx;
11141114
char *tmp;
@@ -1120,9 +1120,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
11201120
unsigned short remote_port;
11211121

11221122
char *potential_DataDir = NULL;
1123-
1124-
/* all options are allowed until '-p' */
1125-
ctx = PGC_POSTMASTER;
11261123

11271124
/*
11281125
* Catch standard options before doing much else. This even works on
@@ -1190,6 +1187,10 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
11901187
* ----------------
11911188
*/
11921189

1190+
/* all options are allowed until '-p' */
1191+
secure = true;
1192+
ctx = PGC_POSTMASTER;
1193+
11931194
optind = 1; /* reset after postmaster's usage */
11941195

11951196
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
12251226
break;
12261227

12271228
case 'd': /* debug level */
1228-
tmp = "true";
12291229
SetConfigOption("debug_level", optarg, ctx, true);
12301230
if (DebugLvl >= 1)
1231-
SetConfigOption("log_connections", tmp, ctx, true);
1231+
SetConfigOption("log_connections", "true", ctx, true);
12321232
if (DebugLvl >= 2)
1233-
SetConfigOption("debug_print_query", tmp, ctx, true);
1233+
SetConfigOption("debug_print_query", "true", ctx, true);
12341234
if (DebugLvl >= 3)
1235-
SetConfigOption("debug_print_parse", tmp, ctx, true);
1235+
SetConfigOption("debug_print_parse", "true", ctx, true);
12361236
if (DebugLvl >= 4)
1237-
SetConfigOption("debug_print_plan", tmp, ctx, true);
1237+
SetConfigOption("debug_print_plan", "true", ctx, true);
12381238
if (DebugLvl >= 5)
1239-
SetConfigOption("debug_print_rewritten", tmp, ctx, true);
1239+
SetConfigOption("debug_print_rewritten", "true", ctx, true);
12401240
break;
12411241

12421242
case 'E':
@@ -1491,7 +1491,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
14911491
(Show_parser_stats || Show_planner_stats || Show_executor_stats))
14921492
{
14931493
fprintf(stderr, "Query statistics are disabled because parser, planner, or executor statistics are on.\n");
1494-
Show_query_stats = false;
1494+
SetConfigOption("show_query_stats", "false", ctx, true);
14951495
}
14961496

14971497
if (!IsUnderPostmaster)
@@ -1714,7 +1714,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
17141714
if (!IsUnderPostmaster)
17151715
{
17161716
puts("\nPOSTGRES backend interactive interface ");
1717-
puts("$Revision: 1.225 $ $Date: 2001/06/23 22:23:49 $\n");
1717+
puts("$Revision: 1.226 $ $Date: 2001/06/25 22:56:04 $\n");
17181718
}
17191719

17201720
/*

0 commit comments

Comments
 (0)