Re: Fix erroneous parallel execution when modifying CTE is present in rewritten query

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Nancarrow <gregn4422@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>
Date: 2021-09-08T16:11:44Z
Lists: pgsql-hackers
Greg Nancarrow <gregn4422@gmail.com> writes:
> [ v1-0001-Propagate-CTE-property-flags-when-copying-a-CTE-list.patch ]

Pushed with a couple of adjustments:

* I rewrote the comment, mostly so as to include an explanation of how
the error could be removed, in case anyone ever wants to go to the
trouble.

* The existing test case can be fixed up without fundamentally changing
what it's testing, by replacing INSERT...SELECT with INSERT...VALUES.
(That should likely also be our first suggestion to any complainers.)

Thanks for the patch!

			regards, tom lane



Commits

  1. Fix rewriter to set hasModifyingCTE correctly on rewritten queries.