Re: inserts into partitioned table may cause crash

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: inserts into partitioned table may cause crash
Date: 2018-03-14 10:26:52
Message-ID: CAEepm=2DSkXuuR9XWSngN3A2vBg33F+-B5GqyYp_t2xdaaSXhg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 14, 2018 at 9:25 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-03-14 11:07:46 Comment fixes in create_grouping_paths() add_paths_to_append_rel()
Previous Message Amit Langote 2018-03-14 10:06:53 Re: [HACKERS] path toward faster partition pruning