Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b1b377

Browse files
committed
Have -d5 -d0 not affect the extra variables set with -d5.
1 parent1fe4cbb commit0b1b377

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 21 additions & 18 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.296 2002/09/27 03:34:15 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.297 2002/09/27 03:59:00 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1136,6 +1136,7 @@ PostgresMain(int argc, char *argv[], const char *username)
11361136
constchar*DBName=NULL;
11371137
boolsecure;
11381138
interrs=0;
1139+
intdebug_flag=0;
11391140
GucContextctx;
11401141
GucSourcegucsource;
11411142
char*tmp;
@@ -1250,6 +1251,7 @@ PostgresMain(int argc, char *argv[], const char *username)
12501251

12511252
case'd':/* debug level */
12521253
{
1254+
debug_flag=atoi(optarg);
12531255
/* Set server debugging level. */
12541256
if (atoi(optarg)!=0)
12551257
{
@@ -1259,25 +1261,10 @@ PostgresMain(int argc, char *argv[], const char *username)
12591261
SetConfigOption("server_min_messages",debugstr,ctx,gucsource);
12601262
pfree(debugstr);
12611263

1262-
/*
1263-
* -d is not the same as setting
1264-
* client_min_messages because it enables other
1265-
* output options.
1266-
*/
1267-
if (atoi(optarg) >=1)
1268-
SetConfigOption("log_connections","true",ctx,gucsource);
1269-
if (atoi(optarg) >=2)
1270-
SetConfigOption("log_statement","true",ctx,gucsource);
1271-
if (atoi(optarg) >=3)
1272-
SetConfigOption("debug_print_parse","true",ctx,gucsource);
1273-
if (atoi(optarg) >=4)
1274-
SetConfigOption("debug_print_plan","true",ctx,gucsource);
1275-
if (atoi(optarg) >=5)
1276-
SetConfigOption("debug_print_rewritten","true",ctx,gucsource);
12771264
}
12781265
else
12791266
/*
1280-
* -d 0 allows user to prevent postmaster debug
1267+
* -d0 allows user to prevent postmaster debug
12811268
* from propagating to backend. It would be nice
12821269
* to set it to the postgresql.conf value here.
12831270
*/
@@ -1520,6 +1507,22 @@ PostgresMain(int argc, char *argv[], const char *username)
15201507
break;
15211508
}
15221509

1510+
/*
1511+
* -d is not the same as setting
1512+
* server_min_messages because it enables other
1513+
* output options.
1514+
*/
1515+
if (debug_flag >=1)
1516+
SetConfigOption("log_connections","true",ctx,gucsource);
1517+
if (debug_flag >=2)
1518+
SetConfigOption("log_statement","true",ctx,gucsource);
1519+
if (debug_flag >=3)
1520+
SetConfigOption("debug_print_parse","true",ctx,gucsource);
1521+
if (debug_flag >=4)
1522+
SetConfigOption("debug_print_plan","true",ctx,gucsource);
1523+
if (debug_flag >=5)
1524+
SetConfigOption("debug_print_rewritten","true",ctx,gucsource);
1525+
15231526
/*
15241527
* Post-processing for command line options.
15251528
*/
@@ -1698,7 +1701,7 @@ PostgresMain(int argc, char *argv[], const char *username)
16981701
if (!IsUnderPostmaster)
16991702
{
17001703
puts("\nPOSTGRES backend interactive interface ");
1701-
puts("$Revision: 1.296 $ $Date: 2002/09/27 03:34:15 $\n");
1704+
puts("$Revision: 1.297 $ $Date: 2002/09/27 03:59:00 $\n");
17021705
}
17031706

17041707
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp