Re: problem with maintenance script and missing pg_clog files with pg 7.2.1

From: Ben Roberts <benroberts(at)runtime-collective(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with maintenance script and missing pg_clog files with pg 7.2.1
Date: 2002-09-25 10:18:59
Message-ID: 20020925101859.GO11482@runtime-collective.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ben Roberts benroberts(at)runtime-collective(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-09-25 11:15:25 Re: problem with maintenance script and missing pg_clog files with pg 7.2.1
Previous Message Ben Roberts 2002-09-25 09:56:14 Re: problem with maintenance script and missing pg_clog files with pg 7.2.1