Re: IMMUTABLE and PARALLEL SAFE function markings

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, gajus(at)gajus(dot)com, "pgsql-hackers\(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IMMUTABLE and PARALLEL SAFE function markings
Date: 2018-11-27 04:20:24
Message-ID: 87y39fnosv.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Robert" == Robert Haas <robertmhaas(at)gmail(dot)com> writes:

>> I'm a bit more concerned by the fact that inlining the function
>> isn't affecting the parallel safety of the query - the fact that
>> parallel safety is being checked prior to inlining means that if
>> inlining *introduces* a parallel hazard, it will go unnoticed?

Robert> If a function is marked parallel-safe but internally calls
Robert> parallel-restricted or parallel-unsafe functions, it wasn't
Robert> really parallel-safe in the first place. So I think that if
Robert> inlining introduces a parallel hazard, the user has mislabeled
Robert> some functions and any resulting injury is self-inflicted.

But the combination of inlining and polymorphism, in particular, makes
it impossible for the function author to know this. Take the OP's
example; it is parallel safe if and only if the selected type's equal
function is parallel safe - how is the author supposed to know? What if
the type is one installed later?

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-11-27 04:21:42 Re: IMMUTABLE and PARALLEL SAFE function markings
Previous Message Robert Haas 2018-11-27 04:04:35 Re: Remove Deprecated Exclusive Backup Mode