Re: [HACKERS] Update comments in nodeModifyTable.c - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: [HACKERS] Update comments in nodeModifyTable.c
Date
Msg-id 24fce2fc-c299-d70d-e1d3-ade7637704c6@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Update comments in nodeModifyTable.c  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Update comments in nodeModifyTable.c
List pgsql-hackers
On 2017/07/26 22:39, Robert Haas wrote:
> On Wed, Jun 14, 2017 at 10:40 PM, Etsuro Fujita
> <fujita.etsuro@lab.ntt.co.jp> wrote:
>> Attached is an updated version of the patch.
> 
> Well, now I'm confused:
> 
>        * 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.
> +     * attribute present if not foreign table, and if foreign table, there
> +     * are always junk attributes present the FDW needs to identify the exact
> +     * row to update or delete --- no need to look first.  For foreign tables,
> +     * there's also a wholerow attribute when the relation has a row-level
> +     * trigger on UPDATE/DELETE but not on INSERT.
> 
> So the first part of the change weakens the assertion that a 'ctid' or
> 'wholerow' attribute will always be present by saying that an FDW may
> instead have other attributes sufficient to identify the row.

That's right.

> But
> then the additional sentence says that there will be a 'wholerow'
> attribute after all.  So this whole change seems to me to be going
> around in a circle.

What I mean by the additional one is: if the result table that is a 
foreign table has a row-level UPDATE/DELETE trigger, a 'wholerow' will 
also be present.  So, if the result table didn't have the trigger, there 
wouldn't be 'whole-row', so in that case it could be possible that there 
would be only attributes other than 'ctid' and 'wholerow'.

Best regards,
Etsuro Fujita




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [HACKERS] psql's \d and \dt are sending their complaints to different output files
Next
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] PL_stashcache, or, what's our minimum Perl version?