On Wed, Mar 14, 2018 at 9:25 PM, Etsuro Fujita <fujita.ets...@lab.ntt.co.jp> wrote: > (2018/03/14 14:54), Amit Langote wrote: >> On 2018/03/06 21:26, Etsuro Fujita wrote: >>> if (mtstate->mt_transition_capture != NULL) >>> { >>> if (resultRelInfo->ri_TrigDesc&& >>> (resultRelInfo->ri_TrigDesc->trig_insert_before_row || >>> resultRelInfo->ri_TrigDesc->trig_insert_instead_row)) >>> { >>> /* >>> * If there are any BEFORE or INSTEAD triggers on the >>> partition, >>> * we'll have to be ready to convert their result back to >>> * tuplestore format. >>> */ >>> mtstate->mt_transition_capture->tcs_original_insert_tuple = >> >> NULL; >>> >>> mtstate->mt_transition_capture->tcs_map = >>> TupConvMapForLeaf(proute, rootRelInfo, leaf_part_index); >>> } >>> >>> Do we need to consider INSTEAD triggers here? The partition is either a >>> plain table or a foreign table, so I don't think it can have those >>> triggers. Am I missing something? >> >> I think you're right. We don't need to consider INSTEAD OF triggers here >> if we know we're dealing with a partition which cannot have those. >> >> Just to make sure, a word from Thomas would help. > > +1
Agreed. INSTEAD OF triggers can only be created on views, and views can't appear in a partition hierarchy, so the comment is misleading and the test is redundant. Thanks for picking this up. -- Thomas Munro http://www.enterprisedb.com