Re: Constraint not shown on \d ?

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: Constraint not shown on \d ?
Дата
Msg-id 409CDDC2.9090806@bigfoot.com
обсуждение исходный текст
Ответ на Re: Constraint not shown on \d ?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список 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 по дате отправления:

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: email built in type
Следующее
От: Tom Lane
Дата:
Сообщение: Re: email built in type