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

From Dmitriy Igrishin
Subject Re: Unique index and unique constraint
Date
Msg-id CAAfz9KPaZ8RQBaY8W1kBPxk6rA-BLCRAtk4mXc1kW5J4O=EtwQ@mail.gmail.com
Whole thread Raw
In response to Re: Unique index and unique constraint  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-sql



2013/7/27 Alvaro Herrera <alvherre@2ndquadrant.com>
PostgreSQL implements unique constraints by way of unique indexes (and
it's likely that all RDBMSs do likewise).  Also, the syntax to declare
unique indexes allows for more features than the unique constraints
syntax.  For example, you can have a unique index that covers only
portion of the table, based on a WHERE condition (a partial unique
index).  You can't do this with a constraint.
Note, partial uniqueness can be achieved by using EXCLUDE contraints also.

--
// Dmitriy.

pgsql-sql by date:

Previous
From: Sergey Konoplev
Date:
Subject: Re: Unique index and unique constraint
Next
From: F Bax
Date:
Subject: Presenting data in 5 Rows & 5 Cols for 25 specific values