Adding Foreign Key Constraint To Existing Table

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Adding Foreign Key Constraint To Existing Table
Date: 2011-07-01 21:00:38
Message-ID: alpine.LNX.2.00.1107011357390.31349@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've examined the 9.0 manual page on alter table without seeing how to add
a foreign key constraint to a column.

I needed to make changes on a couple of existing tables which could be
accomplished only by dropping the foreign key constraint. That, and changing
the table structure, column names, and column types were successful. But, I
am not seeing the proper syntax to add a foreign key constraint back to the
two affected tables.

Pointer please.

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2011-07-01 21:10:04 Re: Adding Foreign Key Constraint To Existing Table
Previous Message Guillaume Lelarge 2011-07-01 16:42:49 Re: pg_upgrade does not translate tablespace location to new cluster