Re: Patch bug: Fix jsonpath .* on Arrays

From: Степан Неретин <fenixrnd(at)mail(dot)ru>
To: David E(dot) Wheeler <david(at)justatheory(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: Patch bug: Fix jsonpath .* on Arrays
Date: 2024-06-25 04:46:25
Message-ID: 1719290785.518941016@f456.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

 
>Вторник, 25 июня 2024, 11:17 +07:00 от David E. Wheeler <david(at)justatheory(dot)com>:

>On Jun 7, 2024, at 10:23, David E. Wheeler < david(at)justatheory(dot)com > wrote:

>> Rebased and moved the new tests to the end of the file.
>Bah, sorry, that was the previous patch. Here’s v3.
>
>D

 
 
Hi! Looks good to me, but I have several comments.
Your patch improves tests, but why did you change formatting in jsonpath_exec.c? What's the motivation?
 
[1] select jsonb_path_query('[1,2,3,{"b": [3,4,5]}]', 'strict $.*');
I propose adding a similar test with explicitly specified lax mode: select jsonb_path_query('[1,2,3,{"b": [3,4,5]}]', 'lax $.*'); to show what lax mode is set by default.
 
Odd empty result for the test: select jsonb '[1,2,3,{"b": [3,4,5]}]' @? 'strict $.*';
I expected an error like in test [1]. This behavior is not obvious to me.
 
Everything else is cool. Thanks to the patch and the discussion above, I began to understand better how wildcards in JSON work.
Best regards, Stepan Neretin.
 

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stan Hu 2024-06-25 04:50:02 Re: [PATCH] Fix type redefinition build errors with macOS SDK 15.0
Previous Message Amit Langote 2024-06-25 03:23:36 Re: sql/json miscellaneous issue