Re: jsonpath: Missing regex_like && starts with Errors?

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Chapman Flack <jcflack(at)acm(dot)org>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: jsonpath: Missing regex_like && starts with Errors?
Date: 2024-06-18 12:30:55
Message-ID: 6cb5a1cd-333b-449e-87a1-73e3802a3539@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18.06.24 04:17, Chapman Flack wrote:
> 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.

Are you saying we shouldn't allow .boolean() to be called on a JSON number?

I would concur that that's what the spec says.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2024-06-18 12:42:39 Re: Separate HEAP WAL replay logic into its own file
Previous Message Alexander Korotkov 2024-06-18 12:13:11 Re: Missing docs for new enable_group_by_reordering GUC