Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6C64BB5DC20 for ; Mon, 31 Oct 2011 12:47:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 23225-03 for ; Mon, 31 Oct 2011 15:47:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mail.postgresql.org (Postfix) with ESMTP id BDF46B5DC0F for ; Mon, 31 Oct 2011 12:47:27 -0300 (ADT) Received: by pzk4 with SMTP id 4so38398908pzk.3 for ; Mon, 31 Oct 2011 08:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=wzgvSciLeojcHd0w5ps+nETXxjm0i8fUf1Nj4J6P5rY=; b=D6ZzoZdLr4U7CO+7AXmMjGd16p7yr112PfVvArWgP0/FFkspJs+wKNtnYJxNpRUsSU 9xNiI9FMK8//HBA4Fm+b//kG87z6YrSZYRIr2M/il3tVAC6j6FrFTxWCxpGpCFPrIuMs hGUHr76MnPvsxxbWL2w5yYGiDEV6amaBIcDtU= Received: by 10.68.34.2 with SMTP id v2mr8591914pbi.112.1320076047103; Mon, 31 Oct 2011 08:47:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.242.13 with HTTP; Mon, 31 Oct 2011 08:46:55 -0700 (PDT) In-Reply-To: References: From: Thom Brown Date: Mon, 31 Oct 2011 17:46:55 +0200 X-Google-Sender-Auth: FcLF7aASeOBKx_5rJmRIxAs6jO0 Message-ID: Subject: Re: PGDATA confusion To: pgsql-docs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201110/75 X-Sequence-Number: 7075 On 15 October 2011 03:24, Thom Brown wrote: > Hi, > > I notice that in the man page and the page for pg_ctl in the > documentation (http://www.postgresql.org/docs/current/static/app-pg-ctl.h= tml) > it states that the -D parameter should point to the directory which > contains the database files: > > "Specifies the file system location of the database files. If this is > omitted, the environment variable PGDATA is used." > > This isn't necessarily true. =A0It will only need to know where the > postgresql.conf file is. =A0In Debian and Ubuntu, for example, the > "database files" reside in /var/lib/postgresql/x.x/main/, and the > configuration files in /etc/postgresql/x.x/main/, so a user might > assume they need to point it to the former as that's where the actual > database itself can be found, when in fact it needs to be the latter. > > This same inaccuracy affects the "postgres" command > (http://www.postgresql.org/docs/current/static/app-postgres.html) to a > lesser extent: > > "Specifies the file system location of the data directory or > configuration file(s)." > > Which is it? =A0This suggests it can be either, when only the latter > matters. =A0If it also happens to be the data directory, that's > unimportant. > > To add further confusion, the page describing PGDATA > (http://www.postgresql.org/docs/current/static/storage-file-layout.html) > refers to it like so: > > "All the data needed for a database cluster is stored within the > cluster's data directory, commonly referred to as PGDATA... > > *snip* > > The PGDATA directory contains several subdirectories and control > files... ...In addition to these required items, the cluster > configuration files postgresql.conf, pg_hba.conf, and pg_ident.conf > are traditionally stored in PGDATA (although in PostgreSQL 8.0 and > later, it is possible to keep them elsewhere)." > > Traditionally but not necessarily, and not by default in Debian and > Ubuntu. =A0In fact Gentoo (and therefore probably Sabayon too) has also > elected for this separation of data files and config files as of 9.0. > > 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. =A0It 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? =A0If 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? --=20 Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935 EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company