Re: jsonpath syntax extensions

From: Phil Krylov <phil(at)krylov(dot)eu>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>
Subject: Re: jsonpath syntax extensions
Date: 2022-03-28 20:33:37
Message-ID: 3c3b6f4ebb1d240182d0651590bdd096@krylov.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-03-21 21:09, Greg Stark wrote:
> This patch seems to be getting ignored. Like David I'm a bit puzzled
> because it doesn't seem like an especially obscure or difficult patch
> to review. Yet it's been multiple years without even a superficial
> "does it meet the coding requirements" review let alone a design
> review.
>
> Can we get a volunteer to at least give it a quick once-over? I don't
> think it's ideal to be doing this in the last CF but neither is it
> very appetizing to just shift it to the next CF without a review after
> two years...

I have just one suggestion: probably the object subscription syntax, as
in '$["keyA","keyB"]', should not require 'pg ' prefix, as it is a part
of the original JSONPath (https://goessner.net/articles/JsonPath/) and
is supported in multiple other implementations.

>> 6. Object subscription syntax. This gives us ability to specify what
>> key to
>> extract on runtime. The syntax is the same as ordinary array
>> subscription
>> syntax.
>>
>> -- non-existent $.x is simply skipped in lax mode
>> SELECT jsonb_path_query('{"a": "b", "b": "c"}', 'pg $[$.a, "x",
>> "a"]');
>> jsonb_path_query
>> ------------------
>> "c"
>> "b"

The variable reference support ('pg $[$.a]') probably _is_ a
PostgreSQL-specific extension, though.

-- Ph.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-03-28 20:33:57 Re: [PATCH] Enable SSL library detection via PQsslAttribute
Previous Message Stephen Frost 2022-03-28 20:30:27 Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file