From eb5949d190e80360386113fde0f05854f0c9824d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 4 Jul 2005 04:51:52 +0000 Subject: 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. --- src/backend/tcop/postgres.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 534e4796611..6973e9d3b3c 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.451 2005/06/29 22:51:55 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.452 2005/07/04 04:51:49 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -2809,8 +2809,6 @@ PostgresMain(int argc, char *argv[], const char *username) errhint("Try \"%s --help\" for more information.", argv[0]))); } - XLOGPathInit(); - BaseInit(); } else @@ -2841,12 +2839,14 @@ PostgresMain(int argc, char *argv[], const char *username) Assert(DataDir); ValidatePgVersion(DataDir); + /* Change into DataDir (if under postmaster, was done already) */ + ChangeToDataDir(); + /* * Create lockfile for data directory. */ - CreateDataDirLockFile(DataDir, false); + CreateDataDirLockFile(false); - XLOGPathInit(); BaseInit(); /* -- cgit v1.2.3