Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpiEf-0006pI-CY for pgsql-bugs@arkaria.postgresql.org; Fri, 23 Oct 2015 19:42:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZpiEe-00022J-6M for pgsql-bugs@arkaria.postgresql.org; Fri, 23 Oct 2015 19:42:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZpiEd-00021w-CS for pgsql-bugs@postgresql.org; Fri, 23 Oct 2015 19:42:43 +0000 Received: from p12.web-hosting.com ([192.64.118.62]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZpiEW-0001D0-HA for pgsql-bugs@postgresql.org; Fri, 23 Oct 2015 19:42:42 +0000 Received: from [208.74.121.106] (port=33596 helo=Macintosh-2.local) by premium12.web-hosting.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZpiET-003baa-W0; Fri, 23 Oct 2015 15:42:34 -0400 Subject: =?UTF-8?Q?Re:_pg=5frestore_WAS_Re:__BUG_#13702:_pg=5fdump_int?= =?UTF-8?Q?erprets_=e2=80=9c=3d=e2=80=9d_in_a_db_name_incorrectly?= To: "David G. Johnston" References: <20151023003445.931.91267@wrigleys.postgresql.org> <56298DAC.3070906@felipegasper.com> <20151023054510.5b5467c6@engels> <562A7A76.9000700@felipegasper.com> <562A8271.400@felipegasper.com> Cc: David Gould , "pgsql-bugs@postgresql.org" From: Felipe Gasper Message-ID: <562A8DA8.3090309@felipegasper.com> Date: Fri, 23 Oct 2015 14:42:32 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - premium12.web-hosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - felipegasper.com X-Get-Message-Sender-Via: premium12.web-hosting.com: authenticated_id: fgasper/from_h X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched X-Pg-Spam-Score: -2.6 (--) 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 23 Oct 2015 2:14 PM, David G. Johnston wrote: > On Fri, Oct 23, 2015 at 2:54 PM, Felipe Gasper >wrote: > > On 23 Oct 2015 1:33 PM, David G. Johnston wrote: > > On Fri, Oct 23, 2015 at 2:20 PM, Felipe Gasper > > >>wrote: > > > > Again, the "--dbname" argument can either be an actual database > name or > a "connection info" object. > > > But the documentation doesn’t say that; it only says that it’s the > name of the database. Should the documentation be updated, then? > > 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. > > > Is “connection info” an option with pg_restore, though, which > mandates a --dbname argument? > > > ​ > http://www.postgresql.org/docs/9.4/interactive/libpq-connect.html#LIBPQ-CONNECT-DBNAME > ​ > dbname > The database name. Defaults to be the same as the user name. In certain > contexts, the value is checked for extended formats; see Section 31.1.1 > for more details on those. > > ​31.1.1 > http://www.postgresql.org/docs/9.4/interactive/libpq-connect.html#LIBPQ-CONNSTRING > ​ > ​See "dbname" in particular > > So it is documented.​ Suggestions and patches welcomed if you think it > should be covered differently. Ah, ok. The reason why I didn’t find this myself was that there’s nothing that leads me from the pg_restore docs’ description of the --dbname parameter to the sections you’ve mentioned above. Maybe that’s the thing, then--would it work to add a link to describe how pg_restore parses the argument to “--dbname”? A usage example, too, perhaps, to show how any valid DB name that the PostgreSQL server recognizes can be fed into pg_restore, pg_dump, etc.? > > ​pg_restore --dbname="dbname=crazy=db=name" [...] likely will work but I > cannot quickly test it ATM. > Hooray! At least in 9.0.18, if I quote the DB name as conninfo string, I can indeed restore to a DB with spaces, equals, etc. in its name. Now to try it in 8.1. If it doesn’t work there, we’ll probably just forbid “=” in DB names and call it a day. Thank you for your responses. I hope I’ve not been untoward in any of this -FG -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs