Re: pg_service.conf

From: "Mark Woodward" <pgsql(at)mohawksoft(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_service.conf
Date: 2006-02-19 15:41:04
Message-ID: 18819.24.91.171.78.1140363664.squirrel@mail.mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> On Sun, Feb 19, 2006 at 10:00:01AM -0500, Mark Woodward wrote:
>> > It turns out what you like actually exists, lookup the "service"
>> > parameter in the connectdb string. It will read the values for the
>> > server, port, etc from a pg_service.conf file.
>> >
>> > There is an example in the tree but it looks something like the
>> following:
>> >
>> > [servicename]
>> > dbname=blah
>> > user=blah
>> > pass=blah
>> >
>> > So all you need to specify is "service=servicename" and it will grab
>> > the parameters. This allows you to change the connection without
>> > changeing the code.
>> >
>>
>> This is a great feature!!
>>
>> It doesn't seem to be documented in the administrators guide. Its
>> mentioned in the libpq section, and only a reference to
>> pg_service.conf.sample
>
> Indeed, I only just found out about it yesterday. It's a very little
> known feature that needs some advertisement. Right now we need to work
> up some documentation patches so people come across it easier.
>
> Where do you think it should be mentioned?

As it was mentioned in another reply, this is not "everything" I wanted,
but it is a big step closer that makes the rest managable.

As for the "central" administration issue, yes, it is not a central
administration solution, but files like these fall into the category of
one to many "push" strategies, something like "bulkcopy -f targets
pg_service.conf /usr/local/etc"

I think it should be clearly in the administration section of the manual.
A DBA is not going to look at the libpq section, similarly, PHP or Java
developers won't either. I use libpq all the time, the last time I looked
at pq_connect was years ago.

Like I said, this is a REALLY USEFULL feature that should be presented as
the "best method" for specifying databases, in the administration manual.
It should also be mentioned in the PHP API as well.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Dunstan 2006-02-19 15:41:22 Re: Updated email signature
Previous Message Martijn van Oosterhout 2006-02-19 15:10:29 Re: pg_service.conf

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Woodward 2006-02-19 15:52:18 Re: pg_service.conf
Previous Message Martijn van Oosterhout 2006-02-19 15:10:29 Re: pg_service.conf