Re: pgsql: Fix pg_dumpall with database names containing = - Mailing list pgsql-committers

From Heikki Linnakangas
Subject Re: pgsql: Fix pg_dumpall with database names containing =
Date
Msg-id 512CE2D6.2010204@vmware.com
Whole thread Raw
In response to Re: pgsql: Fix pg_dumpall with database names containing =  (Thom Brown <thom@linux.com>)
Responses Re: pgsql: Fix pg_dumpall with database names containing =
List pgsql-committers
On 26.02.2013 18:03, Thom Brown wrote:
> On 20 February 2013 15:14, Heikki Linnakangas<heikki.linnakangas@iki.fi>  wrote:
>> Fix pg_dumpall with database names containing =
>>
>> If a database name contained a '=' character, pg_dumpall failed. The problem
>> was in the way pg_dumpall passes the database name to pg_dump on the
>> command line. If it contained a '=' character, pg_dump would interpret it
>> as a libpq connection string instead of a plain database name.
>>
>> To fix, pass the database name to pg_dump as a connection string,
>> "dbname=foo", with the database name escaped if necessary.
>>
>> Back-patch to all supported branches.
>
> I also notice that if you create a database with an "=" in, you can't
> connect to it using psql.

Specifying it as a connection string works:

psql dbname='8=8'

That's the same trick I applied to pg_dumpall's pg_dump invocations.

- Heikki


pgsql-committers by date:

Previous
From: Thom Brown
Date:
Subject: Re: pgsql: Fix pg_dumpall with database names containing =
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Remove the check for COPY TO STDIN and COPY FROM STDOUT from ecp