Re: [HACKERS] Useless code in ExecInitModifyTable

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: [HACKERS] Useless code in ExecInitModifyTable
Дата
Msg-id b503eefe-a905-4e76-8505-c8ce30230945@lab.ntt.co.jp
обсуждение исходный текст
Ответ на [HACKERS] Useless code in ExecInitModifyTable  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Ответы Re: [HACKERS] Useless code in ExecInitModifyTable  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [HACKERS] Useless code in ExecInitModifyTable  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Re: [HACKERS] Useless code in ExecInitModifyTable  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
Fujita-san,

On 2017/06/21 16:59, Etsuro Fujita wrote:
> Commit d3cc37f1d801a6b5cad9bf179274a8d767f1ee50 added this to
> ExecInitModifyTable:
> 
> +   /* The root table RT index is at the head of the partitioned_rels list */
> +   if (node->partitioned_rels)
> +   {
> +       Index   root_rti;
> +       Oid     root_oid;
> +
> +       root_rti = linitial_int(node->partitioned_rels);
> +       root_oid = getrelid(root_rti, estate->es_range_table);
> +       rel = heap_open(root_oid, NoLock);  /* locked by InitPlan */
> +   }
> 
> but I noticed that that function doesn't use the relation descriptor at
> all.  Since partitioned_rels is given in case of an UPDATE/DELETE on a
> partitioned table, the relation is opened in that case, but the relation
> descriptor isn't referenced at all in initializing WITH CHECK OPTION
> constraints and/or RETURNING projections.  (The mtstate->resultRelinfo
> array is referenced in those initialization, instead.)  So, I'd like to
> propose to remove this from that function.  Attached is a patch for that.

Thanks for cleaning that up.  I cannot see any problem in applying the patch.

Regards,
Amit




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: [HACKERS] Comment typo in execMain.c
Следующее
От: Amit Langote
Дата:
Сообщение: Re: [HACKERS] UPDATE of partition key