Unique constraint or index, case insensitive, on multiple fields

Поиск
Список
Период
Сортировка
От MargaretGillon@chromalloy.com
Тема Unique constraint or index, case insensitive, on multiple fields
Дата
Msg-id OF9DA2587D.BEB1D4A7-ON88257148.0061D884-88257148.00631CD8@CHROMALLOY.COM
обсуждение исходный текст
Ответы Re: Unique constraint or index, case insensitive, on multiple fields  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

I am on version 7.3. I have been able to build a case insensitive index to keep the refullname column unique with the following:

CREATE UNIQUE INDEX  resource_refullname
 ON resource  USING btree   (upper(refullname) text_ops);

However I have a table where I want to allow  a duplicate refullname if the redtid field (int4) is different. When I try building an index using the command below I get an error. I still need the refullname to be case insensitive.

CREATE UNIQUE INDEX resource_refullname
 ON resource  USING btree  (redtid, (upper(refullname) text_ops));

The index will work with  (redtid, refullname) but then the index is not case insensitive on refullname.

Thanks,
Margaret Gillon, IS Dept., Chromalloy Los Angeles, ext. 297

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

Предыдущее
От: lmyho
Дата:
Сообщение: Debian package for freeradius_postgresql module
Следующее
От: Guy Fraser
Дата:
Сообщение: Re: Backup method