Re: Unique constraint or index, case insensitive, on multiple fields
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Unique constraint or index, case insensitive, on multiple fields |
| Дата | |
| Msg-id | 26214.1144348437@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Unique constraint or index, case insensitive, on multiple fields (MargaretGillon@chromalloy.com) |
| Ответы |
Re: Unique constraint or index, case insensitive, on multiple
|
| Список | pgsql-general |
MargaretGillon@chromalloy.com writes:
> CREATE UNIQUE INDEX resource_refullname
> ON resource USING btree (redtid, (upper(refullname) text_ops));
You need something newer than PG 7.3 to do that. 7.3 can't handle
functional indexes with more than one column. There are many other good
reasons to upgrade anyway.
BTW the correct syntax would be
CREATE UNIQUE INDEX resource_refullname
ON resource USING btree (redtid, (upper(refullname)) text_ops);
If you're going to put an opclass name, it goes outside the parens.
(The only reason the parens are required at all is to separate the
expression from the opclass name ...)
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера