public inbox for [email protected]
help / color / mirror / Atom feedFrom: [email protected]
To: Tom Lane <[email protected]>
Cc: Yura Sokolov <[email protected]>
Cc: [email protected]
Subject: Re: When IMMUTABLE is not.
Date: Thu, 15 Jun 2023 09:58:39 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On 2023-06-15 09:21, Tom Lane wrote:
> Yura Sokolov <[email protected]> writes:
>> not enough to be sure function doesn't manipulate data.
>
> Of course not. It is the user's responsibility to mark functions
> properly.
And also, isn't it the case that IMMUTABLE should mark a function,
not merely that "doesn't manipulate data", but whose return value
doesn't depend in any way on data (outside its own arguments)?
The practice among PLs of choosing an SPI readonly flag based on
the IMMUTABLE/STABLE/VOLATILE declaration seems to be a sort of
peculiar heuristic, not something inherent in what that declaration
means to the optimizer. (And also influences what snapshot the
function is looking at, and therefore what it can see, which has
also struck me more as a tacked-on effect than something inherent
in the declaration's meaning.)
Regards,
-Chap
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: When IMMUTABLE is not.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox