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 1soP0I-00AzrU-Dn for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 15:11:35 +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 1soP0H-002JiI-JK for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 15:11:33 +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 1soP0H-002JiA-A6 for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 15:11:33 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1soP0D-000fEG-Ih for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 15:11:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 48BFBOaV3824428; Wed, 11 Sep 2024 11:11:24 -0400 From: Tom Lane To: "David E. Wheeler" cc: Peter Eisentraut , jian he , PostgreSQL Hackers Subject: Re: Document DateStyle effect on jsonpath string() In-reply-to: References: <56955B33-6959-4FDA-A459-F00363ECDFEE@justatheory.com> <4D874C72-8939-4083-8336-AB114D9E29AD@justatheory.com> <3541398.1725994308@sss.pgh.pa.us> <3654686.1725999372@sss.pgh.pa.us> <5e8879d0-a3c8-4be2-950f-d83aa2af953a@eisentraut.org> <3811774.1726063865@sss.pgh.pa.us> Comments: In-reply-to "David E. Wheeler" message dated "Wed, 11 Sep 2024 11:00:09 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3824426.1726067484.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 11 Sep 2024 11:11:24 -0400 Message-ID: <3824427.1726067484@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David E. Wheeler" writes: > I wonder, then, whether .string() should be modified to use the ISO form= at in UTC, and therefore be immutable. That=E2=80=99s the format you get i= f you omit .string() and let result be stringified from a date/time/timest= amp. What "let result be stringified" behavior are you thinking of, exactly? AFAICS there's not sensitivity to timezone unless you use the _tz variant, otherwise it just regurgitates the input. I agree that we should force ISO datestyle, but I'm not quite sure about whether we're in the clear with timezone handling. We already had a bunch of specialized rules about timezone handling in the _tz and not-_tz variants of these functions. It seems to me that simply forcing UTC would not be consistent with that pre-existing behavior. However, I may not have absorbed enough caffeine yet. regards, tom lane