citext operator precedence fix - Mailing list pgsql-hackers

From Josh Berkus
Subject citext operator precedence fix
Date
Msg-id 4E7A78C3.1010403@agliodbs.com
Whole thread Raw
Responses Re: citext operator precedence fix
List 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


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Double sorting split patch
Next
From: Tom Lane
Date:
Subject: Re: citext operator precedence fix