Skip to content

Commit b79a816

Browse files
author
Marina Polyakova
committed
Merge remote-tracking branch 'origin/PGPRO-8877'
Conflicts: compat.h Caused by: - 22212ba (PGPRO-8877) PostgreSQL 17 support. - ed9f977 (master) Drop support for Postgres < 12
2 parents 8eaa130 + 22212ba commit b79a816

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
@@ -348,7 +348,7 @@ pgws_collector_main(Datum main_arg)
348348
pqsignal(SIGTERM, handle_sigterm);
349349
pqsignal(SIGUSR1, procsignal_sigusr1_handler);
350350
BackgroundWorkerUnblockSignals();
351-
InitPostgresCompat(NULL, InvalidOid, NULL, InvalidOid, false, false, NULL);
351+
InitPostgresCompat(NULL, InvalidOid, NULL, InvalidOid, 0, NULL);
352352
SetProcessingMode(NormalProcessing);
353353

354354
/* 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
@@ -28,22 +28,26 @@ shm_mq_send_compat(shm_mq_handle *mqh, Size nbytes, const void *data,
2828
#endif
2929
}
3030

31+
#if PG_VERSION_NUM < 170000
32+
#define INIT_PG_LOAD_SESSION_LIBS 0x0001
33+
#define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002
34+
#endif
35+
3136
static inline void
3237
InitPostgresCompat(const char *in_dbname, Oid dboid,
3338
const char *username, Oid useroid,
34-
bool load_session_libraries,
35-
bool override_allow_connections,
39+
bits32 flags,
3640
char *out_dbname)
3741
{
3842
#if PG_VERSION_NUM >= 170000
39-
InitPostgres(in_dbname, dboid, username, useroid, (load_session_libraries ? INIT_PG_LOAD_SESSION_LIBS : 0) |
40-
(override_allow_connections ? INIT_PG_OVERRIDE_ALLOW_CONNS : 0), out_dbname);
43+
InitPostgres(in_dbname, dboid, username, useroid, flags, out_dbname);
4144
#elif PG_VERSION_NUM >= 150000
42-
InitPostgres(in_dbname, dboid, username, useroid, load_session_libraries,
43-
override_allow_connections, out_dbname);
45+
InitPostgres(in_dbname, dboid, username, useroid,
46+
flags & INIT_PG_LOAD_SESSION_LIBS,
47+
flags & INIT_PG_OVERRIDE_ALLOW_CONNS, out_dbname);
4448
#else
4549
InitPostgres(in_dbname, dboid, username, useroid, out_dbname,
46-
override_allow_connections);
50+
flags & INIT_PG_OVERRIDE_ALLOW_CONNS);
4751
#endif
4852
}
4953

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy