projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0d81ad
)
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:18:18 +0000
(08:18 -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
|
blame
|
history
diff --git
a/src/backend/utils/adt/json.c
b/src/backend/utils/adt/json.c
index 19d74014ef532b5c96af3fe6ab5ff2d54c1ae5e1..c52f6732b054b626d93efa44ffad854c72c84332 100644
(file)
--- a/
src/backend/utils/adt/json.c
+++ b/
src/backend/utils/adt/json.c
@@
-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, " }");