projects
/
postgresql
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54b8ed6
)
Return NULL from json_object_agg if it gets no rows.
author
Andrew Dunstan
<andrew@dunslane.net>
Thu, 25 Sep 2014 12:18:18 +0000
(08:18 -0400)
committer
Andrew Dunstan
<andrew@dunslane.net>
Thu, 25 Sep 2014 12:19:44 +0000
(08:19 -0400)
This makes it consistent with the docs and with all other builtin
aggregates apart from count().
src/backend/utils/adt/json.c
patch
|
blob
|
history
diff --git
a/src/backend/utils/adt/json.c
b/src/backend/utils/adt/json.c
index 494a0285267a542582c8129a40fe551e2128cdb2..1820029fe956d68d28678826dfc0d33097245660 100644
(file)
--- a/
src/backend/utils/adt/json.c
+++ b/
src/backend/utils/adt/json.c
@@
-1973,7
+1973,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, " }");