Peter Eisentraut <pe...@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


Reply via email to