Feature idea: standard_quoting_identifiers property

Lists: pgsql-hackers
From: Grzegorz Szpetkowski <gszpetkowski(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Feature idea: standard_quoting_identifiers property
Date: 2011-06-10 10:06:14
Message-ID: BANLkTimDzWYAO6GSEpbUvi-s0f3gQDE_UA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Forgive me if there was already some discussion about it (I can't find
anyone). As documentation describes
(http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html):

"Quoting an identifier also makes it case-sensitive, whereas unquoted
names are always folded to lower case. For example, the identifiers
FOO, foo, and "foo" are considered the same by PostgreSQL, but "Foo"
and "FOO" are different from these three and each other. (The folding
of unquoted names to lower case in PostgreSQL is incompatible with the
SQL standard, which says that unquoted names should be folded to upper
case. Thus, foo should be equivalent to "FOO" not "foo" according to
the standard. If you want to write portable applications you are
advised to always quote a particular name or never quote it.)"

What do you think about adding new postgresql.conf property, let's
briefly say standard_quoting_identifiers with default value off to
maintain backward compatibility, which allows to use standard
upper-case equivalents (so Foo and "FOO" will be the same, but Foo and
"foo" not) ?

Pros (that I see):

-- SQL standard conformance
-- easier migration from/to other RDBMS like Oracle DB

Regards,
Grzegorz Szpetkowski


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Grzegorz Szpetkowski <gszpetkowski(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Feature idea: standard_quoting_identifiers property
Date: 2011-06-10 13:03:04
Message-ID: 4DF21608.2040401@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 10.06.2011 13:06, Grzegorz Szpetkowski wrote:
> What do you think about adding new postgresql.conf property, let's
> briefly say standard_quoting_identifiers with default value off to
> maintain backward compatibility, which allows to use standard
> upper-case equivalents (so Foo and "FOO" will be the same, but Foo and
> "foo" not) ?

This has been suggested and rejected, or at least left unresolved
because no-one has been able to figure out all the details, many times
before. You should read the past discussions on this. For starters, see
the list of threads listed on the TODO item on this:

http://wiki.postgresql.org/wiki/Todo

"Consider allowing control of upper/lower case folding of unquoted
identifiers"

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com