Re: jsonpath - Mailing list pgsql-hackers

From Nikita Glukhov
Subject Re: jsonpath
Date
Msg-id ac6e91d7-00fc-1123-9ecc-cf15c14038fc@postgrespro.ru
Whole thread Raw
In response to Re: jsonpath  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: jsonpath
List pgsql-hackers
Hi.

Attached patch enables throwing of errors in jsonb_path_match() in its 
non-silent mode when the jsonpath expression failed to return a singleton
boolean.  Previously, NULL was always returned, and it seemed to be 
inconsistent with the behavior of other functions, in which structural and 
other errors were not suppressed in non-silent mode.


We also think that jsonb_path_match() needs to be renamed, because its 
current name is confusing to many users.  "Match" name is more suitable for
jsonpath-based pattern matching like that (maybe we'll implement it later):
 jsonb_path_match(   '{ "a": 1, "b": 2,    "c": "str" }',   '{ "a": 1, "b": @ > 1, * : @.type == "string" }' )

Below are some possible name variants:
 jsonb_path_predicate() (original name) jsonb_path_pred() jsonb_path_test() jsonb_path_check() jsonb_path_bool()

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Lucas Viecelli
Date:
Subject: warning to publication created and wal_level is not set to logical
Next
From: Amit Langote
Date:
Subject: Re: ToDo: show size of partitioned table