public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thom Brown <[email protected]>
To: Bruce Momjian <[email protected]>
Cc: pgsql-docs <[email protected]>
Subject: Re: PGDATA confusion
Date: Sun, 14 Apr 2013 08:56:12 +0100
Message-ID: <CAA-aLv6Ut2r=m79OPykMuP4-=9BEfOadSAvwaphQgubivOkymQ@mail.gmail.com> (raw)
In-Reply-To: <CAA-aLv7t0vUH1NZK9k94eJfn-RnA-P844aWoxkRSQL4H=ExYaw@mail.gmail.com>
References: <CAA-aLv6KYbPa3FgH6_shVXrxQto86+QDJHQgj1isbeQngiBBGw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAA-aLv7t0vUH1NZK9k94eJfn-RnA-P844aWoxkRSQL4H=ExYaw@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>

On 16 August 2012 08:30, Thom Brown <[email protected]> wrote:
> On 16 August 2012 04:00, Bruce Momjian <[email protected]> wrote:
>> On Fri, Nov  4, 2011 at 12:32:13PM -0400, Bruce Momjian wrote:
>>> Thom Brown wrote:
>>> > > So if one set PGDATA to somewhere which had no database files at all,
>>> > > but just postgresql.conf, it could still work (assuming it, in turn,
>>> > > set data_directory correctly), but not vice versa. ?It would make more
>>> > > sense to call it PGCONFIG, although I'm not proposing that, especially
>>> > > since PGDATA makes sense when it comes to initdb.
>>> > >
>>> > > There are probably plenty of other places in the docs which also don't
>>> > > adequately describe PGDATA or -D.
>>> > >
>>> > > Any disagreements? ?If not, should I write a patch (since someone will
>>> > > probably accuse me of volunteering anyway) or would someone like to
>>> > > commit some adjustments?
>>> >
>>> > No opinions on this?
>>>
>>> Yes.  I had kept it to deal with later.  Please work on a doc patch to
>>> try to clean this up.  pg_upgrade just went through this confusion and I
>>> also was unhappy at how vague things are in this area.
>>>
>>> Things got very confusing with pg_upgrade when PGDATA pointed to the
>>> configuration directory and the data_directory GUC pointed to the data
>>> directory.
>>
>> I have applied the attached doc patch for PG 9.3 to clarify PGDATA.

I've found another unfortunate inconsistency.

PGDATA is not necessarily the same location in these 2 commands:

pg_ctl start -D DATADIR
pg_ctl stop -D DATADIR

The first one requires that the postgresql.conf file be located in the
specified directory.  The second one needs to find the pid file.  On
Debian/Ubuntu/Linux Mint/Gentoo (and probably most other Linux
distros), it would mean 2 different locations for each:

pg_ctl start -D /etc/postgresql/9.2/main/
pg_ctl stop -D /var/lib/postgresql/9.2/main/

pg_ctl --help confusingly tells us that DATADIR is the "location of
the database storage area".  But this clearly isn't true when starting
a cluster.

--
Thom


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: PGDATA confusion
  In-Reply-To: <CAA-aLv6Ut2r=m79OPykMuP4-=9BEfOadSAvwaphQgubivOkymQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox