My need is related to Postgresql ON DELETE RESTRICT/NO ACTION : I'd
want a sql exception as soon as a parent having any existing child is
deleted. I don't want cascade delete on children, just the parent but
only if it has no child.

I've remarked that SA (0.4) first SET NULL all FKs in child table, and
second delete the parent. Doing this in that order, the PG rule is not
called and the parent is deleted even if there are children (now
orphaned)!!!

The only solution I have found is to define the FK as NOT NULL.
It would be handy to be able to let this PG rule be fired.
Perhaps with an option cascade=delete-donothing on the child relation.

jp


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to