Re: jsonpath: Missing regex_like && starts with Errors? - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: jsonpath: Missing regex_like && starts with Errors?
Date
Msg-id 6670EE22.60808@acm.org
Whole thread Raw
In response to Re: jsonpath: Missing regex_like && starts with Errors?  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: jsonpath: Missing regex_like && starts with Errors?
List pgsql-hackers
On 06/17/24 19:17, David E. Wheeler wrote:
> [1]: https://github.com/postgres/postgres/blob/82ed67a/src/backend/utils/adt/jsonpath_exec.c#L2058-L2059

Huh, I just saw something peculiar, skimming through the code:

https://github.com/postgres/postgres/blob/82ed67a/src/backend/utils/adt/jsonpath_exec.c#L1385

We allow .boolean() applied to a jbvBool, a jbvString (those are the only
two possibilities allowed by the standard), or to a jbvNumeric (!), but
only if it can be serialized and then parsed as an int4, otherwise we say
ERRCODE_NON_NUMERIC_SQL_JSON_ITEM, or if it survived all that we call it
true if it isn't zero.

I wonder what that alternative is doing there.

It also looks like the expected errcode (in the standard, if the item
was not boolean or string) would be 2202V "non-boolean SQL/JSON item" ...
which isn't in our errcodes.txt.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Conflict Detection and Resolution
Next
From: Kohei KaiGai
Date:
Subject: Re: assertion failure at cost_memoize_rescan()