Re: How can I Delete/Alter Unique Constraint

From: Bhuvan A <bhuvansql(at)linuxfreemail(dot)com>
To: shreedhar <shreedhar(at)lucidindia(dot)net>
Cc: Postgres <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How can I Delete/Alter Unique Constraint
Date: 2002-08-29 09:57:31
Message-ID: Pine.LNX.4.44.0208291522380.2291-100000@Bhuvan.bksys.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On Thu, 29 Aug 2002, shreedhar wrote:

> Hi All,
>
> How can I delete Unique Constraint/ Alter Unique Constraint.
>
> example
>
> tblStudent
> =======
> stdid
> stdname
> classid
>
> previously I gave stdname as UNIQUE
> but I need to alter it as UNIQUE (stdname,classid)
>

It is this way. Try
$ drop index stdname_index_name;
DROP
$ create unique index stdname_classid_index_name on tblStudent (stdname,
class_id);
CREATE

If you are unaware of stdname_index_name try
$ \d pg_indexes

for details.

regards,
bhuvaneswaran

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mark McEahern 2002-08-29 12:50:41 Re: programatically obtaining table layout
Previous Message shreedhar 2002-08-29 07:42:00 How can I Delete/Alter Unique Constraint