Re: IMMUTABLE and PARALLEL SAFE function markings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: IMMUTABLE and PARALLEL SAFE function markings
Date
Msg-id 29696.1543279213@sss.pgh.pa.us
Whole thread Raw
In response to Re: IMMUTABLE and PARALLEL SAFE function markings  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Responses Re: IMMUTABLE and PARALLEL SAFE function markings
Re: IMMUTABLE and PARALLEL SAFE function markings
List pgsql-hackers
Vik Fearing <vik.fearing@2ndquadrant.com> writes:
> On 27/11/2018 01:13, Stephen Frost wrote:
>> Parallel safe functions should be marked as such.  Immutable functions
>> should be marked as such.  We should not assume that one implies the
>> other, nor should we operate as if they do.

> Yes we should!  Unless you can produce a case where an immutable
> function is not parallel safe.

As far as that goes, I agree with the idea of adding an oprsanity test
that shows any built-in functions that are immutable but not parallel
safe, on the grounds Stephen mentioned: it's probably a mistake, and
if it isn't, we can add that function to the expected output.

I'm way less inclined to buy into the idea that it MUST be wrong, though.
Immutability is a promise about result stability and lack of side effects,
but it is not a promise about implementation details.  There could be an
implementation reason not to run something in a parallel worker.  Off the
top of my head, a possible example is "it's written in plfoo which hasn't
yet been made to work correctly in parallel workers".

            regards, tom lane


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: IMMUTABLE and PARALLEL SAFE function markings
Next
From: Andres Freund
Date:
Subject: Re: pg_config wrongly marked as not parallel safe?