Functional Index Question

Поиск
Список
Период
Сортировка
От James B. Byrne
Тема Functional Index Question
Дата
Msg-id 53676.216.185.71.22.1205336772.squirrel@webmail.harte-lyne.ca
обсуждение исходный текст
Ответы Re: Functional Index Question  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
I am considering the utility value of creating a functional index on a name
field.  To minimize the number of invalid searches caused by spacing errors
and mis-matched lettercase I am contemplating doing something like this:

CREATE UNIQUE INDEX idxUF_table_column ON table
  (lower(trim(both ' ' from(regexp_replace(<column>, /( ){2,}/g," " )))))

What I intend this to do is to squeeze out excess whitespace, strip off
leading and trailing blanks, and then force the whole thing to lowercase.

Is this idea worth pursuing and, if it is, is my regexp correct for the
purpose intended?

Not a regexp guy.

--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: PostgreSQL won't start
Следующее
От: "Lee Hachadoorian"
Дата:
Сообщение: Re: PostgreSQL won't start