Re: Constraint not shown on \d ?
| От | Christopher Kings-Lynne |
|---|---|
| Тема | Re: Constraint not shown on \d ? |
| Дата | |
| Msg-id | 409CCC1D.8070809@familyhealth.com.au обсуждение исходный текст |
| Ответ на | Constraint not shown on \d ? (Gaetano Mendola <mendola@bigfoot.com>) |
| Ответы |
Re: Constraint not shown on \d ?
|
| Список | pgsql-hackers |
> 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.
Also, if you wanted to create a unique non-btree index, partial index or
expressional index, you'd have to use the former syntax
Chris
В списке pgsql-hackers по дате отправления: