Why are JSON extraction functions STABLE and not IMMUTABLE?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Why are JSON extraction functions STABLE and not IMMUTABLE?
Date: 2013-04-15 15:16:57
Message-ID: 20130415151656.GA16141@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In current 9.3, I see:

$ select p.proname, p.provolatile from pg_proc p join pg_namespace n on p.pronamespace = n.oid where n.nspname = 'pg_catalog' and p.proname ~ 'json';
proname | provolatile
---------------------------+-------------
json_in | s
json_out | i
json_recv | s
json_send | s
array_to_json | s
array_to_json | s
row_to_json | s
row_to_json | s
json_agg_transfn | i
json_agg_finalfn | i
json_agg | i
to_json | s
json_object_field | s
json_object_field_text | s
json_array_element | s
json_array_element_text | s
json_extract_path | s
json_extract_path_op | s
json_extract_path_text | s
json_extract_path_text_op | s
json_array_elements | s
json_array_length | s
json_object_keys | s
json_each | s
json_each_text | s
json_populate_record | s
json_populate_recordset | s
(27 rows)

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.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2013-04-15 15:24:27 Re: COPY and Volatile default expressions
Previous Message Simon Riggs 2013-04-15 14:00:34 COPY and Volatile default expressions