Re: Constraint not shown on \d ? - Mailing list pgsql-hackers

From Gaetano Mendola
Subject Re: Constraint not shown on \d ?
Date
Msg-id 409CDDC2.9090806@bigfoot.com
Whole thread Raw
In response to Re: Constraint not shown on \d ?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne wrote:

>> CREATE UNIQUE INDEX "activation_code_code_key" ON 
>> "public"."activation_code"
>> USING btree ("code", "id_code_pool");
>>
>> or
>>
>> ALTER TABLE activation_code ADD UNIQUE ( code, id_code_pool );
>>
>> with \d command there is no difference but is different because the 
>> first command
>> create an index deleteable with a "drop index".
> 
> 
> Yes, you're right.  Basically the only difference is that the latter 
> will make it a "constraint" that can only be dropped with DROP CONSTRAINT.

but at the end why choose one ot other one, and basic all why

drop index idx_my_index cascade;

doesn't drop the constraint too?



Regards
Gaetano Mendola





pgsql-hackers by date:

Previous
From: Gaetano Mendola
Date:
Subject: email built in type
Next
From: Tom Lane
Date:
Subject: Re: email built in type