Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2023-02-22T01:17:05Z
Lists: pgsql-bugs
Hi, On 2023-02-21 19:00:07 -0500, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > Perhaps we should deal with this by generating a distinct type of expression > > step, that looks up information about the param in a different place? Nothing > > forces us to have the expression step look into > > prm = &(econtext->ecxt_param_exec_vals[op->d.param.paramid]); > > Right, where I was going was to have a distinct EEOP type that finds > the ParamExecData in some other way. The main question is where to keep > that not-so-global ParamExecData. We currently overwrite prm->execPlan in ExecInitSubPlan(), when creating a second reference to the subplan. Which is why we then end up using the wrong SubPlanState in ExecSetParamPlan(). The problem of using the wrong SubPlanState doesn't look too hard to solve: We could stash the "actual" execPlan in scratch.d.param.something, instead of looking it up during ExecEvalParamExec(). I think that'd not be quite enough, because due to sharing the same ParamExecData, we wouldn't know when to recompute the plan. It also looks like something might not yet quite compute/adjust the types completely enough in execPartition.c... Greetings, Andres Freund
Commits
-
Fix MULTIEXPR_SUBLINK with partitioned target tables, yet again.
- ffec64ba86c4 11.20 landed
- a033f9165c2c 15.3 landed
- 9eaba06027ae 14.8 landed
- 904b171a4655 12.15 landed
- 87f3667ec079 16.0 landed
- 1e199c259947 13.11 landed
-
Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates.
- 3f7323cbbdd3 13.9 cited