From af704cdfb4e5327395aa6419c28ad79f906c68f0 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Sun, 4 Aug 2002 06:26:38 +0000 Subject: Implement WAL log location control using "-X" or PGXLOG. --- src/backend/tcop/postgres.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 976d366fe78..d117f844603 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -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"); } /* -- cgit v1.2.3