Re: Bad UI design: pg_ctl and data_directory

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bad UI design: pg_ctl and data_directory
Date: 2011-06-09 17:02:14
Message-ID: 201106091702.p59H2EN28194@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> On Wed, Jun 1, 2011 at 7:07 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> >> Excerpts from Robert Haas's message of mi? jun 01 18:22:56 -0400 2011:
> >>> 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.
> >
> >> I had the same thought, and wondered if we could use the feature
> >> elsewhere.
> >
> > This was suggested quite some time ago, IIRC, but we never got round to it.
> >
> > The main problem in the current context is that it only fixes the issue
> > so long as you ignore the possibility that relevant values were
> > specified on the command line or via environment variables, rather than
> > coming directly from the config file. ?PGDATA is thus a particular
> > hazard here: all you need is to be running with a different PGDATA
> > setting in your environment than was used when "pg_ctl start" was
> > issued, and you're hosed.
>
> I guess I'm missing something here. If you change PGDATA, you're
> going to be working on a different cluster, but that's what you asked
> for. I guess there could be a problem if you used pg_ctl -D dir
> start, and postgres --tell-me-the-data-dir relied on PGDATA in telling
> you what the data directory should be, but that seems simple to work
> around: just have -D dir set $PGDATA before invoking postgres.

Is this just part of our existing TODOs?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-06-09 17:05:33 Re: Another pgindent run before beta2?
Previous Message Tom Lane 2011-06-09 16:57:46 Re: .gitignore for some of cygwin files