mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Implement WAL log location control using "-X" or PGXLOG.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.281 2002/07/13 01:02:14 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.282 2002/08/04 06:26:38 thomas Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -347,6 +347,7 @@ PostmasterMain(int argc, char *argv[])
|
||||
int status;
|
||||
char original_extraoptions[MAXPGPATH];
|
||||
char *potential_DataDir = NULL;
|
||||
char *potential_XLogDir = NULL;
|
||||
|
||||
*original_extraoptions = '\0';
|
||||
|
||||
@@ -405,10 +406,11 @@ PostmasterMain(int argc, char *argv[])
|
||||
InitializeGUCOptions();
|
||||
|
||||
potential_DataDir = getenv("PGDATA"); /* default value */
|
||||
potential_XLogDir = getenv("PGXLOG"); /* default value */
|
||||
|
||||
opterr = 1;
|
||||
|
||||
while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1)
|
||||
while ((opt = getopt(argc, argv, "A:a:B:b:c:D:X:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
@@ -431,6 +433,9 @@ PostmasterMain(int argc, char *argv[])
|
||||
case 'D':
|
||||
potential_DataDir = optarg;
|
||||
break;
|
||||
case 'X':
|
||||
potential_XLogDir = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
{
|
||||
/* Turn on debugging for the postmaster. */
|
||||
@@ -565,6 +570,7 @@ PostmasterMain(int argc, char *argv[])
|
||||
|
||||
checkDataDir(potential_DataDir); /* issues error messages */
|
||||
SetDataDir(potential_DataDir);
|
||||
SetXLogDir(potential_XLogDir);
|
||||
|
||||
ProcessConfigFile(PGC_POSTMASTER);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user