Re: Unique index VS unique constraint

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Unique index VS unique constraint
Date: 2013-10-05 03:42:03
Message-ID: 1380944523319-5773434.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message JORGE MALDONADO 2013-10-05 22:24:26 Re: Unique index VS unique constraint
Previous Message Steve Grey 2013-10-05 02:20:07 Re: Unique index VS unique constraint