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

Commit 2e81f3d

Browse files
committed
Back out SET ALL patch because it is breaking things.
1 parent 116d2bb commit 2e81f3d

File tree

3 files changed

+49
-49
lines changed

3 files changed

+49
-49
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
*
3030
* IDENTIFICATION
31-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.222 2001/06/18 23:42:32 momjian Exp $
31+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.223 2001/06/19 23:40:10 momjian Exp $
3232
*
3333
* NOTES
3434
*
@@ -426,14 +426,14 @@ PostmasterMain(int argc, char *argv[])
426426
#ifndef USE_ASSERT_CHECKING
427427
postmaster_error("Assert checking is not compiled in.");
428428
#else
429-
SetConfigOption("debug_assertions", optarg, PGC_POSTMASTER, true);
429+
assert_enabled = atoi(optarg);
430430
#endif
431431
break;
432432
case 'a':
433433
/* Can no longer set authentication method. */
434434
break;
435435
case 'B':
436-
SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, true);
436+
NBuffers = atoi(optarg);
437437
break;
438438
case 'b':
439439
/* Can no longer set the backend executable file to use. */
@@ -447,23 +447,23 @@ PostmasterMain(int argc, char *argv[])
447447
* Turn on debugging for the postmaster and the backend
448448
* servers descended from it.
449449
*/
450-
SetConfigOption("debug_level", optarg, PGC_POSTMASTER, true);
450+
DebugLvl = atoi(optarg);
451451
break;
452452
case 'F':
453-
SetConfigOption("enable_fsync", optarg, PGC_POSTMASTER, true);
453+
enableFsync = false;
454454
break;
455455
case 'h':
456-
SetConfigOption("virtual_host", optarg, PGC_POSTMASTER, true);
456+
VirtualHost = optarg;
457457
break;
458458
case 'i':
459-
SetConfigOption("tcpip_socket", optarg, PGC_POSTMASTER, true);
459+
NetServer = true;
460460
break;
461461
case 'k':
462-
SetConfigOption("unix_socket_directory", optarg, PGC_POSTMASTER, true);
462+
UnixSocketDir = optarg;
463463
break;
464464
#ifdef USE_SSL
465465
case 'l':
466-
SetConfigOption("ssl", optarg, PGC_POSTMASTER, true);
466+
EnableSSL = true;
467467
break;
468468
#endif
469469
case 'm':
@@ -483,7 +483,11 @@ PostmasterMain(int argc, char *argv[])
483483
* The max number of backends to start. Can't set to less
484484
* than 1 or more than compiled-in limit.
485485
*/
486-
SetConfigOption("max_connections", optarg, PGC_POSTMASTER, true);
486+
MaxBackends = atoi(optarg);
487+
if (MaxBackends < 1)
488+
MaxBackends = 1;
489+
if (MaxBackends > MAXBACKENDS)
490+
MaxBackends = MAXBACKENDS;
487491
break;
488492
case 'n':
489493
/* Don't reinit shared mem after abnormal exit */
@@ -500,7 +504,7 @@ PostmasterMain(int argc, char *argv[])
500504
strcpy(original_extraoptions, optarg);
501505
break;
502506
case 'p':
503-
SetConfigOption("port", optarg, PGC_POSTMASTER, true);
507+
PostPortNumber = atoi(optarg);
504508
break;
505509
case 'S':
506510

@@ -510,7 +514,7 @@ PostmasterMain(int argc, char *argv[])
510514
* it's most badly needed on SysV-derived systems like
511515
* SVR4 and HP-UX.
512516
*/
513-
SetConfigOption("silent_mode", optarg, PGC_POSTMASTER, true);
517+
SilentMode = true;
514518
break;
515519
case 's':
516520

src/backend/tcop/postgres.c

Lines changed: 31 additions & 35 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.221 2001/06/18 23:42:32 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.222 2001/06/19 23:40:10 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1108,8 +1108,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
11081108
const char *DBName = NULL;
11091109
bool secure = true;
11101110
int errs = 0;
1111-
GucContext ctx;
1112-
char *tmp;
11131111

11141112
int firstchar;
11151113
StringInfo parser_input;
@@ -1119,9 +1117,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
11191117

11201118
char *potential_DataDir = NULL;
11211119

1122-
/* all options are allowed if not under postmaster */
1123-
ctx = IsUnderPostmaster ? PGC_BACKEND : PGC_POSTMASTER;
1124-
11251120
/*
11261121
* Catch standard options before doing much else. This even works on
11271122
* systems without getopt_long.
@@ -1193,7 +1188,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
11931188
{
11941189
case 'A':
11951190
#ifdef USE_ASSERT_CHECKING
1196-
SetConfigOption("debug_assertions", optarg, ctx, true);
1191+
assert_enabled = atoi(optarg);
11971192
#else
11981193
fprintf(stderr, "Assert checking is not compiled in\n");
11991194
#endif
@@ -1205,7 +1200,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
12051200
* specify the size of buffer pool
12061201
*/
12071202
if (secure)
1208-
SetConfigOption("shared_buffers", optarg, ctx, true);
1203+
NBuffers = atoi(optarg);
12091204
break;
12101205

12111206
case 'C':
@@ -1222,18 +1217,17 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
12221217
break;
12231218

