Re: Update comments in nodeModifyTable.c

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Update comments in nodeModifyTable.c
Date: 2017-06-15 02:40:29
Message-ID: e4cd5083-9009-c73c-473d-831f19ffec74@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017/06/07 0:30, Robert Haas wrote:
> On Mon, Jun 5, 2017 at 4:45 AM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> While working on [1], I noticed that the comment in ExecModifyTable:
>>
>> * Foreign table updates have a wholerow attribute when the
>> * relation has an AFTER ROW trigger.
>>
>> is not 100% correct because a foreign table has a wholerow attrubute when
>> the relation has an AFTER ROW or BEFORE ROW trigger (see
>> rewriteTargetListUD). So I'd propose s/an AFTER ROW trigger/a row-level
>> trigger/. Attached is a patch for that.
>
> That seems better, but looking at rewriteTargetListUD, it seems that
> the actual rule is that this happens when there is a row-level on
> either UPDATE or DELETE. If there is only a row-level trigger on
> INSERT, then it is not done. Perhaps we should try to include that
> detail in the comment as well.

Agreed, but I think it's better to add that detail to this comment in
ExecInitModifyTable:

* Initialize the junk filter(s) if needed. INSERT queries need a
filter
* if there are any junk attrs in the tlist. UPDATE and DELETE always
* need a filter, since there's always a junk 'ctid' or 'wholerow'
* attribute present --- no need to look first.

I'd also like to propose to update the third sentence in this comment,
since there isn't necessarily a ctid or wholerow in the UPDATE/DELETE
tlist when the result relation is a foreign table.

Attached is an updated version of the patch.

Best regards,
Etsuro Fujita

Attachment Content-Type Size
nodeModifyTable-comment-update-v2.patch text/plain 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2017-06-15 02:53:05 Re: v10beta pg_catalog diagrams
Previous Message Tatsuo Ishii 2017-06-15 02:30:13 Re: type of release note of PG10