On Wed, 2002-09-25 at 11:18, Ben Roberts wrote:
> As you can see postmaster looks for the value of POSTGRES_HOME directory in
> /etc/passwd and if not found it defaults to the value of
> /var/lib/postgres. Unfortunately the relevant entry in /etc/passwd is:
>
> postgres:x:31:32:postgres:/var/lib/postgres:/bin/sh
>
> ^^^^^^^^^^^^^^^^^
> Instead of /2/var/lib/postgres.
>
> ho hum....we seem to have forgotten to change the postgres home directory
> when we made the move to the new disk. Possibly postgres is using the value
> of POSTGRES_HOME for some things and POSTGRES_DATA for others, causing the
> problems we are seeing?
>
> It's not 100% certain that this is the cause of the problem, but it looks
> very much like the smoking gun to me.
>
> Or is just 'OK' to have separate directories for POSTGRES_HOME and
> POSTGRES_DATA?
Yes.
As delivered, the package (postgresql-client, on which postgresql
depends) installs /etc/postgresql/postgresql.env and sources that in the
startup script for postgres (one of ~postgres/.profile,
~postgres/.bash_profile, ~postgres/.login). postgresql.env is used to
set up the environment for anyone using psql as well as for postgres.
It says:
[ -r /etc/postgresql/postmaster.conf ] &&
. /etc/postgresql/postmaster.conf
PGDATA=${POSTGRES_DATA:-/var/lib/postgres/data}
...
POSTGRES_HOME is in fact only used by the install scripts and as the
directory to cd to before running pg_ctl to start the postmaster. So
unless you have something in ~postgres/ that is giving PGDATA a
different value, I can't see any problem here. Even if that were the
case, the postmaster would be started with one value or the other; I
don't see how it could use both at once.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Who shall separate us from the love of Christ? shall
tribulation, or distress, or persecution, or famine,
or nakedness, or peril, or sword?...But in all these
things we overwhelmingly conquer through Him who loved
us." Romans 8:35,37