Re: Patch bug: Fix jsonpath .* on Arrays

From: David E(dot) Wheeler <david(at)justatheory(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Patch bug: Fix jsonpath .* on Arrays
Date: 2024-06-05 00:45:03
Message-ID: 978C7F05-3EE1-40AE-92BB-AAF86B9F16CF@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jun 4, 2024, at 12:28 PM, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> This seems to be working correctly. Lax mode causes the first array level to unwrap and produce new context item values. Then the wildcard member accessor is applied to each. Numbers don’t have members so no matches exist in the first example. The object in the second indeed has a single member and so matches the wildcard and its value, the array, is returned.

Oh FFS, unwrapping still breaks my brain. You’re right, of course. Here’s a new patch that demonstrates that behavior, since that code path is not currently represented in tests AFAICT (I would have expected to have broken it with this patch).

D

Attachment Content-Type Size
0001-Add-tests-for-jsonpath-.-on-arrays.patch application/octet-stream 4.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ajin Cherian 2024-06-05 01:24:45 Re: Proposal: Filter irrelevant change before reassemble transactions during logical decoding
Previous Message Peter Smith 2024-06-05 00:18:53 Re: Pgoutput not capturing the generated columns