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: 200209250953.17875.dsilver@urchin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
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?

Thanks
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Doug Silver
Network Manager
Urchin Software Corp. http://www.urchin.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Responses

Browse pgsql-novice by date

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