Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] psql commandline conninfo

From: Casey Duncan <casey(at)pandora(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>,Martijn van Oosterhout <kleptog(at)svana(dot)org>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>,List pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] psql commandline conninfo
Date: 2006-12-12 23:57:21
Message-ID: E80A0E32-6CD9-4979-8BFE-1D49DCBA10E0@pandora.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Dec 12, 2006, at 3:37 PM, Tom Lane wrote:

> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> Right. Here's the patch I just knocked up, which seems to Just  
>> Work (tm) ;-)
>
> The main objection I can see to this is that you'd get a fairly
> unhelpful message if you intended a conninfo string and there was
> anything wrong with your syntax (eg, misspelled keyword).  Maybe we
> should go with the conn: bit, although really that doesn't seem any
> less likely to collide with actual dbnames than the "does it contain
> "="" idea.  Anyone have other ideas how to disambiguate?

I would personally prefer a real option over a prefix, i.e. -- 
dbconn="service=foo" though the inline conninfo string in place of  
the dbname would be ideal.

Perhaps like Tom suggests, if the value matches a conninfo regex  
(slightly more rigid than just containing an equals character) then  
we assume it is a conninfo string, but never try it as a dbname. If  
someone has a database named like a conninfo string (c'mon folks ;^)  
then they would need to pass it as explicitly an argument to '-d' or  
'--dbname', not as a bare argument.

This is not completely b/w compatible of course, but IMO the added  
convenience outweighs the incompatibility.

-Casey

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-12-13 00:03:24
Subject: Re: Better management of mergejoinable operators
Previous:From: Gregory StarkDate: 2006-12-12 23:54:21
Subject: Concurrent connections in psql

pgsql-patches by date

Next:From: Andrew DunstanDate: 2006-12-13 01:16:38
Subject: Re: psql commandline conninfo
Previous:From: Tom LaneDate: 2006-12-12 23:37:26
Subject: Re: [HACKERS] psql commandline conninfo

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group