Re: pg_service.conf - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_service.conf
Date
Msg-id 200602250228.k1P2SUF06093@candle.pha.pa.us
Whole thread Raw
In response to pg_service.conf  ("Mark Woodward" <pgsql@mohawksoft.com>)
List pgsql-hackers
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. +


pgsql-hackers by date:

Previous
From: "Clark C. Evans"
Date:
Subject: Re: constraints and sql92 information_schema compliance
Next
From: Bruce Momjian
Date:
Subject: Re: AC_REPLACE_FUNCS([getaddrinfo]) in 8.1.3