Re: jsonpath syntax extensions - Mailing list pgsql-hackers

From Phil Krylov
Subject Re: jsonpath syntax extensions
Date
Msg-id 3c3b6f4ebb1d240182d0651590bdd096@krylov.eu
Whole thread Raw
In response to Re: jsonpath syntax extensions  (Greg Stark <stark@mit.edu>)
List 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.



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file
Next
From: Daniel Gustafsson
Date:
Subject: Re: [PATCH] Enable SSL library detection via PQsslAttribute