git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
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.
2014年9月25日 12:18:18 +0000 (08:18 -0400)
2014年9月25日 12:18:18 +0000 (08:18 -0400)
This makes it consistent with the docs and with all other builtin
aggregates apart from count().


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, " }");
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /