Forum .LRN Q&A: Response to Forums and Notifications deleting threads problem in postgresql

This is a problem in Oracle too. The "on delete cascade" is problematic because it leaves hanging rows in the ACS_OBJECTS table. This query shows how many rows with object_type 'notification' do not have a corresponding row in the NOTIFICATIONS.
SQL> select count(*) from (select n.notification_id from acs_objects o, notifications n where o.object_type = 'notification' and n.notification_id(+) = o.object_id) where notification_id is NULL;