alter table ad primary key

From: Christoph Dalitz <christoph(dot)dalitz(at)hs-niederrhein(dot)de>
To: PG Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: alter table ad primary key
Date: 2002-08-23 15:08:04
Message-ID: 20020823170804.242b85de.christoph.dalitz@hs-niederrhein.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

trying "alter table buecher add primary key (isbn);"
gives the error "ALTER TABLE / ADD CONSTRAINT is not implemented"
with PG 7.1.

Does anybody know whether this works with a newer PG version?

Did someone already implement a workaround in form of a stored
procedure that does the following:
- copy the table entirely to a temporary table
- remember all indices, constraints, rules and triggers on the old table
(is that possible at all?)
- drop the old table
- recreate the table with a primary key
- copy the temp table bakc
- drop the temp table
?

Thanks,

Christoph Dalitz

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-08-23 15:22:33 Re: How to retrieve a comment/description from a table
Previous Message Neil Conway 2002-08-23 15:05:51 Re: trigger fired on changes in specific column