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

Commit81c641f

Browse files
RekGRpthSergey Shinderuk
authored and
Sergey Shinderuk
committed
PostgreSQL 15 support.
Pass extra argument to InitPostgres as per upstream commit 31ed3cf746a.
1 parentdf1aa39 commit81c641f

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

‎collector.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,7 @@ collector_main(Datum main_arg)
350350
pqsignal(SIGTERM,handle_sigterm);
351351
pqsignal(SIGUSR1,procsignal_sigusr1_handler);
352352
BackgroundWorkerUnblockSignals();
353-
354-
#ifPG_VERSION_NUM >=110000
355-
InitPostgres(NULL,InvalidOid,NULL,InvalidOid,NULL, false);
356-
#else
357-
InitPostgres(NULL,InvalidOid,NULL,InvalidOid,NULL);
358-
#endif
353+
InitPostgresCompat(NULL,InvalidOid,NULL,InvalidOid, false, false,NULL);
359354
SetProcessingMode(NormalProcessing);
360355

361356
/* Make pg_wait_sampling recognisable in pg_stat_activity */

‎compat.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include"postgres.h"
2+
23
#include"access/tupdesc.h"
4+
#include"miscadmin.h"
35

46
#include"pg_wait_sampling.h"
57

@@ -33,3 +35,21 @@ CreateTemplateTupleDescCompat(int nattrs, bool hasoid)
3335
returnCreateTemplateTupleDesc(nattrs,hasoid);
3436
#endif
3537
}
38+
39+
inlinevoid
40+
InitPostgresCompat(constchar*in_dbname,Oiddboid,
41+
constchar*username,Oiduseroid,
42+
boolload_session_libraries,
43+
booloverride_allow_connections,
44+
char*out_dbname)
45+
{
46+
#ifPG_VERSION_NUM >=150000
47+
InitPostgres(in_dbname,dboid,username,useroid,load_session_libraries,
48+
override_allow_connections,out_dbname);
49+
#elifPG_VERSION_NUM >=110000
50+
InitPostgres(in_dbname,dboid,username,useroid,out_dbname,
51+
override_allow_connections);
52+
#else
53+
InitPostgres(in_dbname,dboid,username,useroid,out_dbname);
54+
#endif
55+
}

‎pg_wait_sampling.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,10 @@ extern shm_mq_result shm_mq_send_compat(shm_mq_handle *mqh, Size nbytes,
8888
constvoid*data,boolnowait,
8989
boolforce_flush);
9090
externTupleDescCreateTemplateTupleDescCompat(intnattrs,boolhasoid);
91+
externvoidInitPostgresCompat(constchar*in_dbname,Oiddboid,
92+
constchar*username,Oiduseroid,
93+
boolload_session_libraries,
94+
booloverride_allow_connections,
95+
char*out_dbname);
9196

9297
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp