Re: [HACKERS] Case Preservation disregarding case - Mailing list pgsql-sql

From Ken Johanson
Subject Re: [HACKERS] Case Preservation disregarding case
Date
Msg-id 4572F4B4.4060600@kensystem.com
Whole thread Raw
In response to Re: [HACKERS] Case Preservation disregarding case  ("Chuck McDevitt" <cmcdevitt@greenplum.com>)
List pgsql-sql
Martijn van Oosterhout wrote:

> I think you're missing the point that clients will be using languages
> that are case sensetive. Consider the following Perl code:
> 
> $dbh->do("CREATE TEMP TABLE foo (Bar int4)");
> $dbh->do("INSERT INTO foo VALUES (1)");
> my $sth = $dbh->prepare("SELECT Bar FROM foo");
> $sth->execute();
> my $row = $sth->fetchrow_hashref();
> print $row->{"bar"};   # prints 1
> 
> This code will works on any version of postgresql ever released, yet
> your change will break it. By setting some options you can work around
> it, but it's still a gratuitous change.
> 
> Have a nice day,

I agree, that code would break -- if the option were enabled globally -- 
because the named-column retrieval internals of that and many existing 
modules don't do case-insens lookups. They would have to be retrofitted 
to support it.

So that is the reason there was an idea proposed per database or per 
connection SQL conformance controls (like what Mysql has). They'd allow 
other apps to elect "less standard" modes (not just this one), for the 
sake of compatibility (beit old PG modules or and other DB). You code 
sample would continue to work.

Ken





pgsql-sql by date:

Previous
From: "Aaron Bono"
Date:
Subject: Re: hi any one can help me
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Case Preservation disregarding case