mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
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().
This commit is contained in:
parent
b0d81adea6
commit
ecacbdbcee
@ -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, " }");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user