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

Commit2f772b5

Browse files
committed
Add compability with pg11
1 parent26471d8 commit2f772b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎zson.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ PG_FUNCTION_INFO_V1(jsonb_to_zson);
3030
PG_FUNCTION_INFO_V1(zson_info);
3131
PG_FUNCTION_INFO_V1(debug_dump_jsonb);
3232

33+
/* In version 11 these macros have been changed */
34+
#ifPG_VERSION_NUM<110000
35+
#definePG_GETARG_JSONB_P(v) PG_GETARG_JSONB(v)
36+
#definePG_RETURN_JSONB_P(v) PG_RETURN_JSONB(v)
37+
#endif
38+
3339
#defineZSON_CURRENT_VERSION 0
3440

3541
#defineZSON_HEADER_SIZE (sizeof(uint8) + sizeof(uint32)*2)
@@ -477,7 +483,7 @@ zson_fastdecompress(const Dict* pdict,
477483
Datum
478484
jsonb_to_zson(PG_FUNCTION_ARGS)
479485
{
480-
Jsonb*jsonb=PG_GETARG_JSONB(0);
486+
Jsonb*jsonb=PG_GETARG_JSONB_P(0);
481487
uint8*jsonb_data= (uint8*)VARDATA(jsonb);
482488
Sizejsonb_data_size=VARSIZE(jsonb)-VARHDRSZ;
483489
uint8*encoded_buff,*encoded_header,*encoded_data;
@@ -580,7 +586,7 @@ zson_to_jsonb(PG_FUNCTION_ARGS)
580586

581587
decoded_size+=VARHDRSZ;
582588
SET_VARSIZE(jsonb,decoded_size);
583-
PG_RETURN_JSONB(jsonb);
589+
PG_RETURN_JSONB_P(jsonb);
584590
}
585591

586592
// zson -> "size, encoded size, other info"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp