> Attached patches implementing all SQL/JSON functions excluding
JSON_TABLE:
>
> JSON_OBJECT()
> JSON_OBJECTAGG()
> JSON_ARRAY()
> JSON_ARRAYAGG()
>
> JSON_EXISTS()
> JSON_VALUE()
> JSON_QUERY()
Sorry if this is a stupid question, but is this patch intended to
implement any SQL/JSON functions? I'm basing this question on the
original patch post (quoted above). The patch appears to be focused
exclusively on "jsonpath expressions". I only ask because I think I
misinterpreted and spent some time wondering if I had missed a patch file.
So far, the jsonpath docs are very readable; however, I think a few
complete examples (full SELECT statements) of using jsonpath expressions
would be helpful to someone new to this technology. Does postgresql
provide a sample schema, similar to the Or*cle scott/tiger (emp/dept)
schema, we could use for examples? Alternatively, we could reference
something mentioned at
https://wiki.postgresql.org/wiki/Sample_Databases. I think it would be
nice if all the docs referenced the same schema, when possible.
For tests, would it be helpful to have some tests that
demonstrate/assert equality between "jsonb operators" and "jsonpath
expressions"? For example, using the existing regression test data the
following should assert equality in operator vs. expression:
SELECT
CASE WHEN jop_count = expr_count THEN 'pass' ELSE 'fail' END
FROM
(
-- jsonb operator
SELECT count(*)
FROM testjsonb
WHERE j->>'abstract' LIKE 'A%'
) as jop_count,
(
-- jsonpath expression
SELECT count(*)
FROM testjsonb
WHERE j @? '$.abstract ? (@ starts with "A")'
) as expr_count;