Re: Bug in query rewriter - hasModifyingCTE not getting set
Greg Nancarrow <gregn4422@gmail.com>
From: Greg Nancarrow <gregn4422@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-09-08T01:30:24Z
Lists: pgsql-hackers
On Wed, Sep 8, 2021 at 8:00 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com> writes: > > The attached patch is based on your version. It includes cosmetic > > changes to use = instead of |= for boolean variable assignments. > > Now, we could potentially make this work if we wrote code to run > through the copied rtable entries (recursively) and increment the > appropriate ctelevelsup fields by one. That would essentially > have to be a variant of IncrementVarSublevelsUp that *only* acts > on ctelevelsup and not other level-dependent fields. That's > what I meant when I spoke of moving mountains: the amount of code > that would need to go into this seems out of all proportion to > the value. I think we should just throw an error, instead. > At least till such time as we see actual field complaints. > [I don't think Tsunakawa-san will be responding to this any time soon] I proposed a patch for this issue in a separate thread: https://www.postgresql.org/message-id/CAJcOf-f68DT=26YAMz_i0+Au3TcLO5oiHY5=fL6Sfuits6r+_w@mail.gmail.com The patch takes your previously-reverted patch for this issue and adds an error condition, so it does throw an error for that test case in your previous post. It also affects one existing regression test, since that uses an INSERT...SELECT rule action applied to a command with a data-modifying CTE (and we shouldn't really be allowing that anyway). Regards, Greg Nancarrow Fujitsu Australia
Commits
-
Fix rewriter to set hasModifyingCTE correctly on rewritten queries.
- 362e2dcc4619 15.0 landed
- cbba6ba3a062 13.5 landed
- 9de082399cfe 10.19 landed
- 882b7e728835 11.14 landed
- 595ab8a5451b 9.6.24 landed
- 1fedbcc7ab26 12.9 landed
- 03d01d746b93 14.0 landed
-
Enable parallel SELECT for "INSERT INTO ... SELECT ...".
- 05c8482f7f69 14.0 landed
-
Revert "Propagate CTE property flags when copying a CTE list into a rule."
- f94924f01e48 11.11 landed
- d6759ac6a41e 10.16 landed
- d1d297985253 14.0 landed
- ac1df003f253 13.2 landed
- a64aacf152fc 9.5.25 landed
- 6f8e393a79e4 9.6.21 landed
- 46f297113598 12.6 landed
-
Propagate CTE property flags when copying a CTE list into a rule.
- ed2908963354 14.0 landed
- ce5f27fcae61 11.11 landed
- 739375174ae8 13.2 landed
- 56ff63cac94d 10.16 landed
- 4384eccb1549 9.5.25 landed
- 2a7664a79c16 12.6 landed
- 01e3fe3275af 9.6.21 landed