adding column constraint

From: "Timothy H(dot) Keitt" <keitt(at)nceas(dot)ucsb(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: adding column constraint
Date: 2000-07-26 19:57:33
Message-ID: 397F42AD.7799AE81@nceas.ucsb.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2000-07-26 20:38:54 Re: "alter table rename" does not update constraints
Previous Message Jan Wieck 2000-07-26 19:51:34 Re: Re: [GENERAL] Is Pg 7.0.x's Locking Mechanism BROKEN?