Recreating a primary key

From: Ericson Smith <eric(at)did-it(dot)com>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Recreating a primary key
Date: 2003-02-28 16:47:54
Message-ID: 1046450874.19793.36.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there a way to re-create a primary key?

So I create tables with CREATE TABLE... PRIMARY KEY(col...) syntax.

I later want to drop the primary key and re-create it (performance
considerations, and to not worry about exclusive table locking with a
rebuild index).

The documentation says that primary keys are basically UNIQUE and NOT
NULL keys, but checking with pg_index, I see the "indisprimary" column
is set to true.

Any quick and dirty way to rebuild these indices?

--
Ericson Smith <eric(at)did-it(dot)com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2003-02-28 16:49:33 Re: Locking rows
Previous Message Greg Stark 2003-02-28 16:47:09 Re: index usage (and foreign keys/triggers)