Re: Unique index VS unique constraint

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Unique index VS unique constraint
Дата
Msg-id 1380944523319-5773434.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Unique index VS unique constraint  (Steve Grey <steven.c.r.grey@gmail.com>)
Список pgsql-sql
Steve Grey-2 wrote
> Unique indexes can be partial, i.e. defined with a where clause (that must
> be included in a query so that PostgreSQL knows to use that index) whereas
> unique constraints cannot.

This implies there can be data in the table but not in the index and thus
said index is not part of the model.

This strikes me, though, as a shortcoming of the declarative constraint
implementation since such behavior should not modeled via indexes even if
that is how they are implemented.  The where clause limitation on
constraints is arbitrary though adding it just for this would not pass a
cost-benefit analysis.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Unique-index-VS-unique-constraint-tp5773386p5773434.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



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

Предыдущее
От: Steve Grey
Дата:
Сообщение: Re: Unique index VS unique constraint
Следующее
От: JORGE MALDONADO
Дата:
Сообщение: Re: Unique index VS unique constraint