Commit ecacbdbc authored by Andrew Dunstan's avatar Andrew Dunstan

Return NULL from json_object_agg if it gets no rows.

This makes it consistent with the docs and with all other builtin
aggregates apart from count().
parent b0d81ade
......@@ -1948,7 +1948,7 @@ json_object_agg_finalfn(PG_FUNCTION_ARGS)
state = PG_ARGISNULL(0) ? NULL : (StringInfo) PG_GETARG_POINTER(0);
if (state == NULL)
PG_RETURN_TEXT_P(cstring_to_text("{}"));
PG_RETURN_NULL();
appendStringInfoString(state, " }");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment