Re: Document that jsonpath == can be used as ANY

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Document that jsonpath == can be used as ANY
Date: 2026-10-01 00:34:57
Message-ID: CAKFQuwatQoNu+GgyAsUcNkW76WiS-M3KsDKg0utPUH7N8Sn+2A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 30, 2026 at 1:22 PM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:

> Em qua., 30 de set. de 2026 às 16:14, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> escreveu:
>
>> I feel like simply including an example here is insufficient. There
>> isn't anything special about == going on here;
>>
>
> Yes, I agree that an example only is insufficient.
> But the behavior of == is indeed different when it's an array or a scalar
> value.
> It will only work as an array only if assigned to a parameter, and a
> scalar works the same way for both.
>
>
Apparently this is a side-effect of lax mode:

select jsonb_path_query_array(
'[5,6,7,8,9]',
'strict $[*] ? (@ == $arr)',
'{"arr": [2,5,8]}'
);

produces and empty array: []

So I like the example only patch even less as it doesn't explain at all why
that random example has been included or how/why it works.

Maybe move the example and exposition to 19.6.2.2 ?

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-10-01 00:37:22 Re: Report index currently being vacuumed in pg_stat_progress_vacuum
Previous Message Tom Lane 2026-10-01 00:33:35 Re: [PATCH] intXshr, intXshl: return error on shift count out of range