1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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.
This commit is contained in:
Andrew Dunstan
2024-02-10 12:12:39 -05:00
parent ce571434ae
commit 4697454686
4 changed files with 168 additions and 148 deletions

View File

@ -18240,7 +18240,12 @@ ERROR: jsonpath member accessor can only be applied to an object
<type>timestamptz</type>, and <type>time</type> to <type>timetz</type>.
However, all but the first of these conversions depend on the current
<xref linkend="guc-timezone"/> setting, and thus can only be performed
within timezone-aware <type>jsonpath</type> functions.
within timezone-aware <type>jsonpath</type> functions. Similarly, other
date/time-related methods that convert strings to date/time types
also do this casting, which may involve the current
<xref linkend="guc-timezone"/> setting. Therefore, these conversions can
also only be performed within timezone-aware <type>jsonpath</type>
functions.
</para>
</note>