Re: Small doc patch about pg_service.conf

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, David Fetter <david(at)fetter(dot)org>, Noah Misch <noah(at)leadboat(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small doc patch about pg_service.conf
Date: 2015-01-03 22:33:32
Message-ID: 30714.1420324412@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Sat, Jan 3, 2015 at 10:52 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 01/03/2015 04:41 PM, Magnus Hagander wrote:
>>> Yeah. But let's make sure we include "usually /etc" or something like
>>> that.

>> But it's not usually /etc. Certainly it's not in the PGDG RPM builds
>> unless they have changed recently.

> I thought it was, based on Davids post from earlier. I know Debian moves
> them to /etc/postgresql-common - but they move a lot of the things around.
> I didn't realize the RPMs did something similar. If that's the case then
> it's definitely wrong to say that. I guess I haven't been using the system
> wide one on RedHat.

The reason the RH packages use /etc is that there's a distro-wide default
that configure gets invoked with --sysconfdir=/etc unless the packager
takes steps to override that. The RH postgresql packages *did* take steps
to override that, up till about Fedora 16/RHEL7 --- before then the
arrangement was --sysconfdir=/etc/sysconfig/pgsql. So David's comment
isn't even correct for the majority of Red Hat installations today.
Between that and your points about PGDG and Debian, it's clear that "/etc"
is wrong far more often than it's right.

I'd suggest wording along the lines of

... or it can be a system-wide file, which is named
<filename>pg_service.conf</filename> and located in the directory
specified by the environment variable <envar>PGSYSCONFDIR</envar>.
If that variable is not set, the system-wide file is sought in the
directory displayed by <command>pg_config --sysconfig</command>
(by default, <filename><replaceable>installprefix</>/etc</filename>).

However, I don't know whether that advice also works for Windows;
can anyone check?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-01-03 23:46:46 Re: logical column ordering
Previous Message Magnus Hagander 2015-01-03 21:59:45 Re: Small doc patch about pg_service.conf