On Wed, Nov 23, 2022 at 9:01 AM Joel Mukuthu <jom@upright.co> wrote:
Given the following two functions, where the only difference between them is that one is VOLATILE while the other is IMMUTABLE:
That is a huge difference
Is this behaviour expected?
Yes.
RAISE is a side-effect inducing statement, which disqualifies the function from being IMMUTABLE.
The immutable marker gives the system permission to execute the function, given constant arguments, once to find out what the value of that function is during the execution of the query and make decisions based upon that result.