A foreign key is a kind of constraint. Section 5.5.3 has example syntax to add constraints, including a foreign key
constraint.
In alter table the part "ADD table_constraint" is what you want to follow (it leads you to the create table page for
theformal syntax to use).
David J.
On Jul 1, 2011, at 17:00, Rich Shepard <rshepard@appl-ecosys.com> wrote:
> 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
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general