Re: Bug with pg_ctl -w/wait and config-only directories

From: Aidan Van Dyk <aidan(at)highrise(dot)ca>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "Mr(dot) Aaron W(dot) Swenson" <titanofold(at)gentoo(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug with pg_ctl -w/wait and config-only directories
Date: 2011-10-04 00:41:10
Message-ID: CAC_2qU_sAHYozj4GFfY0cyU37pFpEXyOyVPwp-6uLfTDfzFcfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 3, 2011 at 7:10 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

>> Agreed.  If you remove that, the logical problem goes away and it
>> becomes a simple problem of dumping the contents of postgresql.conf and
>> having pg_ctl (and pg_upgrade) use that.  Let me look at how much code
>> that would take.
>>
>
> Yeah, this pattern can be changed to have a config file that reads:
>
>   data_directory = '/path/to/data'
>   include '/path/to/common/config'
>
> and I presume (or hope) that would meet your need, and not upset the FHS
> purists.

I kinda like the way the debian (and ubuntu) packages do it...

They start pg_ctl/postgres like:
... -D /path/to/real-data/data-dir -c
config_file=/etc/postgresql/$INSTANCE/postgresql.conf

In /etc/postgresql/$INSTANCE/postgresql.conf, these are explictly set:
data_directory=/path/to/real-data/data-dir
hba_file=/etc/postgresql/$INSTANCE/pg_hba.conf
ident_file=/etc/postgresql/$INSTANCE/pg_ident.conf
external_pid_file=/var/run/postgresql/$INSTANCE.pid

It actually looks in /etc/postgresql/$INSTANCE/postgresql.conf to find
data_directory to use when invoking pg_ctl/postgres.

But, in my opinion, there is enough flexibility with postgresql's
config (and ability to pass un"recorded" options to postmaster at
startup too) that pg_upgrade can't guarantee it's going to figure out
every thing "automatically given a single $pgdata location to start
from". That's simply not realistic. Distros who do stranger things
than debian (and probably even Debian) are going to have to give their
users guidance on how to call pg_upgrade with their specific setup of
paths/configs/invocations. It's simply that simple.

I'ld be happy enough if pg_upgrade could easily upgrade given a
datadir that had a postgresql.conf in it, or possibly a
postgresql.conf that had data_directory set in it.

Anything else, and I say it's responsibility of whoever scripted the
startup to be able to provide all the necessary information to
pg_upgrade (be it by extra command line options, or crafting a special
pg_data with symlinks that is more "normal").

a.
--
Aidan Van Dyk                                             Create like a god,
aidan(at)highrise(dot)ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-10-04 01:50:17 Re: Bug with pg_ctl -w/wait and config-only directories
Previous Message Andrew Dunstan 2011-10-03 23:10:07 Re: Bug with pg_ctl -w/wait and config-only directories