Re: Parallel safety for extern params

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Kapila <amit.kapila16@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-03-21T16:21:13Z
Lists: pgsql-hackers
On Fri, Mar 21, 2025 at 11:52 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I think this is completely wrong and should be reverted.  There
> cannot be a Param there, and if there were it would not represent
> a reference to the Gather's child.
>
> I tried reverting this code change, and check-world still passes,
> with or without debug_parallel_query = regress.  So if there is
> a case I'm missing, the regression tests don't expose it.

Did you try the test case from the original post on this thread?

I'm perfectly willing to believe that we messed up here -- this was 8
years ago and I don't remember the details -- but it surprises me a
little bit that I would have committed that change without verifying
that it was necessary to resolve the reported problem. However, I have
made such mistakes before and will probably make them again, so it
certainly could have happened.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. Revert inappropriate weakening of an Assert in plpgsql.

  2. Repair bogus handling of multi-assignment Params in upper plan levels.

  3. Allow parallel query for prepared statements with generic plans.

  4. Fix mistaken failure to allow parallelism in corner case.

  5. Make simpler-simple-expressions code cope with a Gather plan.