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 1soO3t-00Aqwa-P7 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 14:11:14 +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 1soO3t-0012Ez-Cq for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Sep 2024 14:11:13 +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 1soO3t-0012Er-2r for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 14:11:13 +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 1soO3p-000en0-Gg for pgsql-hackers@lists.postgresql.org; Wed, 11 Sep 2024 14:11:12 +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 48BEB5sh3811775; Wed, 11 Sep 2024 10:11:05 -0400 From: Tom Lane To: Peter Eisentraut cc: "David E. Wheeler" , jian he , PostgreSQL Hackers Subject: Re: Document DateStyle effect on jsonpath string() In-reply-to: <5e8879d0-a3c8-4be2-950f-d83aa2af953a@eisentraut.org> 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> Comments: In-reply-to Peter Eisentraut message dated "Wed, 11 Sep 2024 12:20:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3811773.1726063865.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 11 Sep 2024 10:11:05 -0400 Message-ID: <3811774.1726063865@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > What I'm concerned about is that this makes the behavior of JSON_QUERY = > non-immutable. Maybe there are other reasons for it to be = > non-immutable, in which case this isn't important. But it might be = > worth avoiding that? Fair point, but haven't we already bit that bullet with respect to timezones? [ looks... ] Hmm, it looks like jsonb_path_exists_tz is marked stable while jsonb_path_exists is claimed to be immutable. So yeah, there's a problem here. I'm not 100% convinced that jsonb_path_exists was truly immutable before, but for sure it is not now, and that's bad. regression=3D# select jsonb_path_query('"2023-08-15 12:34:56"', '$.timesta= mp().string()'); jsonb_path_query = ----------------------- "2023-08-15 12:34:56" (1 row) regression=3D# set datestyle =3D postgres; SET regression=3D# select jsonb_path_query('"2023-08-15 12:34:56"', '$.timesta= mp().string()'); jsonb_path_query = ---------------------------- "Tue Aug 15 12:34:56 2023" (1 row) regards, tom lane