| От | Tom Lane |
|---|---|
| Тема | Re: unique index on function and column |
| Дата | |
| Msg-id | 9830.1025030116@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | unique index on function and column (Bruno Wolff III <bruno@wolff.to>) |
| Ответы |
Re: unique index on function and column
|
| Список | pgsql-sql |
Bruno Wolff III <bruno@wolff.to> writes:
> Is there a simple way to do something like the following:
> create unique index inst_u_app on inst (lower(host), psport);
> It looks like you can have an index on several columns, but not
> several functions.
The standard answer is to make a custom function that accepts all the
columns and produces a result you can index.
This is sort of an academic "an existence proof is good enough" answer,
but it *is* possible to get the results you want. Making it more
convenient hasn't risen to the top of anyone's to-do list.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера