Re: Identifier case folding notes - Mailing list pgsql-hackers

From Andreas Joseph Krogh
Subject Re: Identifier case folding notes
Date
Msg-id 200807082320.29530.andreak@officenet.no
Whole thread Raw
In response to Re: Identifier case folding notes  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Identifier case folding notes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tuesday 08 July 2008 23:04:51 Josh Berkus wrote:
> Tom,
> 
> > IMHO, practically the only solid argument for changing from the way
> > we do things now is "to meet the letter of the spec".  The various sorts
> > of gamesmanship you list would most definitely not meet the letter of
> > the spec; between that and the inevitability of breaking some apps,
> > I'm inclined to reject them all on sight.
> 
> Actually, there are a number of *very* popular database tools, particularly 
> in the Java world (such as Netbeans and BIRT) which do mix quoted and 
> unquoted identifiers.  In general, users of those tools reject PostgreSQL 
> as "broken" for our nonstandard behavoir rather than trying to work around 
> it.
> 
> So it's not just a standards issue; this problem really *is* hurting us in 
> adoption.
> 
> -- 
> --Josh
> 
> Josh Berkus
> PostgreSQL @ Sun
> San Francisco

Right. From a user's perspective 4) sounds best. I often run into problems having keywords as column-names:

andreak=# create table test(user varchar);
ERROR:  syntax error at or near "user"
LINE 1: create table test(user varchar);                         ^
andreak=# create table test("user" varchar);
CREATE TABLE
andreak=# insert into test("USER") values('testuser');
ERROR:  column "USER" of relation "test" does not exist
LINE 1: insert into test("USER") values('testuser');                        ^
andreak=# insert into test(user) values('testuser');
ERROR:  syntax error at or near "user"
LINE 1: insert into test(user) values('testuser');                        ^
andreak=# insert into test("user") values('testuser');
INSERT 0 1

As you know, the only way of referring to the "user"-column is to qoute it in lowercase, which many apps and tools
don'tdo.
 

-- 
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / Manager


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Identifier case folding notes
Next
From: "Kevin Grittner"
Date:
Subject: Re: Identifier case folding notes