From f763a2645e22317bfa295c1c2cdb901adeaca1a9 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 17 Nov 2025 12:46:16 +0100 Subject: [PATCH 1/5] Include PG18 in supported versions --- src/monitor/version_compat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monitor/version_compat.h b/src/monitor/version_compat.h index 088f53909..82f36abc0 100644 --- a/src/monitor/version_compat.h +++ b/src/monitor/version_compat.h @@ -14,8 +14,8 @@ #include "postgres.h" -/* we support Postgres versions 10, 11, 12, 13, 14, 15, 16, and 17. */ -#if (PG_VERSION_NUM < 100000 || PG_VERSION_NUM >= 180000) +/* we support Postgres versions 10, 11, 12, 13, 14, 15, 16, 17, 18. */ +#if (PG_VERSION_NUM < 100000 || PG_VERSION_NUM >= 190000) #error "Unknown or unsupported postgresql version" #endif From 02e95cab66669de71a415fd85ac49ec61d2a4c1f Mon Sep 17 00:00:00 2001 From: "Bradford D. Boyle" Date: Mon, 17 Nov 2025 12:47:43 +0100 Subject: [PATCH 2/5] Fix missing variable declarations --- src/monitor/node_metadata.c | 1 + src/monitor/pg_auto_failover.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/monitor/node_metadata.c b/src/monitor/node_metadata.c index 07748c616..f80d2572b 100644 --- a/src/monitor/node_metadata.c +++ b/src/monitor/node_metadata.c @@ -19,6 +19,7 @@ /* list_qsort is only in Postgres 11 and 12 */ #include "version_compat.h" +#include "group_state_machine.h" #include "health_check.h" #include "metadata.h" #include "node_metadata.h" diff --git a/src/monitor/pg_auto_failover.c b/src/monitor/pg_auto_failover.c index c780a8fd4..e7c468627 100644 --- a/src/monitor/pg_auto_failover.c +++ b/src/monitor/pg_auto_failover.c @@ -35,7 +35,7 @@ #include "tcop/utility.h" -ProcessUtility_hook_type PreviousProcessUtility_hook = NULL; +static ProcessUtility_hook_type PreviousProcessUtility_hook = NULL; #if PG_VERSION_NUM >= 150000 From efdbb5f5bfdb90f7600c9c0b388d70772b8aab44 Mon Sep 17 00:00:00 2001 From: "Bradford D. Boyle" Date: Mon, 17 Nov 2025 12:17:28 +0000 Subject: [PATCH 3/5] Fix included copy of snprintf Close #1083 --- src/bin/lib/pg/snprintf.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/bin/lib/pg/snprintf.c b/src/bin/lib/pg/snprintf.c index 5831818f3..94dbfa6b9 100644 --- a/src/bin/lib/pg/snprintf.c +++ b/src/bin/lib/pg/snprintf.c @@ -550,16 +550,12 @@ dopr(PrintfTarget *target, const char *format, va_list args) longflag = 1; goto nextch2; case 'z': -#if SIZEOF_SIZE_T == 8 -#ifdef HAVE_LONG_INT_64 +#if SIZEOF_SIZE_T == SIZEOF_LONG longflag = 1; -#elif defined(HAVE_LONG_LONG_INT_64) +#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG longlongflag = 1; #else -#error "Don't know how to print 64bit integers" -#endif -#else - /* assume size_t is same size as int */ +#error "cannot find integer type of the same size as size_t" #endif goto nextch2; case 'h': @@ -817,16 +813,12 @@ find_arguments(const char *format, va_list args, longflag = 1; goto nextch1; case 'z': -#if SIZEOF_SIZE_T == 8 -#ifdef HAVE_LONG_INT_64 +#if SIZEOF_SIZE_T == SIZEOF_LONG longflag = 1; -#elif defined(HAVE_LONG_LONG_INT_64) +#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG longlongflag = 1; #else -#error "Don't know how to print 64bit integers" -#endif -#else - /* assume size_t is same size as int */ +#error "cannot find integer type of the same size as size_t" #endif goto nextch1; case 'h': From 6001bd85a458e0d995d1d64125420744fa3af3ed Mon Sep 17 00:00:00 2001 From: "Bradford D. Boyle" Date: Mon, 17 Nov 2025 12:21:00 +0000 Subject: [PATCH 4/5] Add expected output file for upgrade test and psql 18 --- src/monitor/expected/upgrade_1.out | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/monitor/expected/upgrade_1.out diff --git a/src/monitor/expected/upgrade_1.out b/src/monitor/expected/upgrade_1.out new file mode 100644 index 000000000..bc323db63 --- /dev/null +++ b/src/monitor/expected/upgrade_1.out @@ -0,0 +1,35 @@ +-- Copyright (c) Microsoft Corporation. All rights reserved. +-- Licensed under the PostgreSQL License. +CREATE EXTENSION pgautofailover VERSION '1.0'; +\dx pgautofailover + List of installed extensions + Name | Version | Default version | Schema | Description +----------------+---------+-----------------+--------+------------------ + pgautofailover | 1.0 | 2.2 | public | pg_auto_failover +(1 row) + +ALTER EXTENSION pgautofailover UPDATE TO '1.1'; +\dx pgautofailover + List of installed extensions + Name | Version | Default version | Schema | Description +----------------+---------+-----------------+--------+------------------ + pgautofailover | 1.1 | 2.2 | public | pg_auto_failover +(1 row) + +ALTER EXTENSION pgautofailover UPDATE TO '1.2'; +\dx pgautofailover + List of installed extensions + Name | Version | Default version | Schema | Description +----------------+---------+-----------------+--------+------------------ + pgautofailover | 1.2 | 2.2 | public | pg_auto_failover +(1 row) + +ALTER EXTENSION pgautofailover UPDATE TO '1.3'; +\dx pgautofailover + List of installed extensions + Name | Version | Default version | Schema | Description +----------------+---------+-----------------+--------+------------------ + pgautofailover | 1.3 | 2.2 | public | pg_auto_failover +(1 row) + +DROP EXTENSION pgautofailover; From 189d72781faa8c7392cd2f66fa4c017d39a579c7 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 17 Nov 2025 13:22:18 +0100 Subject: [PATCH 5/5] CI: Add 18 to versions to test Close #1098 --- .github/workflows/run-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d97ad12a6..c1b626782 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -23,6 +23,7 @@ jobs: - 15 - 16 - 17 + - 18 TEST: - multi - single