Re: Unique constraints and indexes.

From: Steve Rogerson <steve(dot)pg(at)yewtc(dot)demon(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Unique constraints and indexes.
Date: 2016-01-05 20:02:13
Message-ID: 568C2145.5060709@yewtc.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/01/16 19:47, Tom Lane wrote:
> Steve Rogerson <steve(dot)pg(at)yewtc(dot)demon(dot)co(dot)uk> writes:
>> Is this a bug? I create a "unique" index, directly but it doesn't add a unique
>> constraint. Add a unique constraint and it adds the index and the constraint.
>
> 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?

Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-01-05 20:13:52 Re: Unique constraints and indexes.
Previous Message Tom Lane 2016-01-05 19:47:30 Re: Unique constraints and indexes.