On Fri, Nov 02, 2018 at 02:18:04PM +0900, Michael Paquier wrote: > This case is funky. The parent gets dropped at commit time, but it does > not know that it should drop the child as well per their dependencies. > This actually goes into the internals of performDeletion(), which is > scary to touch on back-branches just for such cases..
A bit more fun with inheritance: =# begin; BEGIN =# create temp table aa_p (a int) on commit drop; CREATE TABLE =# create temp table aa_c (a int) inherits (aa_p) on commit delete rows; NOTICE: 00000: merging column "a" with inherited definition LOCATION: MergeAttributes, tablecmds.c:2339 CREATE TABLE =# insert into aa_p values (1); INSERT 0 1 =# insert into aa_c values (1); INSERT 0 1 =# commit; NOTICE: 00000: drop cascades to table aa_c LOCATION: reportDependentObjects, dependency.c:995 ERROR: XX000: could not open relation with OID 16426 LOCATION: relation_open, heapam.c:1138 Let's treat that as a separate issue, as this happens also with an unpatched build. The only reason why you cannot trigger it with partitions is that ON COMMIT is currently broken for them, so we should fix the reported case first. In consequence, I would tend to commit the patch proposed and take care of the first, except if of course anybody has an objection. -- Michael
signature.asc
Description: PGP signature