Re: Bug in ExecModifyTable function and trigger issues for foreign tables

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Bug in ExecModifyTable function and trigger issues for foreign tables
Date: 2017-07-20 02:21:57
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2017/07/19 23:36, Tom Lane wrote:
> Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)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

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-07-20 02:24:00 Re: psql's \r broken since e984ef5861d
Previous Message Peter Geoghegan 2017-07-20 02:17:45 Re: autovacuum can't keep up, bloat just continues to rise