Forum OpenACS Q&A: Adding ON DELETE CASCADE

Collapse
Posted by Roberto Mello on
Anyone know of a way to add ON DELETE CASCADE to a table on PG? Or do
I have to drop the table and recreate it? I am working on the upgrade
script and several of these were added to the portals data model.

Thanks.

Collapse
Posted by Don Baccus on
alter table foo add constraint foo_fk foreign key (foo_key) references  referenced_table;

works but you've probably already got a foreign key on that column without the on delete cascade, right?

You can't drop constraints but I think you can maybe drop the triggers  by hand???

People may be SOL on this one, though.