Re: Database name with semicolon

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Joby John <Joby(dot)John(at)nccgroup(dot)trust>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database name with semicolon
Date: 2018-06-27 22:16:23
Message-ID: 2b53f43f-6f79-19c5-3595-ec90984f53e5@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-06-27 22:29:29 Re: pgp_sym_decrypt() - error 39000: wrong key or corrupt data
Previous Message Andres Freund 2018-06-27 20:44:39 Re: could not read block 0 in file : read only 0 of 8192 bytes when doing nasty on immutable index function