JSON_ARRAY(query) on an empty set
JSON_ARRAY(SELECT ...) now returns [] for no rows, not NULL.
task
For customers 1 to 5 return customer_id and JSON_ARRAY(SELECT order_id ... ORDER BY 1 RETURNING jsonb) of their orders.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
JSON_ARRAY(SELECT ...) now returns [] for no rows, not NULL.
For customers 1 to 5 return customer_id and JSON_ARRAY(SELECT order_id ... ORDER BY 1 RETURNING jsonb) of their orders.