citext operator precedence fix

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: citext operator precedence fix
Date: 2011-09-21 23:52:35
Message-ID: 4E7A78C3.1010403@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

All,

I just tripped over this:

select 'josh'::varchar(32) = 'Josh'::citext;
?column?
----------
f

While it's clear why it's that way, it's not how people would expect
citext to behave. Users expect case-insensitive text to be
case-insensitive for *all* comparisons, not just for comparisons with
the same data type. I would also think that folks migrating from SQL
Server and MySQL would get bitten by this.

I'd like to patch the citext contrib module for 9.2 to fix this by
creating four new = operators to establish the comparison function for
text and varchar.

Before I clean up my ad-hoc fix code for submission, are there strong
objections to this idea? Or are there other data types I'd need to cover?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-09-22 00:09:02 Re: citext operator precedence fix
Previous Message Alexander Korotkov 2011-09-21 21:56:25 Re: Double sorting split patch