Ben Roberts benroberts@runtime-collective.com said:
Tom, Martijn,
Oh dear, I feel this problem is related to us having not correctly
implemented the move to a new data directory.
I think the problem here is in postmaster.conf:
ns1:/etc/postgresql# cat postmaster.conf
# /etc/postgresql/postmaster.conf
#
# Copyright (c) Oliver Elphick 1997, 2001
# Part of the Debian package, postgresql. The Debian packaging is
# licensed under GPL v.2
<snip>
POSTGRES_HOME=`getent passwd postgres | awk -F: '{print $6}' | head -1`
if [ -z "$POSTGRES_HOME" ]
then
POSTGRES_HOME=/var/lib/postgres
fi
# Where to find the PostgreSQL database files, including those that
# define PostgresSQL users and permissions.
POSTGRES_DATA=/2/var/lib/postgres/data
<snip>
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?
thanks,
Ben