Re: unique index with bool

Поиск
Список
Период
Сортировка
От Stuart Bishop
Тема Re: unique index with bool
Дата
Msg-id 4293FE8A.8050803@stuartbishop.net
обсуждение исходный текст
Ответ на unique index with bool  (tmpmac@mac.com)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 foo ON table(param1, (NULLIF(param2, false)))



- --
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCk/6KAfqZj7rGN0oRAvZ+AJwLWDd8FQe5nBjFDv7ariZ8o8rwLgCfRTdy
BP2yMApbjMDdpDqetUQnX3A=
=k5zA
-----END PGP SIGNATURE-----

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL release schedule
Следующее
От: Neil Conway
Дата:
Сообщение: Re: getting lock information