Thread: ON DELETE Behavior after the fact
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
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.
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