Re: BUG #14808: V10-beta4, backend abort
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: phb07@apra.asso.fr, Thomas Munro <thomas.munro@enterprisedb.com>,
Andrew Gierth <rhodiumtoad@postgresql.org>,
PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2017-09-09T17:08:50Z
Lists: pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes: > Crash is confirmed here so I am adding an open item. I have not dug > into the issue seriously, but at short glance we have a code path > trying to access something that has already been free'd: I think this can be blamed on commit c46c0e52. What is happening is that the AFTER triggers are queuing more triggers, which have TransitionCaptureStates associated, but ExecEndModifyTable thinks it can DestroyTransitionCaptureState unconditionally. When the subsidiary triggers eventually get executed, their ats_transition_capture pointers are pointing at garbage. My first instinct is to get rid of DestroyTransitionCaptureState altogether, on the grounds that the TransitionCaptureState will go away at transaction cleanup and we can't really get rid of it any sooner than that. The other question that seems pretty relevant is why the subsidiary triggers, which are the constraint triggers associated with the tables' foreign keys, are getting queued with TransitionCaptureState pointers in the first place. This seems horridly expensive and unnecessary. It also directly contradicts the claim in MakeTransitionCaptureState that constraint triggers cannot have transition tables. regards, tom lane
Commits
-
Fix SQL-spec incompatibilities in new transition table feature.
- 54d4d0ff6cd4 10.0 landed
- 0f79440fb0b4 11.0 landed
-
Quick-hack fix for foreign key cascade vs triggers with transition tables.
- 5c11717185bc 10.0 landed
- 3c435952176a 11.0 landed
-
Fix transition tables for ON CONFLICT.
- 8c55244ae379 10.0 cited
-
Fix transition tables for wCTEs.
- c46c0e5202e8 10.0 cited
-
Repair problems occurring when multiple RI updates have to be done to the same
- 9cb84097623e 8.3.0 cited