Re: jsonpath Time and Timestamp Special Cases - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: jsonpath Time and Timestamp Special Cases
Date
Msg-id 66744F7E.8080903@acm.org
Whole thread Raw
In response to Re: jsonpath Time and Timestamp Special Cases  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers
On 06/20/24 10:54, David E. Wheeler wrote:
> Still not sure about `24:00:00` as a time, though. I presume the jsonpath standard disallows it.

In 9075-2 9.46 "SQL/JSON path language: syntax and semantics", the behavior
of the .time() and .time_tz() and similar item methods defers to the
behavior of SQL's CAST.

For example, .time(PS) (where PS is the optional precision spec) expects
to be applied to a character string X from the JSON source, and its
success/failure and result are the same as for CAST(X AS TIME PS).

The fact that our CAST(X AS TIME) will succeed for '24:00:00' might be
its own extension (or violation) of the spec (I haven't checked that),
but given that it does, we could debate whether it violates the jsonpath
spec for our jsonpath .time() to behave the same way.

The same argument may also apply for ±infinity.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: DROP OWNED BY fails to clean out pg_init_privs grants
Next
From: Robert Haas
Date:
Subject: Re: Extension security improvement: Add support for extensions with an owned schema