12241219
case 'd': /* debug level */
1225-
tmp = "true";
1226-
SetConfigOption("debug_level", optarg, ctx, true);
1220+
DebugLvl = atoi(optarg);
12271221
if (DebugLvl >= 1);
1228-
SetConfigOption("log_connections", tmp, ctx, true);
1222+
Log_connections = true;
12291223
if (DebugLvl >= 2)
1230-
SetConfigOption("debug_print_query", tmp, ctx, true);
1224+
Debug_print_query = true;
12311225
if (DebugLvl >= 3)
1232-
SetConfigOption("debug_print_parse", tmp, ctx, true);
1226+
Debug_print_parse = true;
12331227
if (DebugLvl >= 4)
1234-
SetConfigOption("debug_print_plan", tmp, ctx, true);
1228+
Debug_print_plan = true;
12351229
if (DebugLvl >= 5)
1236-
SetConfigOption("debug_print_rewritten", tmp, ctx, true);
1230+
Debug_print_rewritten = true;
12371231
break;
12381232

12391233
case 'E':
@@ -1258,40 +1252,37 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
12581252
* turn off fsync
12591253
*/
12601254
if (secure)
1261-
SetConfigOption("fsync", "true", ctx, true);
1255+
enableFsync = false;
12621256
break;
12631257

12641258
case 'f':
12651259

12661260
/*
12671261
* f - forbid generation of certain plans
12681262
*/
1269-
tmp = NULL;
12701263
switch (optarg[0])
12711264
{
12721265
case 's': /* seqscan */
1273-
tmp = "enable_seqscan";
1266+
enable_seqscan = false;
12741267
break;
12751268
case 'i': /* indexscan */
1276-
tmp = "enable_indexscan";
1269+
enable_indexscan = false;
12771270
break;
12781271
case 't': /* tidscan */
1279-
tmp = "enable_tidscan";
1272+
enable_tidscan = false;
12801273
break;
12811274
case 'n': /* nestloop */
1282-
tmp = "enable_nestloop";
1275+
enable_nestloop = false;
12831276
break;
12841277
case 'm': /* mergejoin */
1285-
tmp = "enable_mergejoin";
1278+
enable_mergejoin = false;
12861279
break;
12871280
case 'h': /* hashjoin */
1288-
tmp = "enable_hashjoin";
1281+
enable_hashjoin = false;
12891282
break;
12901283
default:
12911284
errs++;
12921285
}
1293-
if (tmp)
1294-
SetConfigOption(tmp, "false", ctx, true);
12951286
break;
12961287

12971288
case 'i':
@@ -1361,15 +1352,21 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
13611352
/*
13621353
* S - amount of sort memory to use in 1k bytes
13631354
*/
1364-
SetConfigOption("sort_mem", optarg, ctx, true);
1355+
{
1356+
int S;
1357+
1358+
S = atoi(optarg);
1359+
if (S >= 4 * BLCKSZ / 1024)
1360+
SortMem = S;
1361+
}
13651362
break;
13661363

13671364
case 's':
13681365

13691366
/*
13701367
* s - report usage statistics (timings) after each query
13711368
*/
1372-
SetConfigOption("show_query_stats", optarg, ctx, true);
1369+
Show_query_stats = 1;
13731370
break;
13741371

13751372
case 't':
@@ -1383,26 +1380,23 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
13831380
* caution: -s can not be used together with -t.
13841381
* ----------------
13851382
*/
1386-
tmp = NULL;
13871383
switch (optarg[0])
13881384
{
13891385
case 'p':
13901386
if (optarg[1] == 'a')
1391-
tmp = "show_parser_stats";
1387+
Show_parser_stats = 1;
13921388
else if (optarg[1] == 'l')
1393-
tmp = "show_planner_stats";
1389+
Show_planner_stats = 1;
13941390
else
13951391
errs++;
13961392
break;
13971393
case 'e':
1398-
tmp = "show_parser_stats";
1394+
Show_executor_stats = 1;
13991395
break;
14001396
default:
14011397
errs++;
14021398
break;
14031399
}
1404-
if (tmp)
1405-
SetConfigOption(tmp, "true", ctx, true);
14061400
break;
14071401

14081402
case 'v':
@@ -1466,7 +1460,9 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
14661460
elog(ERROR, "-c %s requires argument", optarg);
14671461
}
14681462

1469-
SetConfigOption(name, value, ctx, true);
1463+
/* all options are allowed if not under postmaster */
1464+
SetConfigOption(name, value,
1465+
(IsUnderPostmaster) ? PGC_BACKEND : PGC_POSTMASTER, true);
14701466
free(name);
14711467
if (value)
14721468
free(value);
@@ -1713,7 +1709,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
17131709
if (!IsUnderPostmaster)
17141710
{
17151711
puts("\nPOSTGRES backend interactive interface ");
1716-
puts("$Revision: 1.221 $ $Date: 2001/06/18 23:42:32 $\n");
1712+
puts("$Revision: 1.222 $ $Date: 2001/06/19 23:40:10 $\n");
17171713
}
17181714

17191715
/*

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Support for grand unified configuration scheme, including SET
55
* command, configuration file, and command line options.
66
*
7-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.40 2001/06/18 23:42:32 momjian Exp $
7+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.41 2001/06/19 23:40:10 momjian Exp $
88
*
99
* Copyright 2000 by PostgreSQL Global Development Group
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -276,7 +276,7 @@ static struct config_int
276276
DEF_PGPORT, 1, 65535, NULL, NULL},
277277

278278
{"sort_mem", PGC_USERSET, &SortMem,
279-
512, 4*BLCKSZ/1024, INT_MAX, NULL, NULL},
279+
512, 1, INT_MAX, NULL, NULL},
280280

281281
{"debug_level", PGC_USERSET, &DebugLvl,
282282
0, 0, 16, NULL, NULL},

0 commit comments

Comments
 (0)