Search Postgresql Archives

Re: Unique constraints and indexes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steve Rogerson <steve.pg@xxxxxxxxxxxxxxxxx> writes:
> On 05/01/16 19:47, Tom Lane wrote:
>> That's operating as designed.  A unique constraint needs an index,
>> but not vice versa.

> I can see that might be plausible , hence the question but as a "unique index"
> imposes as constraint they seem equivalent. What's the functional difference
> between the two situations?

There is none so far as uniqueness-enforcement is concerned, because the
index is the same either way, and that's what enforces it.

The main reason we don't automatically create a constraint for every
unique index is that not all index declarations can be represented
by SQL-standard constraints.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux