Skip site navigation (1) Skip section navigation (2)

Re: adding column constraint

From: mikeo <mikeo(at)spectrumtelecorp(dot)com>
To: "Timothy H(dot) Keitt" <keitt(at)nceas(dot)ucsb(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: adding column constraint
Date: 2000-07-26 21:05:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
alter table cust add constraint fk_cust_bd_id foreign key (bd_id)
      references bill_dist (bd_id);

At 12:57 PM 7/26/00 -0700, Timothy H. Keitt wrote:
>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.
>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

In response to


pgsql-general by date

Next:From: mikeoDate: 2000-07-26 21:25:53
Subject: drop foreign key
Previous:From: Marc GehlingDate: 2000-07-26 20:52:30
Subject: pg_dump error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group