Re: Document DateStyle effect on jsonpath string() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Document DateStyle effect on jsonpath string()
Date
Msg-id 3811774.1726063865@sss.pgh.pa.us
Whole thread Raw
In response to Re: Document DateStyle effect on jsonpath string()  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: Document DateStyle effect on jsonpath string()
List pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> 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=# select jsonb_path_query('"2023-08-15 12:34:56"', '$.timestamp().string()');
   jsonb_path_query
-----------------------
 "2023-08-15 12:34:56"
(1 row)

regression=# set datestyle = postgres;
SET
regression=# select jsonb_path_query('"2023-08-15 12:34:56"', '$.timestamp().string()');
      jsonb_path_query
----------------------------
 "Tue Aug 15 12:34:56 2023"
(1 row)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: First draft of PG 17 release notes
Next
From: Bruce Momjian
Date:
Subject: Re: First draft of PG 17 release notes