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

Commit8bd3842

Browse files
rjujuakorotkov
authored andcommitted
Add PostgreSQL 12 compatibility.
578b229718e (remove WITH OIDS support) changed CreateTemplateTupleDesc()signature.
1 parent03fb0d1 commit8bd3842

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎pg_wait_sampling.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,11 @@ pg_wait_sampling_get_current(PG_FUNCTION_ARGS)
380380
params->ts=GetCurrentTimestamp();
381381

382382
funcctx->user_fctx=params;
383+
#ifPG_VERSION_NUM >=120000
384+
tupdesc=CreateTemplateTupleDesc(4);
385+
#else
383386
tupdesc=CreateTemplateTupleDesc(4, false);
387+
#endif
384388
TupleDescInitEntry(tupdesc, (AttrNumber)1,"pid",
385389
INT4OID,-1,0);
386390
TupleDescInitEntry(tupdesc, (AttrNumber)2,"type",
@@ -585,7 +589,11 @@ pg_wait_sampling_get_profile(PG_FUNCTION_ARGS)
585589
funcctx->max_calls=profile->count;
586590

587591
/* Make tuple descriptor */
592+
#ifPG_VERSION_NUM >=120000
593+
tupdesc=CreateTemplateTupleDesc(5);
594+
#else
588595
tupdesc=CreateTemplateTupleDesc(5, false);
596+
#endif
589597
TupleDescInitEntry(tupdesc, (AttrNumber)1,"pid",
590598
INT4OID,-1,0);
591599
TupleDescInitEntry(tupdesc, (AttrNumber)2,"type",
@@ -703,7 +711,11 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
703711
funcctx->max_calls=history->count;
704712

705713
/* Make tuple descriptor */
714+
#ifPG_VERSION_NUM >=120000
715+
tupdesc=CreateTemplateTupleDesc(5);
716+
#else
706717
tupdesc=CreateTemplateTupleDesc(5, false);
718+
#endif
707719
TupleDescInitEntry(tupdesc, (AttrNumber)1,"pid",
708720
INT4OID,-1,0);
709721
TupleDescInitEntry(tupdesc, (AttrNumber)2,"sample_ts",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp