public inbox for [email protected]  
help / color / mirror / Atom feed
Config file for psql
8+ messages / 7 participants
[nested] [flat]

* Config file for psql
@ 2006-02-18 18:52 Martijn van Oosterhout <[email protected]>
  2006-02-18 19:12 ` Re: Config file for psql Peter Eisentraut <[email protected]>
  2006-02-18 19:19 ` Re: Config file for psql Michael Fuhr <[email protected]>
  0 siblings, 2 replies; 8+ messages in thread

From: Martijn van Oosterhout @ 2006-02-18 18:52 UTC (permalink / raw)
  To: [email protected]

Hi,

A little while ago there was someone asking for tools to make it easier
to connect to multiple servers. It occured to me that it might be
useful to have a config file the way ssh does it:

Host production
  ServerName  db1
  DBName      main
  Username    blah
  Password    blah
  UseSSL      yes

Host test
  ServerName db2
  ServerPort 5434
  DBName     main
  Username   blah
  Password   blah

Host *
  Username    default


So when you type "psql test" it fills in the server name, port,
database, username and password for you. For hosts not listed, it gives
a default username "default". It's really just a variation on the
.netrc file.

Thoughts?
-- 
Martijn van Oosterhout   <[email protected]>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


Attachments:

  [application/pgp-signature] signature.asc (189B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
@ 2006-02-18 19:12 ` Peter Eisentraut <[email protected]>
  1 sibling, 0 replies; 8+ messages in thread

From: Peter Eisentraut @ 2006-02-18 19:12 UTC (permalink / raw)
  To: [email protected]; Martijn van Oosterhout <[email protected]>

Martijn van Oosterhout wrote:
> A little while ago there was someone asking for tools to make it
> easier to connect to multiple servers. It occured to me that it might
> be useful to have a config file the way ssh does it:

That looks suspiciously like the service facility that we already have.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
@ 2006-02-18 19:19 ` Michael Fuhr <[email protected]>
  2006-02-18 19:37   ` Re: Config file for psql Andrew Dunstan <[email protected]>
  2006-02-18 20:40   ` Re: Config file for psql Martijn van Oosterhout <[email protected]>
  1 sibling, 2 replies; 8+ messages in thread

From: Michael Fuhr @ 2006-02-18 19:19 UTC (permalink / raw)
  To: Martijn van Oosterhout <[email protected]>; +Cc: [email protected]

On Sat, Feb 18, 2006 at 07:52:22PM +0100, Martijn van Oosterhout wrote:
> A little while ago there was someone asking for tools to make it easier
> to connect to multiple servers. It occured to me that it might be
> useful to have a config file the way ssh does it:

Something like pg_service.conf?  Hardly anybody ever mentions it
even though the libpq documentation refers to it; I wonder how many
people even know it exists.

http://www.postgresql.org/docs/8.1/interactive/libpq.html#LIBPQ-CONNECT
http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html

-- 
Michael Fuhr



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
  2006-02-18 19:19 ` Re: Config file for psql Michael Fuhr <[email protected]>
@ 2006-02-18 19:37   ` Andrew Dunstan <[email protected]>
  2006-02-18 19:49     ` Re: Config file for psql Tom Lane <[email protected]>
  1 sibling, 1 reply; 8+ messages in thread

From: Andrew Dunstan @ 2006-02-18 19:37 UTC (permalink / raw)
  To: Michael Fuhr <[email protected]>; +Cc: Martijn van Oosterhout <[email protected]>; [email protected]



Michael Fuhr wrote:

>On Sat, Feb 18, 2006 at 07:52:22PM +0100, Martijn van Oosterhout wrote:
>  
>
>>A little while ago there was someone asking for tools to make it easier
>>to connect to multiple servers. It occured to me that it might be
>>useful to have a config file the way ssh does it:
>>    
>>
>
>Something like pg_service.conf?  Hardly anybody ever mentions it
>even though the libpq documentation refers to it; I wonder how many
>people even know it exists.
>
>http://www.postgresql.org/docs/8.1/interactive/libpq.html#LIBPQ-CONNECT
>http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html
>
>  
>

This needs a LOT more prominence. We probably need to refer to these 
things on the manual pages for each of the libpq clients we have. 
Haven't we learned that lesson from .pgpass ? The number of people who 
read the libpq docs is probably vanishingly small.

cheers

andrew





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
  2006-02-18 19:19 ` Re: Config file for psql Michael Fuhr <[email protected]>
  2006-02-18 19:37   ` Re: Config file for psql Andrew Dunstan <[email protected]>
@ 2006-02-18 19:49     ` Tom Lane <[email protected]>
  2006-02-19 17:25       ` Re: [HACKERS] Config file for psql Jim C. Nasby <[email protected]>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2006-02-18 19:49 UTC (permalink / raw)
  To: Andrew Dunstan <[email protected]>; +Cc: Michael Fuhr <[email protected]>; Martijn van Oosterhout <[email protected]>; [email protected]

Andrew Dunstan <[email protected]> writes:
> This needs a LOT more prominence. We probably need to refer to these 
> things on the manual pages for each of the libpq clients we have. 
> Haven't we learned that lesson from .pgpass ? The number of people who 
> read the libpq docs is probably vanishingly small.

Perhaps we should make a concerted effort to split the libpq docs into a
section "for programmers" vs one "for users", the latter part covering
the libpq behavior that is interesting to users of a libpq-based app.
.pgpass, pg_service, the environment vars, SSL behavior, maybe some
other things belong in the "for users" part.

I think only the environment-vars page is currently linked from the
client-apps reference pages, but if we did this we could link to the
entire for-users section and be done with it.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [HACKERS] Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
  2006-02-18 19:19 ` Re: Config file for psql Michael Fuhr <[email protected]>
  2006-02-18 19:37   ` Re: Config file for psql Andrew Dunstan <[email protected]>
  2006-02-18 19:49     ` Re: Config file for psql Tom Lane <[email protected]>
@ 2006-02-19 17:25       ` Jim C. Nasby <[email protected]>
  2006-02-28 19:48         ` Re: [HACKERS] Config file for psql Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 8+ messages in thread

From: Jim C. Nasby @ 2006-02-19 17:25 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; pgsql-docs; +Cc: Andrew Dunstan <[email protected]>; Michael Fuhr <[email protected]>; Martijn van Oosterhout <[email protected]>; [email protected]

On Sat, Feb 18, 2006 at 02:49:08PM -0500, Tom Lane wrote:
> Perhaps we should make a concerted effort to split the libpq docs into a
> section "for programmers" vs one "for users", the latter part covering
> the libpq behavior that is interesting to users of a libpq-based app.
> .pgpass, pg_service, the environment vars, SSL behavior, maybe some
> other things belong in the "for users" part.

+1. Is there a docs TODO?
-- 
Jim C. Nasby, Sr. Engineering Consultant      [email protected]
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [HACKERS] Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
  2006-02-18 19:19 ` Re: Config file for psql Michael Fuhr <[email protected]>
  2006-02-18 19:37   ` Re: Config file for psql Andrew Dunstan <[email protected]>
  2006-02-18 19:49     ` Re: Config file for psql Tom Lane <[email protected]>
  2006-02-19 17:25       ` Re: [HACKERS] Config file for psql Jim C. Nasby <[email protected]>
@ 2006-02-28 19:48         ` Bruce Momjian <[email protected]>
  0 siblings, 0 replies; 8+ messages in thread

From: Bruce Momjian @ 2006-02-28 19:48 UTC (permalink / raw)
  To: Jim C. Nasby <[email protected]>; +Cc: Tom Lane <[email protected]>; pgsql-docs; Andrew Dunstan <[email protected]>; Michael Fuhr <[email protected]>; Martijn van Oosterhout <[email protected]>; [email protected]

Jim C. Nasby wrote:
> On Sat, Feb 18, 2006 at 02:49:08PM -0500, Tom Lane wrote:
> > Perhaps we should make a concerted effort to split the libpq docs into a
> > section "for programmers" vs one "for users", the latter part covering
> > the libpq behavior that is interesting to users of a libpq-based app.
> > .pgpass, pg_service, the environment vars, SSL behavior, maybe some
> > other things belong in the "for users" part.
> 
> +1. Is there a docs TODO?

Added to TODO:

	* Split out libpq pgpass and environment documentation sections
	  to make it easier for non-developers to find

Looking at the existing manual, how do we do this?  Do we make separate 
libpq-programming and a libpq-runtime sections?

-- 
  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. +




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Config file for psql
  2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
  2006-02-18 19:19 ` Re: Config file for psql Michael Fuhr <[email protected]>
@ 2006-02-18 20:40   ` Martijn van Oosterhout <[email protected]>
  1 sibling, 0 replies; 8+ messages in thread

From: Martijn van Oosterhout @ 2006-02-18 20:40 UTC (permalink / raw)
  To: Michael Fuhr <[email protected]>; +Cc: [email protected]

On Sat, Feb 18, 2006 at 12:19:39PM -0700, Michael Fuhr wrote:
> On Sat, Feb 18, 2006 at 07:52:22PM +0100, Martijn van Oosterhout wrote:
> > A little while ago there was someone asking for tools to make it easier
> > to connect to multiple servers. It occured to me that it might be
> > useful to have a config file the way ssh does it:
> 
> Something like pg_service.conf?  Hardly anybody ever mentions it
> even though the libpq documentation refers to it; I wonder how many
> people even know it exists.

I'd say not many? If you search the mail archives for "pg_service.conf"
in the last two years, there's only 15 matches and even then it's only
ever mentioned on -hackers or -patches.

For example, nobody brought it up that last thread about connecting to
multiple servers, even though it would have been the perfect solution.

I certainly never heard of it and I've been using postgres and been on
-general for several years.

Have a nice day,
-- 
Martijn van Oosterhout   <[email protected]>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


Attachments:

  [application/pgp-signature] signature.asc (189B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2006-02-28 19:48 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-18 18:52 Config file for psql Martijn van Oosterhout <[email protected]>
2006-02-18 19:12 ` Peter Eisentraut <[email protected]>
2006-02-18 19:19 ` Michael Fuhr <[email protected]>
2006-02-18 19:37   ` Andrew Dunstan <[email protected]>
2006-02-18 19:49     ` Tom Lane <[email protected]>
2006-02-19 17:25       ` Jim C. Nasby <[email protected]>
2006-02-28 19:48         ` Bruce Momjian <[email protected]>
2006-02-18 20:40   ` Martijn van Oosterhout <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox