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

Commit22212ba

Browse files
committed
PostgreSQL 17 support.
Caused by: - 4800a5dfb4c46d22b5d05f16c615bea6ff24a2bb (PostgreSQL) Refactor InitPostgres() to use bitwise option flags
1 parent92097fd commit22212ba

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

‎collector.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ pgws_collector_main(Datum main_arg)
351351
pqsignal(SIGTERM,handle_sigterm);
352352
pqsignal(SIGUSR1,procsignal_sigusr1_handler);
353353
BackgroundWorkerUnblockSignals();
354-
InitPostgresCompat(NULL,InvalidOid,NULL,InvalidOid,false, false,NULL);
354+
InitPostgresCompat(NULL,InvalidOid,NULL,InvalidOid,0,NULL);
355355
SetProcessingMode(NormalProcessing);
356356

357357
/* Make pg_wait_sampling recognisable in pg_stat_activity */

‎compat.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,26 @@ shm_mq_send_compat(shm_mq_handle *mqh, Size nbytes, const void *data,
4848
#endif
4949
}
5050

51+
#ifPG_VERSION_NUM<170000
52+
#defineINIT_PG_LOAD_SESSION_LIBS0x0001
53+
#defineINIT_PG_OVERRIDE_ALLOW_CONNS0x0002
54+
#endif
55+
5156
staticinlinevoid
5257
InitPostgresCompat(constchar*in_dbname,Oiddboid,
5358
constchar*username,Oiduseroid,
54-
boolload_session_libraries,
55-
booloverride_allow_connections,
59+
bits32flags,
5660
char*out_dbname)
5761
{
5862
#ifPG_VERSION_NUM >=170000
59-
InitPostgres(in_dbname,dboid,username,useroid, (load_session_libraries ?INIT_PG_LOAD_SESSION_LIBS :0) |
60-
(override_allow_connections ?INIT_PG_OVERRIDE_ALLOW_CONNS :0),out_dbname);
63+
InitPostgres(in_dbname,dboid,username,useroid,flags,out_dbname);
6164
#elifPG_VERSION_NUM >=150000
62-
InitPostgres(in_dbname,dboid,username,useroid,load_session_libraries,
63-
override_allow_connections,out_dbname);
65+
InitPostgres(in_dbname,dboid,username,useroid,
66+
flags&INIT_PG_LOAD_SESSION_LIBS,
67+
flags&INIT_PG_OVERRIDE_ALLOW_CONNS,out_dbname);
6468
#elifPG_VERSION_NUM >=110000
6569
InitPostgres(in_dbname,dboid,username,useroid,out_dbname,
66-
override_allow_connections);
70+
flags&INIT_PG_OVERRIDE_ALLOW_CONNS);
6771
#else
6872
InitPostgres(in_dbname,dboid,username,useroid,out_dbname);
6973
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp