Foreign Key Option

Started by Erwin Ambroschalmost 24 years ago2 messagesgeneral
Jump to latest
#1Erwin Ambrosch
ambre@ebutec.com

Hi all,

can I change the foreign key optins (e.g. ON UPDATE, ON DELETE) after the
table has been created. And if yea, does the change also affect already
inserted rows.

Thaks Erwin

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Erwin Ambrosch (#1)
Re: Foreign Key Option

On Mon, 6 May 2002, Erwin Ambrosch wrote:

can I change the foreign key optins (e.g. ON UPDATE, ON DELETE) after the
table has been created. And if yea, does the change also affect already
inserted rows.

You could drop the triggers and then recreate the constraint
with alter table. That won't affect past changes (for example rows that
were deleted by a on delete cascade wouldn't suddenly become visible with
nulls if it were changed to on delete set null).