Re: Way to create unique constraint in Postgres even with null columns

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Way to create unique constraint in Postgres even with null columns
Дата
Msg-id jaufbt$nga$1@dough.gmane.org
обсуждение исходный текст
Ответ на Re: Way to create unique constraint in Postgres even with null columns  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-general
David Johnston wrote on 27.11.2011 23:18:

> Also, the index example above presumes you want RecipeId to be "Null-able"
> as opposed to MenuId as described in your original post.
>

Well of course that was a typo in my answer, it should have been:

CREATE UNIQUE INDEX Favorites_UniqueFavorite
     ON (UserId, RecipeId)
     WHERE MenuId IS NULL;


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

Предыдущее
От: Mike Christensen
Дата:
Сообщение: Re: Way to create unique constraint in Postgres even with null columns
Следующее
От: David Johnston
Дата:
Сообщение: Re: Way to create unique constraint in Postgres even with null columns