Re: IMMUTABLE and PARALLEL SAFE function markings

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, Gajus Kuizinas <gajus(at)gajus(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IMMUTABLE and PARALLEL SAFE function markings
Date: 2018-11-27 00:47:06
Message-ID: 028a3895-2713-ad20-ef03-d192bc245f98@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 27/11/2018 01:40, Tom Lane wrote:
> Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)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".

Now, see, that is an actual argument for making a difference. The other
arguments in this thread were not, so say I.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2018-11-27 00:51:14 Re: pg_config wrongly marked as not parallel safe?
Previous Message Andres Freund 2018-11-27 00:43:17 Re: pg_config wrongly marked as not parallel safe?