psql service parameter

Started by Andrew Dunstanover 19 years ago5 messages
#1Andrew Dunstan
andrew@dunslane.net

I have just noticed that there does not seem to be a psql command line
switch to specify a pg_service.conf name to connect to. I know we can
use a PGSERVICE environment setting instead, but I think we should have
a command line switch too. Small 8.3 TODO item?

cheers

andrew

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: psql service parameter

Andrew Dunstan <andrew@dunslane.net> writes:

I have just noticed that there does not seem to be a psql command line
switch to specify a pg_service.conf name to connect to. I know we can
use a PGSERVICE environment setting instead, but I think we should have
a command line switch too. Small 8.3 TODO item?

More generally, it'd be nice to be able to specify a PQconnectdb string,
instead of having to invent a new psql switch for every keyword we allow
in those strings.

regards, tom lane

#3Albe Laurenz
all@adv.magwien.gv.at
In reply to: Tom Lane (#2)
Re: psql service parameter

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

I have just noticed that there does not seem to be a psql
command line switch to specify a pg_service.conf name
to connect to. I know we can use a PGSERVICE environment
setting instead, but I think we should have
a command line switch too. Small 8.3 TODO item?

More generally, it'd be nice to be able to specify a PQconnectdb

string,

instead of having to invent a new psql switch for every keyword we

allow

in those strings.

I think that both would be nice. Indeed, I wanted to suggest
a switch for PGSERVICE myself.

Ideas:
-n or --name for the service name
-C or --connect for the connect string

So, +1 on the original suggestion!

Yours,
Laurenz Albe

#4Martijn van Oosterhout
kleptog@svana.org
In reply to: Albe Laurenz (#3)
Re: psql service parameter

On Wed, Sep 27, 2006 at 04:54:35PM +0200, Albe Laurenz wrote:

I think that both would be nice. Indeed, I wanted to suggest
a switch for PGSERVICE myself.

It some point I was wondering about using the @ symbol. If you have a
service entry called "testserver", you could do:

psql @testserver

But maybe that introduces too many quoting issues. Ofcourse, being able
to provide a complete connect string would be good too...

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#5David Fetter
david@fetter.org
In reply to: Andrew Dunstan (#1)
Re: psql service parameter

On Wed, Sep 27, 2006 at 10:23:13AM -0400, Andrew Dunstan wrote:

I have just noticed that there does not seem to be a psql command
line switch to specify a pg_service.conf name to connect to. I know
we can use a PGSERVICE environment setting instead, but I think we
should have a command line switch too. Small 8.3 TODO item?

The hack I've used so far is

PGSERVICE=/path/to/pg_service.conf psql

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!