Re: Bug?? -- Alter table drop constraint doesn't seem to work on a primary key constraint in 7.2beta2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug?? -- Alter table drop constraint doesn't seem to work on a primary key constraint in 7.2beta2
Date
Msg-id 1855.1005423401@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug?? -- Alter table drop constraint doesn't seem to work on a primary key constraint in 7.2beta2  (Barry Lind <barry@xythos.com>)
Responses Re: Bug?? -- Alter table drop constraint doesn't seem to work on a primary key constraint in 7.2beta2
List pgsql-hackers
Barry Lind <barry@xythos.com> writes:
> I was looking at the 7.2 docs online at developer.postgresql.org.  The 
> only example of 'drop constraint' in the text for the 'alter table' 
> command shows its usage without the RESTRICT/CASCADE option.

Erroneous example fixed.

> But I still can't get it to work for me.  Consider the following test case:

> create table test (col_a integer not null, col_b text);
> alter table test add constraint test_pk primary key (col_a);
> alter table test drop constraint test_pk restrict;

> psql:test.sql:8: ERROR:  ALTER TABLE / DROP CONSTRAINT: test_pk does not 
> exist

Looking at the code, the problem is that DROP CONSTRAINT only works with
CHECK constraints at the moment.  This does seem to be adequately
documented.  Improving the functionality will have to wait for some
future development cycle.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] Bug #513: union all changes char(3) column definition
Next
From: Bruce Momjian
Date:
Subject: Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed