Re: json function volatility

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json function volatility
Date: 2014-10-17 21:41:09
Message-ID: 9882.1413582069@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Merlin Moncure wrote:
>> On Fri, Oct 17, 2014 at 3:03 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>> Following up something Pavel wrote, I notice that json_agg() and
>>> json_object_agg() are both marked as immutable, even though they invoke IO
>>> functions, while json_object is marked stable, even though it does not, and
>>> can probably be marked as immutable. Mea maxima culpa.

>>> I'm not sure what we should do about these things now. Is it a tragedy if we
>>> let these escape into the 9.4 release that way?

>> Is it too late to change them?

> One thing to consider is the catversion bump, which we don't want this
> late in the cycle. Still, you could change the catalogs but not the
> version, and advise those with the older definitions to tweak the
> catalogs by hand if they need it. I think we did this once.

I'm fairly sure that the system doesn't actually pay attention to the
volatility marking of aggregates, so there's no huge harm done by the
incorrect markings of those. The incorrect marking of json_object might
be a small optimization block.

+1 for changing these in 9.4 without bumping catversion. I don't think
we need to give advice for manual corrections, either: the risk of doing
that wrong probably outweighs the value of fixing it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2014-10-17 21:43:17 get_actual_variable_range vs idx_scan/idx_tup_fetch
Previous Message Jim Nasby 2014-10-17 21:27:54 Re: Materialized views don't show up in information_schema