Open KeXiangWang opened 1 day ago
Tried the workaround but it doesn't work, too.
dev=> select jsonb_agg(jsonb_build_object(t.*)) from t;
ERROR: Failed to run the query
Caused by these errors (recent errors listed first):
1: Failed to bind expression: jsonb_agg(jsonb_build_object(t.*))
2: Invalid input syntax: unexpected wildcard t.*
However,
dev=> select jsonb_agg(jsonb_build_object(k,v)) from t;
jsonb_agg
-----------
[]
(1 row)
So it looks like a miss of binder's feature i.e. expand the asterisk *
to concrete columns.
jsonb_build_object
is different from this proposal. A more close one is SELECT json_agg(row_to_json(T)) FROM T;
. But we don't have row_to_json
either.
Using wildcard as function argument is a special syntax: #10847
Example:
Currently,