Re: unique index with bool

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: unique index with bool
Дата
Msg-id 428CAF26.9060702@magproductions.nl
обсуждение исходный текст
Ответ на unique index with bool  (tmpmac@mac.com)
Список pgsql-general
tmpmac@mac.com wrote:
> CREATE UNIQUE INDEX name on table(param1,param2);
>
> How to create such unique index when param2 is bool type, and this param2 should be accepted only in case of true ?
>
> I tried: CREATE UNIQUE INDEX name on table(param1,(param2 = 'true'));
> but it's not working.

CREATE UNIQUE INDEX name ON table(param1, param2) WHERE param2 = true;

Regards,

--
Alban Hertroys
MAG Productions

T: +31(0)53 4346874
F: +31(0)53 4346876
E: alban@magproductions.nl
W: http://www.magproductions.nl

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Count and Results together
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Postgres in government