Re: [HACKERS] Case Preservation disregarding case

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [HACKERS] Case Preservation disregarding case
Date: 2006-12-03 16:00:52
Message-ID: 4572F4B4.4060600@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-12-03 16:57:06 Re: [HACKERS] Case Preservation disregarding case
Previous Message Martijn van Oosterhout 2006-12-03 14:26:31 Re: new index methods

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2006-12-03 16:57:06 Re: [HACKERS] Case Preservation disregarding case
Previous Message Aaron Bono 2006-12-03 15:54:49 Re: hi any one can help me