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

From Etsuro Fujita
Subject Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables
Date
Msg-id 9cd25d80-08fc-568c-3181-dbe98723d0db@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Bug in ExecModifyTable function and trigger issues for foreign tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Bug in ExecModifyTable function and trigger issues forforeign tables
List pgsql-hackers
On 2017/07/19 23:36, Tom Lane wrote:
> Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> writes:
>> * Modified rewrite_targetlist(), which is a new function added to
>> preptlist.c, so that we do const-simplification to junk TLEs that
>> AddForeignUpdateTargets() added, as that API allows the FDW to add junk
>> TLEs containing non-Var expressions to the query's targetlist.
> 
> This does not seem like a good idea to me.  eval_const_expressions is not
> a cheap thing, and for most use-cases those cycles will be wasted, and it
> has never been the responsibility of preprocess_targetlist to do this sort
> of thing.

Hm, I added that const-simplification to that function so that the 
existing FDWs that append junk TLEs that need const-simplification, 
which I don't know really exist, would work well for this fix, without 
any changes, but I agree on that point.

> Please put the responsibility of doing const-expression simplification
> in these cases somewhere closer to where the problem is being created.

It would be reasonable that it's the FDW's responsibility to do that 
const-simplification if necessary?

Best regards,
Etsuro Fujita




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] autovacuum can't keep up, bloat just continues to rise
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] psql's \r broken since e984ef5861d