Re: Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name

From: Dave Page <dpage(at)pgadmin(dot)org>
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name
Date: 2014-06-02 18:42:03
Message-ID: CA+OCxowHZPAk+FfiYg4S3QkwrpQ8guF+K4gzMm6xGa5-ZpTorg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Mon, Jun 2, 2014 at 7:09 PM, David G Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>>
>> I
>> f all the letters are lowercase, no double quotes are added.
>
>
> I don't know if this statement is actually true but it makes no difference
> in reality whether the double-quotes are added in the case where only
> lowercase letters and numbers/underscore are used. As far the executor is
> concerned the same exact identifier text will be used. Likely, and for
> reasoning purposes, it is sufficient to consider that ALL identifiers
> generated by pgAdmin are surrounded with double-quotes in the resultant SQL
> statements that are sent to the server.

Correct. With the exception of the query tool (for obvious reasons),
pgAdmin is designed to handle all the implementation details of SQL
generation etc. for you. Therefore, if you use mixed-case in any of
the object properties dialogues for values that are not expected to be
expressions, it will automatically quote them for you (in the correct
way, as sometimes the quoting rules are different depending on the
situation - e.g. comment strings vs. identifiers). So, entering a
table name of Log will result in:

CREATE TABLE "Log" ...

whilst entering a table name of log will give:

CREATE TABLE log ...

In the latter case, pgAdmin will omit the quotes as they are not
necessary. You can see what it's doing by looking at the SQL tab on
any properties dialogue.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Matt Magoffin 2014-06-02 19:06:50 Copy/paste results in garbage if clipboard contains rich text on OS X
Previous Message Darren Duncan 2014-06-02 18:15:40 Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name