Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1URHny-00019A-Jf for pgsql-docs@arkaria.postgresql.org; Sun, 14 Apr 2013 07:56:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1URHnx-0003Uc-6I for pgsql-docs@arkaria.postgresql.org; Sun, 14 Apr 2013 07:56:53 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1URHnv-0003UU-8r for pgsql-docs@postgresql.org; Sun, 14 Apr 2013 07:56:51 +0000 Received: from mail-ve0-f175.google.com ([209.85.128.175]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1URHnn-0000al-Um for pgsql-docs@postgresql.org; Sun, 14 Apr 2013 07:56:50 +0000 Received: by mail-ve0-f175.google.com with SMTP id jy13so418317veb.20 for ; Sun, 14 Apr 2013 00:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=fGlVnxK8MPPgoMw4qJNe8zPAS+/2U4BmOlYBcncz9Y8=; b=0qVIdgRKyjCRb6sjmduHnEvNygMKQ8FLzwlZ7heHDbdTe0WM9CoqyVu+1G/XhYsJiW FoorWjyciXBB0r8V9Qw9sUA2tthUqXDvUCaBALgat7IgzPi5EhiCY69TF5tqpcZUt+s3 Yp5o71ZOjH0wPoZm0Ey7SBt52WxVN8emSZ8RlAdMTPixRr9DdJ2O4toJTlMfTPI8UBVK M23go7+ff2/HAfDvnXAYVCQUYSum/U+1Mfd8vD9jdtOWud0dKUWcZMw2JwYSB5VQ1Zsc eC0q98dZFtL4ZWwxHZz0jqX4AKLi+eenWncXOHnHM8wqzQBj6J6fnc2/bXaL8w1tURVr eiaQ== X-Received: by 10.52.17.174 with SMTP id p14mr10878521vdd.125.1365926202827; Sun, 14 Apr 2013 00:56:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.65.33 with HTTP; Sun, 14 Apr 2013 00:56:12 -0700 (PDT) In-Reply-To: References: <201111041632.pA4GWDH15361@momjian.us> <20120816030021.GI8353@momjian.us> From: Thom Brown Date: Sun, 14 Apr 2013 08:56:12 +0100 X-Google-Sender-Auth: YuHR5Zi-1o-8oT5XDdtvUIBpGYo Message-ID: Subject: Re: PGDATA confusion To: Bruce Momjian Cc: pgsql-docs Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On 16 August 2012 08:30, Thom Brown wrote: > On 16 August 2012 04:00, Bruce Momjian 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 (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs