jsonpath Time and Timestamp Special Cases

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: jsonpath Time and Timestamp Special Cases
Date: 2024-04-30 00:45:43
Message-ID: 8AB7857D-BD57-472E-94F5-1964A5B15971@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers,

I noticed that the jsonpath date/time functions (.time() and timestamp(), et al.) don’t support some valid but special-case PostgreSQL values, notably `infinity`, `-infinity`, and, for times, '24:00:00`:

❯ psql
psql (17devel)
Type "help" for help.

david=# select jsonb_path_query(to_jsonb('24:00:00'::time), '$.time()');
ERROR: time format is not recognized: "24:00:00"

david=# select jsonb_path_query(to_jsonb('infinity'::timestamptz), '$.timestamp_tz()');
ERROR: timestamp_tz format is not recognized: "infinity"

I assume this is because the standard doesn’t support these, or references JavaScript-only values or some such. Is that right?

Best,

David

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2024-04-30 00:54:47 Re: A failure in prepared_xacts test
Previous Message Richard Guo 2024-04-30 00:43:32 Re: A failure in prepared_xacts test