Re: Constraint not shown on \d ?

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Subject: Re: Constraint not shown on \d ?
Date: 2004-05-08 13:16:50
Message-ID: 409CDDC2.9090806@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-05-08 13:35:01 Re: email built in type
Previous Message Gaetano Mendola 2004-05-08 12:14:10 email built in type