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 3832087.1726070787@sss.pgh.pa.us
Whole thread Raw
In response to Re: Document DateStyle effect on jsonpath string()  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: Document DateStyle effect on jsonpath string()
List pgsql-hackers
"David E. Wheeler" <david@justatheory.com> writes:
> On Sep 11, 2024, at 11:11, Tom Lane <tgl@sss.pgh.pa.us> 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=# set timezone = 'America/New_York';
SET
regression=# select jsonb_path_query('"2023-08-15 12:34:56-09"', '$.timestamp_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



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Document DateStyle effect on jsonpath string()
Next
From: Tom Lane
Date:
Subject: Re: Document DateStyle effect on jsonpath string()