Re: IMMUTABLE and PARALLEL SAFE function markings

From: Andres Freund <andres(at)anarazel(dot)de>
To: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
Cc: Gajus Kuizinas <gajus(at)gajus(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IMMUTABLE and PARALLEL SAFE function markings
Date: 2018-11-26 23:39:40
Message-ID: 20181126233940.hxnpwubssyf7eax4@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-11-27 00:33:10 +0100, Vik Fearing wrote:
> On 26/11/2018 22:23, Gajus Kuizinas wrote:
> > I was wondering what is the reason IMMUTABLE functions are not by
> > default PARALLEL SAFE and if the default behaviour could be changed to
> > make IMMUTABLE functions PARALLEL SAFE?
>
> I think I have to concur with this. When is an immutable function not
> parallel safe?
>
> Sure it could be mislabeled as immutable but it could just as easily be
> mislabeled as parallel safe. And we already treat fake immutable
> functions as user errors, for example in indexes.

I think it'd introduce more problems than it'd solve. Either you ignore
the proparallel setting - resulting in broken catalog querying - or you
have to have a decent amount of special behaviour that an explicit ALTER
FUNCTION ... IMMUTABLE | STABLE | VOLATILE and SET PARALLEL { UNSAFE
| RESTRICTED | SAFE } would also need to change the respective other
category.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-11-26 23:45:21 pg_config wrongly marked as not parallel safe?
Previous Message Vik Fearing 2018-11-26 23:33:10 Re: IMMUTABLE and PARALLEL SAFE function markings