Skip site navigation (1) Skip section navigation (2)

converting unique index into primary key

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: converting unique index into primary key
Date: 2004-12-22 23:57:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
I need to convert an existing unique index on a very heavily inserted table 
into a primary key.  Alter table works, but locks the table for too long.  
As a hack, can I just set pg_index.indisprimary = 't' and 
pg_constraint.contype = 'p' for the appropriate row in each?  This is for 
7.4.6 and 8.0beta3...




pgsql-general by date

Next:From: GeoffreyDate: 2004-12-23 00:55:05
Subject: Re: What HW / OS is recommeded
Previous:From: Klint GoreDate: 2004-12-22 23:09:48
Subject: duplicate msgs when delivery through

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group