Re: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability
Date: 2024-02-08 08:52:00
Message-ID: CACJufxGtM=z-N9zRtZ9rM079jsh=nnoJ1G-+7W3p9hk1wyAcVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 8, 2024 at 1:27 PM Jeevan Chalke
<jeevan(dot)chalke(at)enterprisedb(dot)com> wrote:
>
>
>
> On Wed, Feb 7, 2024 at 9:13 PM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>>
>> On Wed, Feb 7, 2024 at 7:36 PM Jeevan Chalke
>> <jeevan(dot)chalke(at)enterprisedb(dot)com> wrote:
>> > Added checkTimezoneIsUsedForCast() check where ever we are casting timezoned to non-timezoned types and vice-versa.
>>
>> https://www.postgresql.org/docs/devel/functions-json.html
>> above Table 9.51. jsonpath Filter Expression Elements, the Note
>> section, do we also need to rephrase it?
>
>
> OK. Added a line for the same.
>

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 6788ba8..37ae2d1 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -18240,7 +18240,11 @@ 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 string to the date/time types
+ also do the casting and may involve the current
+ <xref linkend="guc-timezone"/>. To preserve the immutability, those can
+ only be performed within timezone-aware <type>jsonpath</type> functions.
</para>
</note>

my proposed minor changes:
- within timezone-aware <type>jsonpath</type> functions.
+ within timezone-aware <type>jsonpath</type> functions. Similarly, other
+ date/time-related methods that convert string to the date/time types
+ also do the casting and may involve the current
+ <xref linkend="guc-timezone"/> setting. Those conversions can
+ only be performed within timezone-aware <type>jsonpath</type> functions.
I don't have a strong opinion, though.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2024-02-08 09:25:23 Re: Race condition in FetchTableStates() breaks synchronization of subscription tables
Previous Message Kyotaro Horiguchi 2024-02-08 08:43:17 Re: A comment in DropRole() contradicts the actual behavior