Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8BQi-000826-Hg for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Feb 2013 15:17:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U8BQh-0006Wt-SX for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Feb 2013 15:17:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8BQh-0006WG-0S for pgsql-bugs@postgresql.org; Wed, 20 Feb 2013 15:17:55 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U8BQd-0003TA-4w for pgsql-bugs@postgresql.org; Wed, 20 Feb 2013 15:17:54 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id E399D28861 for ; Wed, 20 Feb 2013 07:17:48 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id E065718705 for ; Wed, 20 Feb 2013 07:17:48 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id EA8E11219CD for ; Wed, 20 Feb 2013 07:20:56 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dn0RAbNaAQal for ; Wed, 20 Feb 2013 07:20:56 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id C61B31219C6 for ; Wed, 20 Feb 2013 07:20:56 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA for ; Wed, 20 Feb 2013 07:20:56 -0800 (PST) Message-ID: <5124E91A.5060206@vmware.com> Date: Wed, 20 Feb 2013 17:17:46 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Pg Bugs Subject: Re: pg_dumpall fails if a database name contains = References: <5124DB67.5050600@vmware.com> In-Reply-To: <5124DB67.5050600@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.5 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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