Re: Unique Index vs. Unique Constraint

From: "Thomas LeBlanc" <thomasatiem(at)hotmail(dot)com>
To: gearond(at)fireserve(dot)net, pgsql-general(at)postgresql(dot)org
Cc: scott(dot)marlowe(at)ihs(dot)com, mkoi-pg(at)aon(dot)at
Subject: Re: Unique Index vs. Unique Constraint
Date: 2003-10-13 13:39:26
Message-ID: Law9-F66QmNiImcbvou0000ec1d@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Then what is the difference in these two statements?

alter table Table1
add constraint Table1_UC1
unique (Field1, Field2)

and

create unique index Table1_Field1Field2
on Table1 (Field1, Field2)

Thanks,
Thomas LeBlanc

>From: Dennis Gearon <gearond(at)fireserve(dot)net>
>To: Thomas LeBlanc <thomasatiem(at)hotmail(dot)com>
>Subject: Re: [GENERAL] Unique Index vs. Unique Constraint
>Date: Fri, 10 Oct 2003 15:16:12 -0700
>
>Uniquely so!
>
>Thomas LeBlanc wrote:
>
>>Does a Unique Constraint build a unique index?
>>
>>What is the difference?
>>
>>Thanks,
>>Thomas LeBlanc
>>
>>_________________________________________________________________
>>Get a FREE computer virus scan online from McAfee.
>>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 6: Have you searched our list archives?
>>
>> http://archives.postgresql.org
>>
>

_________________________________________________________________
Help protect your PC. Get a FREE computer virus scan online from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

Browse pgsql-general by date

  From Date Subject
Next Message Harry Broomhall 2003-10-13 13:47:20 Performance weirdness with/without vacuum analyze
Previous Message Robert Partyka 2003-10-13 12:55:56 Question