aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/json.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2014-07-22 11:22:47 -0400
committerAndrew Dunstan <andrew@dunslane.net>2014-07-22 11:25:40 -0400
commita61f63df7d19006b36adf7ee402999aa5243097d (patch)
tree95288389fe7cbf098221fa44c3e3cc15b11e5fa4 /src/backend/utils/adt/json.c
parentfd18965e33da9dc7326803e61cf28d82237e3bba (diff)
downloadpostgresql-a61f63df7d19006b36adf7ee402999aa5243097d.tar.gz
postgresql-a61f63df7d19006b36adf7ee402999aa5243097d.zip
Allow empty string object keys in json_object().
This makes the behaviour consistent with the json parser, other json-generating functions, and the JSON standards.
Diffstat (limited to 'src/backend/utils/adt/json.c')
-rw-r--r--src/backend/utils/adt/json.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c
index 11c9135b482..8dd7a21fcff 100644
--- a/src/backend/utils/adt/json.c
+++ b/src/backend/utils/adt/json.c
@@ -2184,10 +2184,6 @@ json_object(PG_FUNCTION_ARGS)
errmsg("null value not allowed for object key")));
v = TextDatumGetCString(in_datums[i * 2]);
- if (v[0] == '\0')
- ereport(ERROR,
- (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("empty value not allowed for object key")));
if (i > 0)
appendStringInfoString(&result, ", ");
escape_json(&result, v);
@@ -2272,10 +2268,6 @@ json_object_two_arg(PG_FUNCTION_ARGS)
errmsg("null value not allowed for object key")));
v = TextDatumGetCString(key_datums[i]);
- if (v[0] == '\0')
- ereport(ERROR,
- (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
- errmsg("empty value not allowed for object key")));
if (i > 0)
appendStringInfoString(&result, ", ");
escape_json(&result, v);