Re: EXTERNAL: Re: Database name with semicolon

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Joby John <Joby(dot)John(at)nccgroup(dot)trust>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: EXTERNAL: Re: Database name with semicolon
Date: 2018-06-27 14:47:41
Message-ID: CAFj8pRDJQUazDDGvS2XzCUTHtA+xWhMQO9_OWCiFUDRq1EYJGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

2018-06-27 16:39 GMT+02:00 Joby John <Joby(dot)John(at)nccgroup(dot)trust>:

> Hi Pavel,
>
>
>
> Thanks for coming back to me.
>

please, don't top post
https://en.wikipedia.org/wiki/Posting_style#Top-posting

>
> The version of the Postgres server where I am trying is: 9.5.3
>

9.5 is modern Postgres. There should not be problems with names.

> Yes, I tried putting the database name in double quotes with no luck.
>
> Please note we are using PostgreSQL Unicode ODBC driver (version 10.2) to
> communicate with the server.
>

looks like ODBC issue - semicolon has some semantic there

https://stackoverflow.com/questions/22398212/escape-semicolon-in-odbc-connection-string-in-app-config-file

but probably you read these pages

Maybe some combination of quotes is necessary

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms722656(v=vs.85)

you can try

dbname = '"ssss; sss"'

>
> Regards,
>
> Joby John
>
>
>
> *From:* Pavel Stehule [mailto:pavel(dot)stehule(at)gmail(dot)com]
> *Sent:* 27 June 2018 15:26
> *To:* Joby John <Joby(dot)John(at)nccgroup(dot)trust>
> *Cc:* pgsql-general(at)postgresql(dot)org
> *Subject:* EXTERNAL: Re: Database name with semicolon
>
>
>
> Hi
>
>
>
> 2018-06-27 15:22 GMT+02:00 Joby John <Joby(dot)John(at)nccgroup(dot)trust>:
>
> 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.
>
> Not sure whether I need to submit this query as a bug or not. Any help is
> much appreciated.
>
>
>
> modern Postgresql has not any problems with special chars
>
>
>
> postgres=# create database "bad name ;;;;";
> CREATE DATABASE
> postgres=# \q
> [pavel(at)nemesis ~]$ psql 'bad name ;;;;'
> psql (11beta1)
> Type "help" for help.
>
> bad name ;;;;=#
>
>
>
> What is version of Postgres?
>
>
>
> Did you try double quotes?
>
>
>
> Regards
>
>
>
> Pavel
>
>
>
>
>
>
>
> Thanks and Regards,
>
> Joby John
> ------------------------------
>
> Joby John
> Software Developer
> NCC Group
> Kings Court, Kingston Road, Leatherhead, KT22 7SL
>
> Telephone: +44 1372 383 800 <+44%201372%20383%20800>
> Mobile:
> Website: 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.
>
>
> ------------------------------
> Joby John
> Software Developer
> NCC Group
> Kings Court, Kingston Road, Leatherhead, KT22 7SL
>
> Telephone: +44 1372 383 800 <+44%201372%20383%20800>
> Mobile:
> Website: 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.
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message amandeep singh 2018-06-27 15:12:59 Re: We find few queries running three times simultaneously with same parameters on postgres db
Previous Message Joby John 2018-06-27 14:39:32 RE: EXTERNAL: Re: Database name with semicolon