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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why are JSON extraction functions STABLE and not IMMUTABLE?
Дата
Msg-id 15093.1366040593@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why are JSON extraction functions STABLE and not IMMUTABLE?  (Andrew Dunstan <andrew@dunslane.net>)
Список 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 по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: COPY and Volatile default expressions
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Why are JSON extraction functions STABLE and not IMMUTABLE?