Re: Unique index VS unique constraint - Mailing list pgsql-sql

From David Johnston
Subject Re: Unique index VS unique constraint
Date
Msg-id 1380944523319-5773434.post@n5.nabble.com
Whole thread Raw
In response to Re: Unique index VS unique constraint  (Steve Grey <steven.c.r.grey@gmail.com>)
List 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 by date:

Previous
From: Steve Grey
Date:
Subject: Re: Unique index VS unique constraint
Next
From: JORGE MALDONADO
Date:
Subject: Re: Unique index VS unique constraint