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

Setting primary key on existing table

From: Doug Silver <dsilver(at)urchin(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Setting primary key on existing table
Date: 2002-09-25 16:52:55
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
I would like to be able to redefine a field in a table to be a foreign 
reference -- however this field was initially defined as just "serial" and 
not "serial primary key".  I tried to add that constraint to the table, but 
it didn't work.  Do I need to copy out the table, drop it, and recreate it 
with this constraint in order for it to be a foreign key?

Doug Silver
Network Manager
Urchin Software Corp.


pgsql-novice by date

Next:From: Tom LaneDate: 2002-09-25 17:21:20
Subject: Re: Setting primary key on existing table
Previous:From: Tom LaneDate: 2002-09-25 16:39:38
Subject: Re: pgcrypto?

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