summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgarch.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-07-04 04:51:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-07-04 04:51:52 +0000
commiteb5949d190e80360386113fde0f05854f0c9824d (patch)
treef5683b4ff77c0b311ae975817b88c5ccc65ce5a9 /src/backend/postmaster/pgarch.c
parent7504f0bae853b0b9fec03c8e361c8b1a4b1c3209 (diff)
Arrange for the postmaster (and standalone backends, initdb, etc) to
chdir into PGDATA and subsequently use relative paths instead of absolute paths to access all files under PGDATA. This seems to give a small performance improvement, and it should make the system more robust against naive DBAs doing things like moving a database directory that has a live postmaster in it. Per recent discussion.
Diffstat (limited to 'src/backend/postmaster/pgarch.c')
-rw-r--r--src/backend/postmaster/pgarch.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c
index e5eecb2dbc5..2f52053a2c3 100644
--- a/src/backend/postmaster/pgarch.c
+++ b/src/backend/postmaster/pgarch.c
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.16 2005/06/19 21:34:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.17 2005/07/04 04:51:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -248,9 +248,6 @@ PgArchiverMain(int argc, char *argv[])
init_ps_display("archiver process", "", "");
set_ps_display("");
- /* Init XLOG file paths --- needed in EXEC_BACKEND case */
- XLOGPathInit();
-
pgarch_MainLoop();
exit(0);
@@ -400,7 +397,7 @@ pgarch_archiveXlog(char *xlog)
const char *sp;
int rc;
- snprintf(pathname, MAXPGPATH, "%s/%s", XLogDir, xlog);
+ snprintf(pathname, MAXPGPATH, XLOGDIR "/%s", xlog);
/*
* construct the command to be executed
@@ -502,7 +499,7 @@ pgarch_readyXlog(char *xlog)
struct dirent *rlde;
bool found = false;
- snprintf(XLogArchiveStatusDir, MAXPGPATH, "%s/archive_status", XLogDir);
+ snprintf(XLogArchiveStatusDir, MAXPGPATH, XLOGDIR "/archive_status");
rldir = AllocateDir(XLogArchiveStatusDir);
if (rldir == NULL)
ereport(ERROR,