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 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': 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; 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 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