Re: Best way to store case-insensitive data? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Best way to store case-insensitive data?
Date
Msg-id AANLkTikIgghfPEv_qMQnZOqVijSk2gggbRz-efabfUgm@mail.gmail.com
Whole thread Raw
In response to Re: Best way to store case-insensitive data?  (Mike Christensen <mike@kitchenpc.com>)
Responses Re: Best way to store case-insensitive data?  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
2010/6/11 Mike Christensen <mike@kitchenpc.com>:
> Yea this is a valid point.  It's very possible my design won't work
> for the long term, and at some point I'll have to store the email name
> exactly as it was entered, and allow the lookup logic to be case
> insensitive with a lowercase index.  However, I think the way I have
> it now should not break any known email server heh.

Instead of mangling data when you store it, mangle it later when you
retrieve it.  with a functional index on the column, you get the
comparison data stored in an index, ready to go.

Performance test the index:

create test_index on table (lower(fieldname));

versus storing the emails in lower case.

pgsql-general by date:

Previous
From: Adrian von Bidder
Date:
Subject: Re: Best way to store case-insensitive data?
Next
From: Scott Marlowe
Date:
Subject: Re: Best way to store case-insensitive data?