pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: pg_dumpall fails if a database name contains =
Date: Wed, 20 Feb 2013 17:17:46 +0200
Message-ID: <5124E91A.5060206@vmware.com> (raw)
In-Reply-To: <5124DB67.5050600@vmware.com>
References: <5124DB67.5050600@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 20.02.2013 16:19, Heikki Linnakangas wrote:
> ~/pgsql.92stable$ bin/createdb "foo=bar"
> ~/pgsql.92stable$ bin/pg_dumpall > /dev/null
> pg_dump: [archiver (db)] connection to database "(null)" failed: invalid
> connection option "foo"
> pg_dumpall: pg_dump failed on database "foo=bar", exiting
>
> There are two bugs above:
>
> 1. When pg_dumpall passes the database name to pg_dump as a command line
> argument, pg_dump interprets it as a connection string if it contains =.

Fixed this by passing the database name to pg_dump as a connection 
string. That way pg_dump doesn't interpret the database name. So now 
pg_dumpall calls pg_dump like this:

pg_dump ... "dbname='foo'"

instead of just

pg_dump ... "foo"

> 2. When you pass an invalid connection string to pg_dump, it passes a
> NULL pointer to printf when constructing the error message. It shows as
> "(null)" above, but would segfault on other platforms.

Fixed by printing an empty string instead of passing NULL to fprintf.

- Heikki


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <5124E91A.5060206@vmware.com>
Permalink:  ../5124E91A.5060206@vmware.com/
Also on:    postgresql.org/message-id/5124E91A.5060206@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnakangas@vmware.com
  Subject: Re: pg_dumpall fails if a database name contains =
  In-Reply-To: <5124E91A.5060206@vmware.com>
  References: <5124DB67.5050600@vmware.com> <5124E91A.5060206@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox