Re: BUG #18314: PARALLEL UNSAFE function does not prevent parallel index build

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tender Wang <tndrwang@gmail.com>, pgsql-bugs@lists.postgresql.org, Alexander Lakhin <exclusion@gmail.com>, jian he <jian.universality@gmail.com>
Date: 2024-03-06T23:42:08Z
Lists: pgsql-bugs
On Wed, Mar 06, 2024 at 06:01:50PM -0500, Tom Lane wrote:
> Sure, but the current patch just trades one set of errors for others.
> As I said, if we care about this problem then the right fix will
> involve serializing/deserializing already-const-folded expression
> trees instead of expecting that the workers can regenerate those.
> I don't personally think it's worth the trouble, especially not if
> we can get rid of the need for exception-using functions to be marked
> parallel unsafe.

I don't know if that's worth tackling either.  It sounds like this is
just something we should do only if someone comes up with a good use
case for it, outside of the subtransaction handling in the workers.

Anyway, I've just reverted the change for now.
--
Michael

Commits

  1. Revert "Fix parallel-safety check of expressions and predicate for index builds"

  2. Fix parallel-safety check of expressions and predicate for index builds

  3. Ensure we preprocess expressions before checking their volatility.