Re: jsonpath Time and Timestamp Special Cases

From: Chapman Flack <jcflack(at)acm(dot)org>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: jsonpath Time and Timestamp Special Cases
Date: 2024-06-20 15:49:18
Message-ID: 66744F7E.8080903@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-06-20 15:51:08 Re: Extension security improvement: Add support for extensions with an owned schema
Previous Message Tom Lane 2024-06-20 15:35:13 Re: DROP OWNED BY fails to clean out pg_init_privs grants