mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Implement WAL log location control using "-X" or PGXLOG.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.135 2002/08/02 22:36:05 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.136 2002/08/04 06:26:38 thomas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -223,6 +223,7 @@ BootstrapMain(int argc, char *argv[])
|
||||
int flag;
|
||||
int xlogop = BS_XLOG_NOP;
|
||||
char *potential_DataDir = NULL;
|
||||
char *potential_XLogDir = NULL;
|
||||
|
||||
/*
|
||||
* initialize globals
|
||||
@ -250,17 +251,22 @@ BootstrapMain(int argc, char *argv[])
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
InitializeGUCOptions();
|
||||
potential_DataDir = getenv("PGDATA"); /* Null if no PGDATA
|
||||
* variable */
|
||||
/* Null if no PGDATA variable */
|
||||
potential_DataDir = getenv("PGDATA");
|
||||
/* Null if no PGXLOG variable */
|
||||
potential_XLogDir = getenv("PGXLOG");
|
||||
}
|
||||
|
||||
while ((flag = getopt(argc, argv, "B:d:D:Fo:px:")) != -1)
|
||||
while ((flag = getopt(argc, argv, "B:d:D:X:Fo:px:")) != -1)
|
||||
{
|
||||
switch (flag)
|
||||
{
|
||||
case 'D':
|
||||
potential_DataDir = optarg;
|
||||
break;
|
||||
case 'X':
|
||||
potential_XLogDir = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
{
|
||||
/* Turn on debugging for the bootstrap process. */
|
||||
@ -315,6 +321,7 @@ BootstrapMain(int argc, char *argv[])
|
||||
proc_exit(1);
|
||||
}
|
||||
SetDataDir(potential_DataDir);
|
||||
SetXLogDir(potential_XLogDir);
|
||||
}
|
||||
|
||||
/* Validate we have been given a reasonable-looking DataDir */
|
||||
|
Reference in New Issue
Block a user