mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Implement WAL log location control using "-X" or PGXLOG.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.277 2002/08/04 04:31:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.278 2002/08/04 06:26:33 thomas Exp $
|
||||
*
|
||||
* NOTES
|
||||
* this is the "main" module of the postgres backend and
|
||||
@ -1146,6 +1146,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
StringInfo parser_input;
|
||||
|
||||
char *potential_DataDir = NULL;
|
||||
char *potential_XLogDir = NULL;
|
||||
|
||||
/*
|
||||
* Catch standard options before doing much else. This even works on
|
||||
@ -1190,6 +1191,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
{
|
||||
InitializeGUCOptions();
|
||||
potential_DataDir = getenv("PGDATA");
|
||||
potential_XLogDir = getenv("PGXLOG");
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@ -1214,7 +1216,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
ctx = PGC_POSTMASTER;
|
||||
gucsource = PGC_S_ARGV; /* initial switches came from command line */
|
||||
|
||||
while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiNOPo:p:S:st:v:W:x:-:")) != -1)
|
||||
while ((flag = getopt(argc, argv, "A:B:c:CD:X:d:Eef:FiNOPo:p:S:st:v:W:x:-:")) != -1)
|
||||
switch (flag)
|
||||
{
|
||||
case 'A':
|
||||
@ -1246,6 +1248,11 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
potential_DataDir = optarg;
|
||||
break;
|
||||
|
||||
case 'X': /* PGXLOG directory */
|
||||
if (secure)
|
||||
potential_XLogDir = optarg;
|
||||
break;
|
||||
|
||||
case 'd': /* debug level */
|
||||
{
|
||||
/* Set server debugging level. */
|
||||
@ -1537,8 +1544,10 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
proc_exit(1);
|
||||
}
|
||||
SetDataDir(potential_DataDir);
|
||||
SetXLogDir(potential_XLogDir);
|
||||
}
|
||||
Assert(DataDir);
|
||||
Assert(strlen(XLogDir) > 0);
|
||||
|
||||
/*
|
||||
* Set up signal handlers and masks.
|
||||
@ -1693,7 +1702,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
puts("\nPOSTGRES backend interactive interface ");
|
||||
puts("$Revision: 1.277 $ $Date: 2002/08/04 04:31:44 $\n");
|
||||
puts("$Revision: 1.278 $ $Date: 2002/08/04 06:26:33 $\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user