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

Commit04d524d

Browse files
committed
compat
1 parent9c2cede commit04d524d

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

‎collector.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +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 >=150000
355-
InitPostgres(NULL,InvalidOid,NULL,InvalidOid, false, false,NULL);
356-
#elifPG_VERSION_NUM >=110000
357-
InitPostgres(NULL,InvalidOid,NULL,InvalidOid,NULL, false);
358-
#else
359-
InitPostgres(NULL,InvalidOid,NULL,InvalidOid,NULL);
360-
#endif
353+
InitPostgresCompat(NULL,InvalidOid,NULL,InvalidOid, false, false,NULL);
361354
SetProcessingMode(NormalProcessing);
362355

363356
/* Make pg_wait_sampling recognisable in pg_stat_activity */

‎compat.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,18 @@ CreateTemplateTupleDescCompat(int nattrs, bool hasoid)
3333
returnCreateTemplateTupleDesc(nattrs,hasoid);
3434
#endif
3535
}
36+
37+
inlinevoidInitPostgresCompat(constchar*in_dbname,Oiddboid,
38+
constchar*username,Oiduseroid,
39+
boolload_session_libraries,
40+
booloverride_allow_connections,
41+
char*out_dbname)
42+
{
43+
#ifPG_VERSION_NUM >=150000
44+
InitPostgres(in_dbname,dboid,username,useroid,load_session_libraries,override_allow_connections,out_dbname);
45+
#elifPG_VERSION_NUM >=110000
46+
InitPostgres(in_dbname,dboid,username,useroid,out_dbname,override_allow_connections);
47+
#else
48+
InitPostgres(in_dbname,dboid,username,useroid,out_dbname);
49+
#endif
50+
}

‎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