RE: [SQL] Case insensitive equality operator - Mailing list pgsql-sql

From Jackson, DeJuan
Subject RE: [SQL] Case insensitive equality operator
Date
Msg-id F10BB1FAF801D111829B0060971D839F5C5E5C@cpsmail
Whole thread Raw
List pgsql-sql

> -----Original Message-----
> I'm looking for a case insensitive equality operator (something like
> ~~*). There are of course regular expression matches but I am
> reluctent to use them because I need to preprocess my string before
> using it (putting it between a ^ and a $, escaping special
> characters)
> and because I'm afraid that the use of regular expressions will be
> more resource demanding than a simple equality.
>
> Any ideas ?
>
> Cheers

Why don't you just use the upper or lower functions.
i.e. SELECT * from t1 WHERE UPPER(a)= 'BLAH';
You could even use a functional index on a
CREATE INDEX upper_a ON t1 (UPPER(a) text_ops);
    -DEJ

pgsql-sql by date:

Previous
From: Christophe Labouisse
Date:
Subject: Case insensitive equality operator
Next
From: "Nick Massaro"
Date:
Subject: force indexed search?