Re: [HACKERS] Case Preservation disregarding case

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To:
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Case Preservation disregarding case
Date: 2006-12-02 07:41:37
Message-ID: 45712E31.1030004@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Chuck McDevitt wrote:
> At Teradata, we certainly interpreted the spec to allow case-preserving,
> but case-insensitive, identifiers.
> Users really liked it that way

My 2 thoughts:

1: It seems like this behavior of case sensitive-or-not-identifiers
could/should be a config option -- either globally for the server,
database, or at the connection/session level. Other databases *do*
support this type of granular config of misc SQL behavior -- its
essential for shared hosting environments. Without it some users just
*cant* make the switch. Quoting all an app's identifiers -- or renaming
camel-case to underscored -- show stopper.

2: Even though the spec state different (that identifiers should be
treated as case sensitive or else folded), precedence seems to have
changed that:

a) The databases that enforce this rule are fewer, I believe. IMO SQL
is now considered even higher than a 4GL language because it use is so
widespread - laymen need to use it.

b) the fact that different identifiers of mixed case could even coexist
in a table-columns or 'AS' or 'JOIN' -- really represents a more of an
err'd design -- and a case-insen option would detect this (unlike the
current behavior). It would throw an immediate ("fail fast") runtime
exception. So I think it's *safer*. (If tbl.rowId and tbl.rowid both
exist in a table or AS identifiers, something bad _will_ happen when
someone takes over a project)

If there were a new default behavior (or just config option added), my
vote would, without a doubt, be for case-insens (yet case preserving)
mode... even when using quoting identifiers. This case sen. behavior
doesn't seem to offer any advantage/safety.

ken

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2006-12-02 08:43:36 Re: Dynamic Tracing docs
Previous Message Joshua D. Drake 2006-12-02 06:58:44 PostgreSQL win32 fragmentation issue

Browse pgsql-sql by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-12-02 13:35:56 Re: [SQL] Case Preservation disregarding case
Previous Message Aaron Bono 2006-12-02 07:19:12 Re: Tracking Down Error in Stored Procedure