Re: User's responsibility when using a chain of "immutable" functions? - Mailing list pgsql-general

From David G. Johnston
Subject Re: User's responsibility when using a chain of "immutable" functions?
Date
Msg-id CAKFQuwaErhPR-i=S1oukUyQ_JA-=SPVVcyjzwBOHiut++KBfjg@mail.gmail.com
Whole thread Raw
In response to Re: User's responsibility when using a chain of "immutable" functions?  (Bryn Llewellyn <bryn@yugabyte.com>)
List pgsql-general
On Tuesday, June 28, 2022, Bryn Llewellyn <bryn@yugabyte.com> wrote:

DISCARD PLANS is unsafe in a multi-user concurrent scenario. The doc says explicitly that its scope is just the single session. And it's easy to show the danger by using my testcase manually, step by appropriate step, with two concurrent sessions.

Impractical maybe, but hardly unsafe (well, relative to not doing anything).

 

I've concluded that the only practical practice for "immutable" is to reserve its use for functions that don't mention even a single user-created artifact.

That seems like too strong a position to take for me.  Go ahead and build immutable utility functions.  Just don’t be stupid break your promise.  But even then, there are ways to fix things in case of bugs.
 

David J.

 

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: User's responsibility when using a chain of "immutable" functions?
Next
From: Tom Lane
Date:
Subject: Re: User's responsibility when using a chain of "immutable" functions?