Re: foreign key constraints and alter table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John DeSoi <jdesoi(at)planetc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: foreign key constraints and alter table
Date: 2003-02-18 01:54:41
Message-ID: 17091.1045533281@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John DeSoi <jdesoi(at)planetc(dot)com> writes:
> If I'm reading the docs correctly, I should be able to write:
> ALTER TABLE mytable ADD ptr INT4 REFERENCES othertable ON DELETE SET NULL
> but when I look in pg_constraint table (pg 7.3) I don't see any kind
> of foreign key constraint.

ALTER TABLE ADD COLUMN is dropping foreign key clauses in 7.3-7.3.2 :-(
See patch posted about four days ago. In the meantime, add the foreign
key separately.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2003-02-18 02:20:29 Re: Index not used with IS NULL
Previous Message Greg Stark 2003-02-18 01:48:50 Re: Index not used with IS NULL