agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: David Johnston <polobo@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: Unique index VS unique constraint
Date: Fri, 4 Oct 2013 20:42:03 -0700 (PDT)
Message-ID: <1380944523319-5773434.post@n5.nabble.com> (raw)
In-Reply-To: <CAO8h7BJMX5V1TqzScTx2Nr1jH5iUFG8A071y-g1b_kdzpu9PDw@mail.gmail.com>
References: <CAAY=A78oJ--0aPm4E6ASJ32Z3UHk0nOqHQ_SvrtjOmq7i=UKDQ@mail.gmail.com>
<1380926286139-5773427.post@n5.nabble.com>
<CAO8h7BJMX5V1TqzScTx2Nr1jH5iUFG8A071y-g1b_kdzpu9PDw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (9+ messages) latest in thread
Message-ID: <1380944523319-5773434.post@n5.nabble.com>
Permalink: ../1380944523319-5773434.post@n5.nabble.com/
Also on: postgresql.org/message-id/1380944523319-5773434.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: polobo@yahoo.com
Subject: Re: Unique index VS unique constraint
In-Reply-To: <1380944523319-5773434.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox