pgsql: Disallow jsonpath methods involving TZ in immutable functions - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Disallow jsonpath methods involving TZ in immutable functions
Date
Msg-id E1rYr5s-005ZdW-1X@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Disallow jsonpath methods involving TZ in immutable functions

Timezones are not immutable and so neither is any function that relies on
them. In commit 66ea94e8, we introduced a few methods which do casting
from one time to another and thus may involve the current timezone.  To
preserve the immutability of jsonpath functions currently marked
immutable, disallow these methods from being called from non-TZ aware
functions.

Jeevan Chalke, per a report from Jian He.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/469745468668917434dbef48eddad4f961880b3d

Modified Files
--------------
doc/src/sgml/func.sgml                       |   7 +-
src/backend/utils/adt/jsonpath_exec.c        |  16 ++
src/test/regress/expected/jsonb_jsonpath.out | 260 ++++++++++++---------------
src/test/regress/sql/jsonb_jsonpath.sql      |  33 +++-
4 files changed, 168 insertions(+), 148 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Remove race condition in pg_get_expr().
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Use extensible buffers to assemble command lines