Re: per-user pg_service.conf

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: per-user pg_service.conf
Date: 2010-01-13 21:49:59
Message-ID: 1263419399.30626.20.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I was surprised/annoyed to find out that there is no way to have
per-user pg_service.conf, something like ~/.pg_service.conf (well,
except by export PGSYSCONFDIR). That would be easy to add. Comments?


From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: per-user pg_service.conf
Date: 2010-01-13 22:40:55
Message-ID: m2tyupaars.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> I was surprised/annoyed to find out that there is no way to have
> per-user pg_service.conf, something like ~/.pg_service.conf (well,
> except by export PGSYSCONFDIR). That would be easy to add. Comments?

+1.

I'll use it the day it exists.
--
dim


From: Joshua Tolley <eggyknap(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: per-user pg_service.conf
Date: 2010-01-13 22:53:00
Message-ID: 4b4e4ed5.9413f30a.3425.00f7@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jan 13, 2010 at 11:49:59PM +0200, Peter Eisentraut wrote:
> I was surprised/annoyed to find out that there is no way to have
> per-user pg_service.conf, something like ~/.pg_service.conf (well,
> except by export PGSYSCONFDIR). That would be easy to add. Comments?

+1 from me. I was similarly surprised to learn the same thing recently, but
admit I didn't take the time see how easily it could be changed.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: per-user pg_service.conf
Date: 2010-01-15 05:57:45
Message-ID: 1263535065.25675.1.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On ons, 2010-01-13 at 23:49 +0200, Peter Eisentraut wrote:
> I was surprised/annoyed to find out that there is no way to have
> per-user pg_service.conf, something like ~/.pg_service.conf (well,
> except by export PGSYSCONFDIR). That would be easy to add. Comments?

Here's a patch. Perhaps those who had said they would like that can
validate the behavior.

Attachment Content-Type Size
user-pgservice.conf text/x-patch 12.4 KB

From: Christoph Berg <cb(at)df7cb(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: per-user pg_service.conf
Date: 2010-01-15 12:37:08
Message-ID: 20100115123707.GC8810@df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> > I was surprised/annoyed to find out that there is no way to have
> > per-user pg_service.conf, something like ~/.pg_service.conf (well,
> > except by export PGSYSCONFDIR). That would be easy to add.
> > Comments?
>
> Here's a patch. Perhaps those who had said they would like that can
> validate the behavior.

Hi,

I just tried the ~/.pg_service.conf patch and it does everything I'd
expect from it. It even improves the documentation to include a
services file example for which I had been looking several times
earlier.

There's not much I have to add, maybe the documentation could add a
pointer to what keywords are recognized:

| The file uses an "INI file" format where the section name is the
| service name and the parameters are connection parameters.

... (see Section 30.1 for a list).

Independently for what this patch changes, error reporting could be
more detailed, currently "syntax error in service file \"%s\", line
%d" is reported for "no = in line" and "keyword X is unknown". The
latter case deserves a different message, maybe like "keyword \"%s\"
is invalid in service file \"%s\", line %d".

Even without the proposed changed, I'd very much appreciate the patch
getting included.

Christoph
--
cb(at)df7cb(dot)de | http://www.df7cb.de/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Christoph Berg <cb(at)df7cb(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: per-user pg_service.conf
Date: 2010-01-20 21:17:42
Message-ID: 1264022262.11352.1.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

committed

On fre, 2010-01-15 at 13:37 +0100, Christoph Berg wrote:
> There's not much I have to add, maybe the documentation could add a
> pointer to what keywords are recognized:
>
> | The file uses an "INI file" format where the section name is the
> | service name and the parameters are connection parameters.
>
> ... (see Section 30.1 for a list).

I added that.

>
> Independently for what this patch changes, error reporting could be
> more detailed, currently "syntax error in service file \"%s\", line
> %d" is reported for "no = in line" and "keyword X is unknown". The
> latter case deserves a different message, maybe like "keyword \"%s\"
> is invalid in service file \"%s\", line %d".

That was a bit outside of the mandate of the patch, but if someone wants
to send in something for that, I'm sure it would be considered.