Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbe4dea

Browse files
committed
Return valid json when converting an empty hstore.
Oskari Saarenmaa.
1 parent86029b3 commitbbe4dea

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

‎contrib/hstore/hstore_io.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,11 +1240,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
12401240
dst;
12411241

12421242
if (count==0)
1243-
{
1244-
out=palloc(1);
1245-
*out='\0';
1246-
PG_RETURN_TEXT_P(cstring_to_text(out));
1247-
}
1243+
PG_RETURN_TEXT_P(cstring_to_text_with_len("{}",2));
12481244

12491245
buflen=3;
12501246

@@ -1369,11 +1365,7 @@ hstore_to_json(PG_FUNCTION_ARGS)
13691365
dst;
13701366

13711367
if (count==0)
1372-
{
1373-
out=palloc(1);
1374-
*out='\0';
1375-
PG_RETURN_TEXT_P(cstring_to_text(out));
1376-
}
1368+
PG_RETURN_TEXT_P(cstring_to_text_with_len("{}",2));
13771369

13781370
buflen=3;
13791371

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp