Re: Why are JSON extraction functions STABLE and not IMMUTABLE? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why are JSON extraction functions STABLE and not IMMUTABLE?
Date
Msg-id 15093.1366040593@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why are JSON extraction functions STABLE and not IMMUTABLE?  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
>> Is there any particular reason extract functions
>> (object_field/array_element/...) can't be immutable?
>> 
>> I can't readily imagine a situation where output of these functions would
>> change for different queries.

> Me either. It's an oversight, really. Unless there is any objection I'll 
> change them toot sweet. What about the existing (as of 9.2) functions?

Note that anything that invokes other types' I/O functions can't be
immutable, at most stable.  But the ones that don't do that certainly
should be fixed.

BTW, while I'm looking at this: json_populate_record and
json_populate_recordset are marked as non-strict, but they are
completely broken for null inputs because they attempt to fetch inputs
before checking them for null-ness.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: COPY and Volatile default expressions
Next
From: Andres Freund
Date:
Subject: Re: Why are JSON extraction functions STABLE and not IMMUTABLE?