Re: drop constraint primary key

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: marie.tuite@edisonaffiliates.com
Cc: "Pgsql-Sql@Postgresql. Org" <pgsql-sql@postgresql.org>
Date: 2002-10-03T17:09:38Z
Lists: pgsql-sql
"Marie G. Tuite" <marie.tuite@edisonaffiliates.com> writes:
> Running above, am trying to drop the primary key, but get the follwing
> error.
> project=# alter table class_teacher_rlt drop constraint
> class_teacher_rlt_pkey restrict;
> ERROR:  ALTER TABLE / DROP CONSTRAINT: class_teacher_rlt_pkey does not exist

In 7.2 DROP CONSTRAINT only works for CHECK-type constraints; you'll
have to drop the underlying index directly to get rid of a
primary-key-type constraint.

7.3 does allow DROP CONSTRAINT for this.

			regards, tom lane