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

Поиск
Список
Период
Сортировка
От Ben Roberts
Тема Re: problem with maintenance script and missing pg_clog files with pg 7.2.1
Дата
Msg-id 20020925101859.GO11482@runtime-collective.com
обсуждение исходный текст
Ответ на Re: problem with maintenance script and missing pg_clog files with pg 7.2.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: problem with maintenance script and missing pg_clog files with pg 7.2.1  (Martijn van Oosterhout <kleptog@svana.org>)
Re: problem with maintenance script and missing pg_clog  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Ben Roberts
Дата:
Сообщение: Re: problem with maintenance script and missing pg_clog files with pg 7.2.1
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: problem with maintenance script and missing pg_clog files with pg 7.2.1