-D switch to postmaster should override any PGDATA environment variable

that might be hanging about.  Now it does ... amazing nobody noticed
this before ...
This commit is contained in:
Tom Lane 2000-04-27 02:59:17 +00:00
parent 1b4f150541
commit 85a5303877
1 changed files with 5 additions and 11 deletions

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.139 2000/04/12 17:15:31 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.140 2000/04/27 02:59:17 tgl Exp $
*
* NOTES
*
@ -1725,11 +1725,8 @@ BackendStartup(Port *port)
putenv(envEntry[1]);
sprintf(envEntry[2], "PG_USER=%s", port->user);
putenv(envEntry[2]);
if (!getenv("PGDATA"))
{
sprintf(envEntry[3], "PGDATA=%s", DataDir);
putenv(envEntry[3]);
}
sprintf(envEntry[3], "PGDATA=%s", DataDir);
putenv(envEntry[3]);
sprintf(envEntry[4], "IPC_KEY=%d", ipc_key);
putenv(envEntry[4]);
@ -2175,11 +2172,8 @@ SSDataBase(bool startup)
putenv(ssEntry[0]);
sprintf(ssEntry[1], "POSTID=%d", NextBackendTag);
putenv(ssEntry[1]);
if (!getenv("PGDATA"))
{
sprintf(ssEntry[2], "PGDATA=%s", DataDir);
putenv(ssEntry[2]);
}
sprintf(ssEntry[2], "PGDATA=%s", DataDir);
putenv(ssEntry[2]);
sprintf(ssEntry[3], "IPC_KEY=%d", ipc_key);
putenv(ssEntry[3]);