Re: pg_service.conf

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Mark Woodward <pgsql(at)mohawksoft(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_service.conf
Date: 2006-02-25 02:28:30
Message-ID: 200602250228.k1P2SUF06093@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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
>
> IMHO we should push for this to be the mainstream connection
> methodology!!! The variables: host, port, and dbname are very problematic
> for admins and developers who often live in different worlds.

The documenation is sparse because at the time it was added, there was
little interest in it from the community, so a single mention was added
and documentation was pushed into the config file. We can adjust that
now that there is interest.

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-02-25 02:35:12 Re: AC_REPLACE_FUNCS([getaddrinfo]) in 8.1.3
Previous Message Clark C. Evans 2006-02-25 00:40:33 Re: constraints and sql92 information_schema compliance

Browse pgsql-patches by date

  From Date Subject
Next Message James Robinson 2006-02-25 04:36:51 2 line patch to allow plpythonu functions to return void ...
Previous Message Martijn van Oosterhout 2006-02-24 20:14:07 Re: how solve diff of API counstruct_md_array between