Re: Bad UI design: pg_ctl and data_directory - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Bad UI design: pg_ctl and data_directory
Date
Msg-id BANLkTi=AcsUg5-v7+N1KQZzhAMdR6foSwA@mail.gmail.com
Whole thread Raw
In response to Re: Bad UI design: pg_ctl and data_directory  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bad UI design: pg_ctl and data_directory
List pgsql-hackers
On Wed, Jun 1, 2011 at 5:10 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Josh Berkus <josh@agliodbs.com> writes:
>> pg_ctl -D means different things depending on whether you are calling
>> "start" or "stop".  For "start", pg_ctl wants the directory
>> postgresql.conf is in, and for "stop" it wants the directory
>> postmaster.pid is in.  This means that if your .conf files are not in
>> the same directory as data_directory, you have to write special-case
>> code for start and stop.
>
> Well, the entire business of allowing the config files to be outside the
> data directory is bad design/poor UI.  It's not pg_ctl that's the main
> problem here.
>
>> Given that having the .conf files in /etc is the default configuration
>> for both Red Hat and Debian, this seems like really poor UI design on
>> our part.
>
> I can't speak for Debian, but the above statement is 100% false for Red
> Hat.  In any case, no RH system has ever expected users to issue pg_ctl
> start/stop directly, and I think the same is true for Debian, so the
> bizarre design wouldn't matter to us even if the case did apply.
>
>> It actually seems relatively easy to fix this without breaking
>> backwards-compatibility.
>
> No, it isn't.  You're making way too many assumptions about where things
> really were and what arguments were given to pg_ctl start.  We went
> around on this before, which is why it's not "fixed" already.

ISTM that it would be useful to run postgres in a mode where it
doesn't actually try to start up the database, but parses
postgresql.conf and then exits, perhaps printing out the value of a
certain GUC as it does so.  In this case, data_directory.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: SSI predicate locking on heap -- tuple or row?
Next
From: Josh Berkus
Date:
Subject: Re: Bad UI design: pg_ctl and data_directory