Re: Case sensitive field names - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Case sensitive field names
Date
Msg-id 39D07BEC.4024B028@tm.ee
Whole thread Raw
In response to Case sensitive field names  ("Jarmo Paavilainen" <netletter@comder.com>)
Responses SV: Case sensitive field names
List pgsql-hackers
Jarmo Paavilainen wrote:
> 
> Hi,
> 
> Is there a way to make postgre insensitive about field name cases?
> 
> Like "initdb --fields-are-case-insensitive --compares-are-case-insensitive"
> 
> Yes I know about "CaseIsKept" and CaseIsNotKept (note the quotes). But that
> gives me more trouble than it solves. And what about "case insensitive field
> name with spaces". I believe that space is legal in field names.

The main problem I see with case-insensitivity is the fact that there
are always 
more than one way to do it, as it depends on charset _and_ locale ;(

For example 'Ä'=='ä' in my locale but not in US, not to mention that in
some 
locales even the character count may change when going from upper to
lower case.

So I suspect that only valid reason for case-insensitivity is
compatibility with 
arbitraryly-case-altering OS-es, like the ones Microsoft produces.

For any other use WYSIWYG field names should be preferred.

> Are there any real reason why postgre is sensitive about field names (except
> SQL92 states that this is how it must be)?
> 
> I suppose somewhere along the way I have all field names separated from the
> query, and in which file(s) does that happen? (So I can do my own hack, add
> "tolower(fieldName)").
> 
> Ive tried to locate the right files in the source for 7.0.2, but there are
> more that one file.

I guess the best place would be sobewhere very near lexer.

You could also try just uppercasing anything outside ''/"" even before
it is 
passed to backend.

---------
Hannu


pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: pgsql is 75 times faster with my new index scan
Next
From: Thomas Lockhart
Date:
Subject: New mod_php3 RPMs for Mandrake