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/access/transam/slru.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/access/transam/slru.c') diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 24f9a94779..c7c1247020 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -48,7 +48,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.25 2005/06/19 21:34:01 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.26 2005/07/04 04:51:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -190,7 +190,7 @@ SimpleLruInit(SlruCtl ctl, const char *name, */ ctl->shared = shared; ctl->do_fsync = true; /* default behavior */ - snprintf(ctl->Dir, MAXPGPATH, "%s/%s", DataDir, subdir); + StrNCpy(ctl->Dir, subdir, sizeof(ctl->Dir)); } /* -- cgit v1.2.1