Re: Constraint not shown on \d ?

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Gaetano Mendola <mendola(at)bigfoot(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Constraint not shown on \d ?
Date: 2004-05-08 12:01:33
Message-ID: 409CCC1D.8070809@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-05-08 12:14:10 email built in type
Previous Message Fabien COELHO 2004-05-08 10:07:31 Re: Aclitem "high level description"