Re: [HACKERS] Bug in ExecModifyTable function and trigger issues for foreign tables
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>,
Dilip Kumar <dilipbalaut@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Robert Haas <robertmhaas@gmail.com>
Date: 2017-11-27T11:19:31Z
Lists: pgsql-hackers
On 26 November 2017 at 22:56, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> writes: >> [ fix-rewrite-tlist-v4.patch ] > > I started reviewing this patch. I did not much like the fact that it > effectively moved rewriteTargetListUD to a different file and renamed it. > That seems like unnecessary code churn, plus it breaks the analogy with > rewriteTargetListIU, plus it will make back-patching harder (since that > code isn't exactly the same in back branches). I see little reason why > we can't leave it where it is and just make it non-static. It's not like > there's no other parts of the rewriter that the planner calls. > I wonder if, years from now, it might look a bit odd that rewriteTargetListUD() is doing part of work of preptlist.c, is only called from there, and yet is located in the rewriter. Aside from having a similar name to rewriteTargetListIU(), what rewriteTargetListUD() does seems more like what preprocess_targetlist() does for rowmarks. The fact that rewriteTargetListIU() intentionally only applies to the parent, whereas preprocess_targetlist() and now rewriteTargetListUD() apply to each child, further destroys any similarity between rewriteTargetListUD() and rewriteTargetListIU(). The point about back-patching is a reasonable one though, so I won't mind either way. A separate point -- it might be marginally more efficient to have the work of rewriteTargetListUD() done after expand_targetlist() to avoid the possible renumbering of the resjunk entries. Regards, Dean
Commits
-
Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE.
- 39f180fdd1e6 9.5.11 landed
- 06ba5309682e 9.6.7 landed
- a57aa430b613 10.2 landed
- 9a785ad57317 11.0 landed