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 1soPrZ-00B7T3-Vr for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 16:06:38 +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 1soPrY-003MSi-6S for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 16:06:36 +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 1soPrX-003MSa-T6 for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 16:06:35 +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 1soPrS-000fsI-Pw for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 16:06:33 +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 48BG6RaF3832088; Wed, 11 Sep 2024 12:06:27 -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: <5801E26B-E2AB-4BA3-8B69-EF8837389284@justatheory.com> 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> <3824427.1726067484@sss.pgh.pa.us> <5801E26B-E2AB-4BA3-8B69-EF8837389284@justatheory.com> Comments: In-reply-to "David E. Wheeler" message dated "Wed, 11 Sep 2024 11:52:31 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3832086.1726070787.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 11 Sep 2024 12:06:27 -0400 Message-ID: <3832087.1726070787@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David E. Wheeler" writes: > On Sep 11, 2024, at 11:11, Tom Lane wrote: >> 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. > There is stringification of a time, date, or timestamp value, which > has no TZ, but is still affected by DateStyle. What I understood you to be referencing is what happens without string(), which AFAICS does not result in any timezone rotation: regression=3D# set timezone =3D 'America/New_York'; SET regression=3D# select jsonb_path_query('"2023-08-15 12:34:56-09"', '$.time= stamp_tz()'); jsonb_path_query = ----------------------------- "2023-08-15T12:34:56-09:00" (1 row) I think I'd be content to have string() duplicate that behavior --- in fact, it seems like it'd be odd if it doesn't match. regards, tom lane