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

Re: BUG #5304: psql using conninfo fails in connecting to the server

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server
Date: 2010-02-03 01:05:31
Message-ID: 4B68CBDB.4070006@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
On 02/01/2010 08:06 AM, Tom Lane wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> Fujii Masao wrote:
>>> In HEAD, psql using conninfo fails in connecting to the server as follows.
>>>
>>> $ bin/psql "host=localhost"
>>> psql: FATAL:  database "host=localhost" does not exist
>>>
>>> This is because the recently-introduced PQconnectStartParams()
>>> doesn't handle correctly the dbname parameter containing '='.
> 
>> Hmm, I don't think that was ever really supposed to work, it was
>> accidental that it did.
> 
> No, it was intentional.

Here's a patch.

If "=" is found in the dbname psql argument, the argument is assumed to
be a conninfo string. In that case, append application_name to the
conninfo and use PQsetdbLogin() as before. Otherwise use the new
PQconnectdbParams().

Also only uses static assignments for array constructors.

Objections?

Thanks,

Joe

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-02-03 01:14:17
Subject: pgsql: Assorted cleanups in preparation for using a map file to support
Previous:From: Jeff DavisDate: 2010-02-03 01:05:08
Subject: Re: Listen / Notify - what to do when the queue is full

pgsql-bugs by date

Next:From: Fujii MasaoDate: 2010-02-03 01:46:14
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server
Previous:From: Tom LaneDate: 2010-02-02 22:18:06
Subject: Re: whole-row functional index?

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