Commit bbe4deac authored by Andrew Dunstan's avatar Andrew Dunstan

Return valid json when converting an empty hstore.

Oskari Saarenmaa.
parent 86029b31
......@@ -1240,11 +1240,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
dst;
if (count == 0)
{
out = palloc(1);
*out = '\0';
PG_RETURN_TEXT_P(cstring_to_text(out));
}
PG_RETURN_TEXT_P(cstring_to_text_with_len("{}",2));
buflen = 3;
......@@ -1369,11 +1365,7 @@ hstore_to_json(PG_FUNCTION_ARGS)
dst;
if (count == 0)
{
out = palloc(1);
*out = '\0';
PG_RETURN_TEXT_P(cstring_to_text(out));
}
PG_RETURN_TEXT_P(cstring_to_text_with_len("{}",2));
buflen = 3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment