Re: How can I delete a primary or foreign key? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: How can I delete a primary or foreign key?
Date
Msg-id 20040220074130.A82937@megazone.bigpanda.com
Whole thread Raw
In response to How can I delete a primary or foreign key?  (Tibor <tiborh@mail.datanet.hu>)
Responses Re: How can I delete a primary or foreign key?  (tibor <tiborh@mail.datanet.hu>)
List pgsql-general
On Fri, 20 Feb 2004, Tibor wrote:

> I am using PostgreSQL 7.4.1 (only through psql)
> I know, that the command
>
> ALTER TABLE OFFICES
>     DROP PRIMARY KEY (CITY);
>
> and its foreign key equivalent:
>
> ALTER TABLE SALESREPS
>     DROP CONSTRAINT
> FOREIGN KEY (REP_OFFICE)
>     REFERENCES OFFICES;
>
> don't work in PostgreSQL because they are not implemented. However, isn't
> there another way of removing them?

That's not the correct syntax for ALTER TABLE ... DROP CONSTRAINT.

ALTER TABLE tablename DROP CONSTRAINT constraint_name [RESTRICT | CASCADE]


pgsql-general by date:

Previous
From: "Gellert, Andre"
Date:
Subject: PHP + Postgres: More than 1000 postmasters produce 70.000 context switches
Next
From: "scott.marlowe"
Date:
Subject: Re: How can I delete a primary or foreign key?