Re: Cascading deletes with rules in 7.0.3: why doesn't this work? - Mailing list pgsql-general

From Tom Lane
Subject Re: Cascading deletes with rules in 7.0.3: why doesn't this work?
Date
Msg-id 7776.986222247@sss.pgh.pa.us
Whole thread Raw
In response to Cascading deletes with rules in 7.0.3: why doesn't this work?  (Jeremy Radlow <jtr@sourcerers.com>)
Responses Re: Cascading deletes with rules in 7.0.3: why doesn't this work?
List pgsql-general
Jeremy Radlow <jtr@sourcerers.com> writes:
> In the following example, I'm trying to log all deletions from any of three
> tables.  The only information I'm interested in recording is the index from
> table A which the deleted row referenced.

This seems to be a bug.  I haven't finished tracking it down yet, but
when you delete from A or B, the ON DELETE CASCADE trigger is going to
try to delete from B and/or C as well --- so the trigger will end up
invoking the ON DELETE rules for those tables and hence trying to insert
into delete_log.  This chain of events does indeed happen as expected,
but it seems that when we get down to the INSERT, the value being passed
for old.ax has become NULL.  Something rotten in parameter passing,
apparently.  (Deletion from C works, because that does not trigger any
cascaded deletes.)

Thanks for the report!  I'll try to fix it for 7.1...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: function to operate on same fields, different records?
Next
From: Alexander Lohse
Date:
Subject: bitwise again