Re: inserts into partitioned table may cause crash - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: inserts into partitioned table may cause crash
Date
Msg-id CAEepm=2DSkXuuR9XWSngN3A2vBg33F+-B5GqyYp_t2xdaaSXhg@mail.gmail.com
Whole thread Raw
In response to Re: inserts into partitioned table may cause crash  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
On Wed, Mar 14, 2018 at 9:25 PM, Etsuro Fujita
<fujita.etsuro@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


pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Ashutosh Bapat
Date:
Subject: Comment fixes in create_grouping_paths() add_paths_to_append_rel()