Обсуждение: ON DELETE Behavior after the fact

Поиск
Список
Период
Сортировка

ON DELETE Behavior after the fact

От
John Pagakis
Дата:
I have a database in production that requires some ON DELETE behavior.  Is
there a way to use ALTER TABLE to define ON DELETE behavior for the foreign
keys, or will I have to write triggers at this point?
_______________________________________
John Pagakis
DevelopOnline.com



Re: ON DELETE Behavior after the fact

От
Stephan Szabo
Дата:
On Fri, 27 Apr 2001, John Pagakis wrote:

> I have a database in production that requires some ON DELETE behavior.  Is
> there a way to use ALTER TABLE to define ON DELETE behavior for the foreign
> keys, or will I have to write triggers at this point?

The easiest thing is probably to drop the triggers for the foreign key
constraint you want to change, and re-add the constraint using ALTER
TABLE specifying the on delete behavior.



Re: ON DELETE Behavior after the fact

От
jdassen@cistron.nl (J.H.M. Dassen (Ray))
Дата:
John Pagakis <John.Pagakis@DevelopOnline.com> wrote:
>I have a database in production that requires some ON DELETE behavior.  Is
>there a way to use ALTER TABLE to define ON DELETE behavior for the foreign
>keys, or will I have to write triggers at this point?

Have you looked at
http://techdocs.postgresql.org/techdocs/hackingreferentialintegrity.html ?

HTH,
Ray
--
USDoJ/Judge Jackson: "Microsoft has performed an illegal operation and will
be shut down."
    James Turinsky in alt.sysadmin.recovery