Re: pg_restore WAS Re: [BUGS] BUG #13702: pg_dump interprets “=” in a db name incorrectly

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Felipe Gasper <felipe(at)felipegasper(dot)com>
Cc: David Gould <daveg(at)sonic(dot)net>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pg_restore WAS Re: [BUGS] BUG #13702: pg_dump interprets “=” in a db name incorrectly
Date: 2015-10-23 18:33:04
Message-ID: CAKFQuwbS+mUpCcBg2BmS=sv=1UDt=L63JYkhR9qxJ-3qYN_kvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Oct 23, 2015 at 2:20 PM, Felipe Gasper <felipe(at)felipegasper(dot)com>
wrote:

> Apparently 9.0 can’t pg_restore DBs that have equals signs in them...at
> least, such is the case with pg_restore on 9.0.18. It gets confused by the
> “=”, even when it’s in the --dbname argument.
>
> To me, that seems like a bug, as there’s no reason that the --dbname
> argument should be interpreted as anything other than the name of a
> database.
>
> Does anyone here happen to know when pg_restore offered alternative ways
> of specifying the database?
>
> -FG
>
> On 23 Oct 2015 7:45 AM, David Gould wrote:
>
>> On Thu, 22 Oct 2015 20:30:20 -0500
>> Felipe Gasper <felipe(at)felipegasper(dot)com> wrote:
>>
>> Interesting -- also, in 9.0 I *can* do:
>>>
>>> dbname='...'
>>>
>>> … and it works. Undocumented, apparently (?), but it does the job.
>>>
>>> But, I actually have to support all the way back to 8.1, and I’m a bit
>>> leery of relying on undocumented (?) features for our backup
>>> functionality. Hopefully down the road we can just move everything to
>>> >=9.3, and peace and love will reign. :)
>>>
>>
>> You can dump and load older version database from newer version clients.
>> The dbname parsing problem you are having is on the client, not the
>> server,
>> so if you can arrange to take the backup with a more current client then
>> one of the suggestions in this thread will work for you.
>>
>
​It would help greatly if you post full command lines and error messages...

Again, the "--dbname" argument can either be an actual database name or a
"connection info" object. In the later case the "=" has a special
meaning. If your database has an "=" in its name then it seems like you
have to use the "connection info" definition form. Note I haven't dug into
this with respect to pg_restore but that is the findings from the brief
psql test I performed.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Felipe Gasper 2015-10-23 18:54:41 Re: pg_restore WAS Re: BUG #13702: pg_dump interprets “=” in a db name incorrectly
Previous Message Felipe Gasper 2015-10-23 18:20:38 pg_restore WAS Re: BUG #13702: pg_dump interprets “=” in a db name incorrectly