A while ago it was speculated that it might be nice to have a default 
service in libpq's pg_service.conf file that would supply missing 
connection parameters if none are specified elsewhere, so users could, 
say, set the default server host in a configuration file instead of 
environment variables.

The precendence would be like this: explicit specification, service (if 
explicitly specified), environment, (new: ) default service, 
compiled-in default (e.g., for port).  (Or maybe the default service 
before the environment?)

Comments?  Better ideas?


Tue, 29 Jun 2004 21:46:34 +0200
Peter Eisentraut <peter_e@gmx.net>
Default libpq service
On Tue, Jun 29, 2004 at 09:46:34PM +0200, Peter Eisentraut wrote:
> A while ago it was speculated that it might be nice to have a default 
> service in libpq's pg_service.conf file that would supply missing 
> connection parameters if none are specified elsewhere, so users could, 
> say, set the default server host in a configuration file instead of 
> environment variables.
> 
> The precendence would be like this: explicit specification, service (if 
> explicitly specified), environment, (new: ) default service, 
> compiled-in default (e.g., for port).  (Or maybe the default service 
> before the environment?)
> 
> Comments?  Better ideas?

Only problem that springs to mind is that you probably wouldn't want a
default password in a world-readable /etc/ file, but you can't stop a
determined fool anyway.

I know it would make my life a little easier, so yeah, go for it.  This
was proposed for libpqxx a long time ago, but I felt it belonged more at
the libpq level.


Jeroen

PS - Nette Witmung, danke  :)


Tue, 29 Jun 2004 23:31:05 +0200
"Jeroen T. Vermeulen" <jtv@xs4all.nl>
Re: Default libpq service