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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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 ( 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