How can I delete a primary or foreign key?

From: Tibor <tiborh(at)mail(dot)datanet(dot)hu>
To: PostreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: How can I delete a primary or foreign key?
Date: 2004-02-20 15:26:19
Message-ID: 200402201626.19402@newid
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?
I also tried to drop the index associated with the primary key, but it is not
permitted.

Anyone with any idea?
--
Tibor

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gellert, Andre 2004-02-20 15:32:55 PHP + Postgres: More than 1000 postmasters produce 70.000 context switches
Previous Message Tom Lane 2004-02-20 14:20:24 Re: Slow queries in PL/PGSQL function