adding column constraint - Mailing list pgsql-general

From Timothy H. Keitt
Subject adding column constraint
Date
Msg-id 397F42AD.7799AE81@nceas.ucsb.edu
Whole thread Raw
Responses Re: adding column constraint  (mikeo <mikeo@spectrumtelecorp.com>)
List pgsql-general
Can someone give an example of how to add a foreign key constraint to an
existing table?  (Pgsql and the man page differ and neither syntax seems
to work.)

I've tried:

alter table mytable add constraint col foreign key references reftable

with no luck.

Tim

--
Timothy H. Keitt
National Center for Ecological Analysis and Synthesis
735 State Street, Suite 300, Santa Barbara, CA 93101
Phone: 805-892-2519, FAX: 805-892-2510
http://www.nceas.ucsb.edu/~keitt/

pgsql-general by date:

Previous
From: Ulf Mehlig
Date:
Subject: "alter table rename" does not update constraints
Next
From: Ernie
Date:
Subject: performance help