Return valid json when converting an empty hstore.

Oskari Saarenmaa.
This commit is contained in:
Andrew Dunstan 2013-10-17 11:09:55 -04:00
parent 86029b31e5
commit bbe4deac1b
1 changed files with 2 additions and 10 deletions

View File

@ -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;