Re: Why are JSON extraction functions STABLE and not IMMUTABLE?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why are JSON extraction functions STABLE and not IMMUTABLE?
Date: 2013-04-15 15:43:13
Message-ID: 15093.1366040593@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-04-15 15:46:47 Re: Why are JSON extraction functions STABLE and not IMMUTABLE?
Previous Message Heikki Linnakangas 2013-04-15 15:41:00 Re: COPY and Volatile default expressions