aboutsummaryrefslogtreecommitdiff
path: root/src/backend/bootstrap/bootstrap.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/bootstrap/bootstrap.c
parent7504f0bae853b0b9fec03c8e361c8b1a4b1c3209 (diff)
downloadpostgresql-eb5949d190e80360386113fde0f05854f0c9824d.tar.gz
postgresql-eb5949d190e80360386113fde0f05854f0c9824d.zip
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/bootstrap/bootstrap.c')
-rw-r--r--src/backend/bootstrap/bootstrap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index b38f9f92650..e8261c82311 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.204 2005/05/06 17:24:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.205 2005/07/04 04:51:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -365,15 +365,17 @@ BootstrapMain(int argc, char *argv[])
Assert(DataDir);
ValidatePgVersion(DataDir);
+ /* Change into DataDir (if under postmaster, should be done already) */
+ if (!IsUnderPostmaster)
+ ChangeToDataDir();
+
/* If standalone, create lockfile for data directory */
if (!IsUnderPostmaster)
- CreateDataDirLockFile(DataDir, false);
+ CreateDataDirLockFile(false);
SetProcessingMode(BootstrapProcessing);
IgnoreSystemIndexes(true);
- XLOGPathInit();
-
BaseInit();
/* needed to get LWLocks */