Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYr6B-000Rcy-9j for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Feb 2024 17:25:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rYr6A-00Gk7d-A1 for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Feb 2024 17:25:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYr69-00Gk7U-RE for pgsql-hackers@lists.postgresql.org; Sat, 10 Feb 2024 17:25:06 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rYr66-006Vwv-UD for pgsql-hackers@postgresql.org; Sat, 10 Feb 2024 17:25:05 +0000 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-42aabb1cdaaso16311431cf.2 for ; Sat, 10 Feb 2024 09:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1707585900; x=1708190700; darn=postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=NLPzLdt4oIARek23Lru085Q8oWrOmrfk31qBuYkcjbE=; b=OJ3oDOFr9pOezIH4uGypNM0PWvBgWhcOK9FvHzZ5+qXnxots/IrGWTH7ey8ER1HKxN nUdaNHDjMGUimJesQCksO2EJD/9/l2oJ4Ca3yRAVFoMEw2Xs+6yUo/hcU/KwrUr1Jo+Q JqHPHfSI4jwxhCAJtTQKIOy/WE8G6CgeEsK2DGUnryJsoBOsEqnkSSt65fgbM5iKubP4 vPR/WuNmOQvreRhmT0DYfR0t9A+94SGXxsxYP1Y+YA5CBqEB4knzA2thkmFblNO36Kdx PMqyo9IMVrKwnmeoxoaEvaFBnb6yTYMMrxkIFkH9q2gJ9DB3zZLjcxfEA++R2nkPKOWu 1T5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707585900; x=1708190700; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=NLPzLdt4oIARek23Lru085Q8oWrOmrfk31qBuYkcjbE=; b=biSdyPC7b42NuHG3ypMCrCegpWM1Y/yn66wT5Sy1qg4y/CJZ9zR25Y2ltQFTWa6y2J +B4TJOuFYv0w5B9wuGW6VmPQ4RR00bSv2NJy6GWSdlYC4DiXoNHspWVLtK4ikUHdVPeJ yJRRJuOgUy1upsdaDmyCKbBRDvHCukvSyInGK0ZlaqHG5e8NPvLjDocJ47156PlKtD4a GC89RGqWjKCZu7vK9YS8pk7plNFyLc3X2tKGxxjgLmtjVAS6W9u8BDqNDdXn6ruKqtFo 7w0DtDUwtAlV4X5E0SNX6ZLTOsc0q0krkbt6FjF4+WVbYydrzI6NrEnllV0FQmQi9sUW wKLg== X-Gm-Message-State: AOJu0YwnkNHuTxOsy9lxC2WFjFozxrJFlhB/tVFrdOfYVHi6sWpLhsr/ PHbF0XCtiXhr57gzfqCrNEoYTBsONf0LB/7eHjbwo2Y1p3wvCNyUaI89ocjopr4= X-Google-Smtp-Source: AGHT+IEW8GCt6oj6iUv6fn3cDDUwvufu5vyoZacG/otcd54DqKlT0+pSWn+TpIa9MQBQHxaw+mAk7A== X-Received: by 2002:a0c:f008:0:b0:68c:bf69:c718 with SMTP id z8-20020a0cf008000000b0068cbf69c718mr2553649qvk.30.1707585900316; Sat, 10 Feb 2024 09:25:00 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVp+kYwUVMFmS8urMbocrLZTa1qEnFLvNafDWre6XycOVLjKjbM+dRSTDsjaPTNwsMLG7aAz+MPUUXtUn7KrQOufrY+86B0ZgbfNEM= Received: from ?IPV6:2605:a601:91f3:1900::2bb? ([2605:a601:91f3:1900::2bb]) by smtp.googlemail.com with ESMTPSA id mb8-20020a056214550800b0068c440bc7d0sm1911956qvb.105.2024.02.10.09.24.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 10 Feb 2024 09:24:59 -0800 (PST) Content-Type: multipart/alternative; boundary="------------Drde0FIQnUkIcA60JcFywGZi" Message-ID: Date: Sat, 10 Feb 2024 12:24:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: recently added jsonpath method change jsonb_path_query, jsonb_path_query_first immutability Content-Language: en-US To: Jeevan Chalke , jian he Cc: PostgreSQL-development References: From: Andrew Dunstan In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------Drde0FIQnUkIcA60JcFywGZi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-02-08 Th 21:02, Jeevan Chalke wrote: > > > On Thu, Feb 8, 2024 at 2:22 PM jian he > wrote: > > On Thu, Feb 8, 2024 at 1:27 PM Jeevan Chalke > wrote: > > > > > > > > On Wed, Feb 7, 2024 at 9:13 PM jian he > wrote: > >> > >> On Wed, Feb 7, 2024 at 7:36 PM Jeevan Chalke > >> 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 >        timestamptz, and time to > timetz. >        However, all but the first of these conversions depend on > the current >         setting, and thus can only > be performed > -      within timezone-aware jsonpath functions. > +      within timezone-aware jsonpath functions.  > Similarly, other > +      date/time-related methods that convert string to the > date/time types > +      also do the casting and may involve the current > +      .  To preserve the > immutability, those can > +      only be performed within timezone-aware > jsonpath functions. >       >       > > my proposed minor changes: > -      within timezone-aware jsonpath functions. > +      within timezone-aware jsonpath functions. > Similarly, other > +      date/time-related methods that convert string to the > date/time types > +      also do the casting and may involve the current > +      setting. Those conversions can > +      only be performed within timezone-aware > jsonpath functions. > I don't have a strong opinion, though. > > > That seems fine as well. Let's leave that to the committer. > I edited slightly to my taste, and committed the patch. Thanks. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------Drde0FIQnUkIcA60JcFywGZi Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2024-02-08 Th 21:02, Jeevan Chalke wrote:


On Thu, Feb 8, 2024 at 2:22 PM jian he <jian.universality@gmail.com> wrote:
On Thu, Feb 8, 2024 at 1:27 PM Jeevan Chalke
<jeevan.chalke@enterprisedb.com> wrote:
>
>
>
> On Wed, Feb 7, 2024 at 9:13 PM jian he <jian.universality@gmail.com> wrote:
>>
>> On Wed, Feb 7, 2024 at 7:36 PM Jeevan Chalke
>> <jeevan.chalke@enterprisedb.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.

That seems fine as well. Let's leave that to the committer.


    

I edited slightly to my taste, and committed the patch. Thanks.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------Drde0FIQnUkIcA60JcFywGZi--