mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Pass postmaster -d down to the postgres backend to trigger special -d
handling in the backend.
This commit is contained in:
parent
15b95cf872
commit
3c104bc4ed
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.288 2002/09/04 20:31:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.289 2002/09/26 05:17:00 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -230,6 +230,8 @@ bool ClientAuthInProgress = false; /* T during new-client
|
|||||||
|
|
||||||
static unsigned int random_seed = 0;
|
static unsigned int random_seed = 0;
|
||||||
|
|
||||||
|
static int debug_flag = 0;
|
||||||
|
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind,
|
extern int optind,
|
||||||
opterr;
|
opterr;
|
||||||
@ -452,6 +454,7 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
SetConfigOption("server_min_messages", debugstr,
|
SetConfigOption("server_min_messages", debugstr,
|
||||||
PGC_POSTMASTER, PGC_S_ARGV);
|
PGC_POSTMASTER, PGC_S_ARGV);
|
||||||
pfree(debugstr);
|
pfree(debugstr);
|
||||||
|
debug_flag = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'F':
|
case 'F':
|
||||||
@ -2028,6 +2031,7 @@ DoBackend(Port *port)
|
|||||||
char *remote_host;
|
char *remote_host;
|
||||||
char *av[ARGV_SIZE * 2];
|
char *av[ARGV_SIZE * 2];
|
||||||
int ac = 0;
|
int ac = 0;
|
||||||
|
char debugbuf[ARGV_SIZE];
|
||||||
char protobuf[ARGV_SIZE];
|
char protobuf[ARGV_SIZE];
|
||||||
char dbbuf[ARGV_SIZE];
|
char dbbuf[ARGV_SIZE];
|
||||||
char optbuf[ARGV_SIZE];
|
char optbuf[ARGV_SIZE];
|
||||||
@ -2208,6 +2212,15 @@ DoBackend(Port *port)
|
|||||||
|
|
||||||
av[ac++] = "postgres";
|
av[ac++] = "postgres";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pass the requested debugging level along to the backend.
|
||||||
|
*/
|
||||||
|
if (debug_flag > 0)
|
||||||
|
{
|
||||||
|
sprintf(debugbuf, "-d%d", debug_flag);
|
||||||
|
av[ac++] = debugbuf;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pass any backend switches specified with -o in the postmaster's own
|
* Pass any backend switches specified with -o in the postmaster's own
|
||||||
* command line. We assume these are secure. (It's OK to mangle
|
* command line. We assume these are secure. (It's OK to mangle
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.294 2002/09/25 20:31:40 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.295 2002/09/26 05:17:00 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -1281,8 +1281,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
* -d 0 allows user to prevent postmaster debug
|
* -d 0 allows user to prevent postmaster debug
|
||||||
* from propagating to backend.
|
* from propagating to backend.
|
||||||
*/
|
*/
|
||||||
SetConfigOption("server_min_messages", "notice",
|
ResetPGVariable("server_min_messages");
|
||||||
ctx, gucsource);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1698,7 +1697,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
puts("\nPOSTGRES backend interactive interface ");
|
||||||
puts("$Revision: 1.294 $ $Date: 2002/09/25 20:31:40 $\n");
|
puts("$Revision: 1.295 $ $Date: 2002/09/26 05:17:00 $\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user