ON COMMIT actions and inheritance
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael.paquier@gmail.com>
Date: 2018-11-05T05:37:05Z
Lists: pgsql-hackers
Attachments
- 0001-Check-relation-still-exists-before-applying-ON-COMMI.patch (text/plain) patch 0001
Hi, Michael pointed out a problem with specifying different ON COMMIT actions on a temporary inheritance parent and its children: https://www.postgresql.org/message-id/20181102051804.GV1727%40paquier.xyz The problem is that when PreCommit_on_commit_actions() executes an ON COMMIT DROP action on the parent, it will drop its children as well. It doesn't however remove the children's own actions, especially ON COMMIT DELETE ROWS, from the list and when it gets around to executing them, the children are already gone. That causes the heap_open in heap_truncate to fail with an error like this: ERROR: XX000: could not open relation with OID 16420 LOCATION: relation_open, heapam.c:1138 One way to fix that is to remove the tables that no longer exist from the list that's passed to heap_truncate(), which the attached patch implements. Thanks, Amit
Commits
-
Fix dependency handling of partitions and inheritance for ON COMMIT
- 52ea6a8209d6 10.7 landed
- 84b4a0cf6619 11.2 landed
- 319a8101804f 12.0 landed