Re: Case sensitive searches - Mailing list pgsql-hackers

From Mario Weilguni
Subject Re: Case sensitive searches
Date
Msg-id 4D618F6493CE064A844A5D496733D667038E78@freedom.icomedias.com
Whole thread Raw
In response to Case sensitive searches  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
List pgsql-hackers
>...
>    if (upper('001234') == lower('001234'))
>        SELECT * FROM table
>        WHERE id = '001234';
>    else
>        SELECT * FROM table
>        WHERE upper(id) = '001234';
>
>Even without the index I guess that would have saved it a lot of work.

I'm no expert, but I can't image this will be easy, because the optimizer
does not know any relation between lower() and upper().
I think an index on upper(id) (create index idxname on table(upper(id)))
should work well.



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org






pgsql-hackers by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Case sensitive searches
Next
From: Hannu Krosing
Date:
Subject: Re: SQL99, CREATE CAST, and initdb