Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables
Date
Msg-id CAFjFpRfQ1pkCjNQFVOP_BPJfc7OR3596nqVVFBgAiDEZqB4Azg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Bug in ExecModifyTable function and trigger issuesfor foreign tables  (Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>)
Responses Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables  (Dilip Kumar <dilipbalaut@gmail.com>)
Re: [HACKERS] Bug in ExecModifyTable function and trigger issuesfor foreign tables  (Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>)
List pgsql-hackers
On Mon, May 15, 2017 at 2:46 PM, Ildus Kurbangaliev
<i.kurbangaliev@postgrespro.ru> wrote:
> On Mon, 15 May 2017 10:34:58 +0530
> Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
>> On Sun, May 14, 2017 at 9:54 PM, Dilip Kumar <dilipbalaut@gmail.com>
>> wrote:
>> > After your fix, now tupleid is invalid which is expected, but seems
>> > like we need to do something more. As per the comments seems like it
>> > is expected to get the oldtuple from planSlot.  But I don't see any
>> > code for handling that part.
>>
>> Maybe we should do something like attached patch.
>>
>
> Hi,
> planSlot contains already projected tuple, you can't use it as oldtuple.
> I think problem is that `rewriteTargetListUD` called only for parent
> relation, so there is no `wholerow` attribute for foreign tables.

Yes. postgresAddForeignUpdateTargets() which is called by
rewriteTargetListUD injects "ctid". "wholerow" is always there. Not
for postgres_fdw but for other wrappers it might be a bad news. ctid,
whole row obtained from the remote postgres server will fit the tuple
descriptor of parent, but for other FDWs the column injected by
rewriteTargetListUD() may make the child tuple look different from
that of the parent, so we may not pass that column down to the child.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company



pgsql-hackers by date:

Previous
From: Sokolov Yura
Date:
Subject: Re: [HACKERS] Small improvement to compactify_tuples
Next
From: Dilip Kumar
Date:
Subject: Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables