Re: Database name with semicolon - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Database name with semicolon
Date
Msg-id 2b53f43f-6f79-19c5-3595-ec90984f53e5@aklaver.com
Whole thread Raw
In response to Database name with semicolon  (Joby John <Joby.John@nccgroup.trust>)
Responses Re: Database name with semicolon
List pgsql-general
On 06/27/2018 06:22 AM, Joby John wrote:
> Hi,
> 
> We have a windows application which communicate to Postgres database via 
> PostgreSQL ODBC drivers for windows.
> 
> One of our customers has a database with semicolon in its name (e.g.: 
> “db; name”) and our application is failing to establish connection to 
> that database saying like it could not find the database.
> 
> We tried all known possibilities by enclosing the DB name under quotes, 
> curly brackets etc. but none solved the problem.
> 
> I wonder whether there is any possible way to achieve connection to such 
> database. If not, probably it’s better not to support semicolons within 
> the database name.

https://msdn.microsoft.com/en-us/library/system.data.odbc.odbcconnection.connectionstring(v=vs.110).aspx

"
...

Applications do not have to add braces around the attribute value after 
the Driver keyword unless the attribute contains a semicolon (;), in 
which case the braces are required. If the attribute value that the 
driver receives includes braces, the driver should not remove them but 
they should be part of the returned connection string.

...

"

See if something like below works:

{db; name}

> 
> Not sure whether I need to submit this query as a bug or not. Any help 
> is much appreciated.
> 
> Thanks and Regards,
> 
> Joby John
> 
> ------------------------------------------------------------------------
> Joby John
> Software Developer
> NCC Group
> Kings Court, Kingston Road, Leatherhead, KT22 7SL
> 
> Telephone: +44 1372 383 800 <tel:+44 1372 383 800>
> Mobile: <tel:>
> Website: www.nccgroup.trust <http://www.nccgroup.trust>
> Twitter: @NCCGroupplc <https://twitter.com/NCCGroupplc>
>     <http://www.nccgroup.trust/>
> 
> ------------------------------------------------------------------------
> 
> This email is sent for and on behalf of NCC Group. NCC Group is the 
> trading name of NCC Services Limited (Registered in England CRN: 
> 2802141). The ultimate holding company is NCC Group plc (Registered in 
> England CRN: 4627044). This email may be confidential and/or legally 
> privileged.
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Andres Freund
Date:
Subject: Re: could not read block 0 in file : read only 0 of 8192 bytes whendoing nasty on immutable index function
Next
From: Adrian Klaver
Date:
Subject: Re: pgp_sym_decrypt() - error 39000: wrong key or corrupt data