From: | Dmitriy Igrishin <dmitigr(at)gmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Unique index and unique constraint |
Date: | 2013-07-27 07:13:15 |
Message-ID: | CAAfz9KPaZ8RQBaY8W1kBPxk6rA-BLCRAtk4mXc1kW5J4O=EtwQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
2013/7/27 Alvaro Herrera <alvherre(at)2ndquadrant(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | F Bax | 2013-08-03 13:26:31 | Presenting data in 5 Rows & 5 Cols for 25 specific values |
Previous Message | Sergey Konoplev | 2013-07-27 01:56:04 | Re: Unique index and unique constraint |