Re: Unique Index

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Unique Index
Дата
Msg-id 87hdlcc72l.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Unique Index  ("Frank D. Engel, Jr." <fde101@fjrhome.net>)
Список pgsql-general
"Frank D. Engel, Jr." <fde101@fjrhome.net> writes:

> I'm sure this won't work for some reason, but something similar might; why not
> create a unique index on a constant where all three are null; something along
> these lines (in addition to the others):
>
> CREATE UNIQUE INDEX foo_trio_index ON foo (1) WHERE c IS NULL AND a IS NULL and
> b IS NULL;
>

Huh. Hadn't thought of creating an index on a constant. It works if you put an
extra set of parentheses in:

CREATE UNIQUE INDEX foo_abc_index ON foo ((1)) WHERE ...


--
greg

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

Предыдущее
От: Jackson Pauls
Дата:
Сообщение: Re: connecting with a 8.0.0 client with ssl
Следующее
От: troyston campano
Дата:
Сообщение: Postgresql Security Pen Test