Hi Pavel,
Can I check a few assumptions about what you're suggesting for this task?
* Our ultimate goal is to give Postgres an implementation of the functions "JSON_EXISTS", "JSON_VALUE", and "JSON_QUERY" which fully comply with the SQL standards.
* The best representation of those standards is found here: [1].
* When [1] mentions a "JSON path expression" or "JSON path language", it's referring to the query language described here: [2].
* Even if other popular DBMS's deviate from [1], or other popular JSONPath implementations deviate from [2], we remain committed to a faithful implementation of [1].
* It's okay for my first commit to implement just two things: (a) a PG-internal implementation of JsonPath, and (b) a user-visible implementation of "JSON_QUERY" based on (a). Later commits could add implementations of "JSON_VALUE", "JSON_EXISTS", etc. in terms of (a).
Thanks,
Christian