From 6647f1120f8eec070ef61599d3f2240742c4b799 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Thu, 5 Mar 2026 18:22:51 +0300 Subject: [PATCH 01/10] Add PostgreSQL 18 --- .github/workflows/indigo-ci.yaml | 10 ++-- bingo/postgres/sql/18/bingo_am.sql.in | 66 +++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 bingo/postgres/sql/18/bingo_am.sql.in diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index b6f79b854e..e82910dd98 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1090,7 +1090,7 @@ jobs: strategy: fail-fast: false matrix: - postgres_major_version: [ 14, 15, 16, 17 ] + postgres_major_version: [ 14, 15, 16, 17, 18 ] runs-on: ubuntu-latest needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: @@ -1165,7 +1165,7 @@ jobs: strategy: fail-fast: false matrix: - postgres_major_version: [ "14", "15", "16" ] + postgres_major_version: [ "14", "15", "16", "17", "18" ] runs-on: windows-latest needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: @@ -1180,7 +1180,7 @@ jobs: git fetch --tags -f - name: Setup Postgres run: | - $pg_version = switch(${{ matrix.postgres_major_version }}) { "17" { "17.5" } "16" { "16.9" } "15" { "15.13" } "14" { "14.18" } } + $pg_version = switch(${{ matrix.postgres_major_version }}) { "18" { "18.3" } "17" { "17.9" } "16" { "16.13" } "15" { "15.17" } "14" { "14.22" } } curl -O https://get.enterprisedb.com/postgresql/postgresql-${pg_version}-1-windows-x64-binaries.zip Expand-Archive postgresql-${pg_version}-1-windows-x64-binaries.zip mv postgresql-${pg_version}-1-windows-x64-binaries/pgsql pgsql @@ -1202,7 +1202,7 @@ jobs: strategy: fail-fast: false matrix: - postgres_major_version: [ 14, 15, 16, 17 ] + postgres_major_version: [ 14, 15, 16, 17, 18 ] runs-on: macos-15 needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: @@ -1217,7 +1217,7 @@ jobs: git fetch --tags -f - name: Setup Postgres run: | - case ${{ matrix.postgres_major_version }} in 17) pg_version=17.5;; 16) pg_version=16.9;; 15) pg_version=15.13;; 14) pg_version=14.18;; esac; + case ${{ matrix.postgres_major_version }} in 18) pg_version=18.3;; 17) pg_version=17.9;; 16) pg_version=16.13;; 15) pg_version=15.17;; 14) pg_version=14.22;; esac; curl -O https://get.enterprisedb.com/postgresql/postgresql-${pg_version}-1-osx-binaries.zip unzip postgresql-${pg_version}-1-osx-binaries.zip mv pgsql/include/zlib.h pgsql/include/zlib.h.bck diff --git a/bingo/postgres/sql/18/bingo_am.sql.in b/bingo/postgres/sql/18/bingo_am.sql.in new file mode 100644 index 0000000000..09eb0030df --- /dev/null +++ b/bingo/postgres/sql/18/bingo_am.sql.in @@ -0,0 +1,66 @@ +CREATE OR REPLACE FUNCTION bingo_handler(internal) +RETURNS index_am_handler +AS 'BINGO_PATHNAME' +LANGUAGE C STRICT VOLATILE; + +CREATE ACCESS METHOD bingo_idx TYPE INDEX HANDLER bingo_handler; + + +--**************************** MANGO OPERATOR CLASS ********************* +CREATE OPERATOR CLASS molecule +FOR TYPE text USING bingo_idx +AS + OPERATOR 1 public.@ (text, sub), + OPERATOR 2 public.@ (text, exact), + OPERATOR 3 public.@ (text, smarts), + OPERATOR 4 public.@ (text, gross), + OPERATOR 5 public.< (text, mass), + OPERATOR 6 public.> (text, mass), + OPERATOR 7 public.@ (text, sim), + FUNCTION 1 matchSub(text, sub), + FUNCTION 2 matchExact(text, exact), + FUNCTION 3 matchSmarts(text, smarts), + FUNCTION 4 matchGross(text, gross), + FUNCTION 5 _match_mass_less(text, mass), + FUNCTION 6 _match_mass_great(text, mass), + FUNCTION 7 matchSim(text, sim); + +CREATE OPERATOR CLASS bmolecule +FOR TYPE bytea USING bingo_idx +AS + OPERATOR 1 public.@ (bytea, sub), + OPERATOR 2 public.@ (bytea, exact), + OPERATOR 3 public.@ (bytea, smarts), + OPERATOR 4 public.@ (bytea, gross), + OPERATOR 5 public.< (bytea, mass), + OPERATOR 6 public.> (bytea, mass), + OPERATOR 7 public.@ (bytea, sim), + FUNCTION 1 matchSub(bytea, sub), + FUNCTION 2 matchExact(bytea, exact), + FUNCTION 3 matchSmarts(bytea, smarts), + FUNCTION 4 matchGross(bytea, gross), + FUNCTION 5 _match_mass_less(bytea, mass), + FUNCTION 6 _match_mass_great(bytea, mass), + FUNCTION 7 matchSim(bytea, sim); + +--**************************** RINGO OPERATOR CLASS ********************* +CREATE OPERATOR CLASS reaction +FOR TYPE text USING bingo_idx +AS + OPERATOR 1 public.@ (text, rsub), + OPERATOR 2 public.@ (text, rexact), + OPERATOR 3 public.@ (text, rsmarts), + FUNCTION 1 matchRSub(text, rsub), + FUNCTION 2 matchRExact(text, rexact), + FUNCTION 3 matchRSmarts(text, rsmarts); + +CREATE OPERATOR CLASS breaction +FOR TYPE bytea USING bingo_idx +AS + OPERATOR 1 public.@ (bytea, rsub), + OPERATOR 2 public.@ (bytea, rexact), + OPERATOR 3 public.@ (bytea, rsmarts), + FUNCTION 1 matchRSub(bytea, rsub), + FUNCTION 2 matchRExact(bytea, rexact), + FUNCTION 3 matchRSmarts(bytea, rsmarts); + From 5ee3b2c979cbe744cc426bf437aa84a24fa91809 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:53:57 +0300 Subject: [PATCH 02/10] Set c++ standard to 20 for postresql --- bingo/postgres/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/bingo/postgres/CMakeLists.txt b/bingo/postgres/CMakeLists.txt index 9c5c8f4b34..e7f979eb49 100644 --- a/bingo/postgres/CMakeLists.txt +++ b/bingo/postgres/CMakeLists.txt @@ -16,6 +16,7 @@ else() list(GET PostgreSQL_VERSION_LIST 0 PostgreSQL_VERSION_MAJOR) list(GET PostgreSQL_VERSION_LIST 1 PostgreSQL_VERSION_MINOR) + set(CMAKE_CXX_STANDARD 20) file(GLOB ${PROJECT_NAME}_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/pg_am/*.cpp From 7890ccf36ed68d99f89ccdc2fec546c8f6c78696 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Fri, 6 Mar 2026 18:24:25 +0300 Subject: [PATCH 03/10] Test build bingo postgres --- .github/workflows/indigo-ci.yaml | 17 +++++++++++------ bingo/postgres/CMakeLists.txt | 2 -- .../postgres/src/pg_common/bingo_pg_buffer.cpp | 6 +++++- .../postgres/src/pg_common/bingo_pg_cursor.cpp | 4 +++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index e82910dd98..b606ecf377 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -18,6 +18,7 @@ jobs: static_analysis: runs-on: ubuntu-latest container: epmlsop/indigo-tester:latest + if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }} steps: - name: Checkout uses: actions/checkout@v4 @@ -35,6 +36,7 @@ jobs: set_matrix: runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }} outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} matrix-aarch64: ${{ steps.set-matrix.outputs.matrix-aarch64 }} @@ -1090,9 +1092,10 @@ jobs: strategy: fail-fast: false matrix: - postgres_major_version: [ 14, 15, 16, 17, 18 ] + # postgres_major_version: [ 14, 15, 16, 17, 18 ] + postgres_major_version: [ 18 ] runs-on: ubuntu-latest - needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] + # needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: - name: Checkout uses: actions/checkout@v4 @@ -1167,7 +1170,7 @@ jobs: matrix: postgres_major_version: [ "14", "15", "16", "17", "18" ] runs-on: windows-latest - needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] + # needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: - name: Checkout uses: actions/checkout@v4 @@ -1184,7 +1187,9 @@ jobs: curl -O https://get.enterprisedb.com/postgresql/postgresql-${pg_version}-1-windows-x64-binaries.zip Expand-Archive postgresql-${pg_version}-1-windows-x64-binaries.zip mv postgresql-${pg_version}-1-windows-x64-binaries/pgsql pgsql - cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h + - name: Apply patch + if: ${{ matrix.postgres_major_version > 17 }} + run: cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h - name: Build bingo-postgres run: | mkdir build @@ -1198,13 +1203,13 @@ jobs: path: dist/bingo-postgres*.zip build_bingo_postgres_macos_x86_64: - if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }} + # if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }} strategy: fail-fast: false matrix: postgres_major_version: [ 14, 15, 16, 17, 18 ] runs-on: macos-15 - needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] + # needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/bingo/postgres/CMakeLists.txt b/bingo/postgres/CMakeLists.txt index e7f979eb49..9380e8d0c9 100644 --- a/bingo/postgres/CMakeLists.txt +++ b/bingo/postgres/CMakeLists.txt @@ -16,8 +16,6 @@ else() list(GET PostgreSQL_VERSION_LIST 0 PostgreSQL_VERSION_MAJOR) list(GET PostgreSQL_VERSION_LIST 1 PostgreSQL_VERSION_MINOR) - set(CMAKE_CXX_STANDARD 20) - file(GLOB ${PROJECT_NAME}_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/pg_am/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/pg_am/*.c diff --git a/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp b/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp index a075e2301e..c75ec6490c 100644 --- a/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp +++ b/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp @@ -290,7 +290,11 @@ void BingoPgBuffer::formIndexTuple(void* map_data, int size) TupleDesc index_desc = CreateTemplateTupleDesc(1, false); #endif -#if PG_VERSION_NUM / 100 >= 1100 +#if PG_VERSION_NUM / 100 >= 1800 + TupleDescAttr(index_desc, 0).attlen = size; + TupleDescAttr(index_desc, 0).attalign = 'c'; + TupleDescAttr(index_desc, 0).attbyval = false; +#elif PG_VERSION_NUM / 100 >= 1100 index_desc->attrs[0].attlen = size; index_desc->attrs[0].attalign = 'c'; index_desc->attrs[0].attbyval = false; diff --git a/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp b/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp index ce0fcedceb..5b6a4c3103 100644 --- a/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp +++ b/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp @@ -201,7 +201,9 @@ unsigned int BingoPgCursor::getArgOid(int arg_idx) TupleDesc tupdesc = SPI_tuptable->tupdesc; if (arg_idx >= tupdesc->natts) elog(ERROR, "internal error: can not get argument %d natts = %d", arg_idx, tupdesc->natts); -#if PG_VERSION_NUM / 100 >= 1100 +#if PG_VERSION_NUM / 100 >= 1800 + result = TupleDescAttr(tupdesc, arg_idx).atttypid; +#elif PG_VERSION_NUM / 100 >= 1100 result = tupdesc->attrs[arg_idx].atttypid; #else result = tupdesc->attrs[arg_idx]->atttypid; From f41f0084363dc2229ca8200c80254c2c86b7ad6d Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Fri, 6 Mar 2026 18:53:58 +0300 Subject: [PATCH 04/10] fix typo --- .github/workflows/indigo-ci.yaml | 7 ++++--- bingo/postgres/src/pg_common/bingo_pg_buffer.cpp | 6 +++--- bingo/postgres/src/pg_common/bingo_pg_cursor.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index b606ecf377..e46a949bf3 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1168,7 +1168,8 @@ jobs: strategy: fail-fast: false matrix: - postgres_major_version: [ "14", "15", "16", "17", "18" ] + # postgres_major_version: [ "14", "15", "16", "17", "18" ] + postgres_major_version: [ "18" ] runs-on: windows-latest # needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: @@ -1188,7 +1189,7 @@ jobs: Expand-Archive postgresql-${pg_version}-1-windows-x64-binaries.zip mv postgresql-${pg_version}-1-windows-x64-binaries/pgsql pgsql - name: Apply patch - if: ${{ matrix.postgres_major_version > 17 }} + if: ${{ matrix.postgres_major_version < 18 }} run: cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h - name: Build bingo-postgres run: | @@ -1203,7 +1204,7 @@ jobs: path: dist/bingo-postgres*.zip build_bingo_postgres_macos_x86_64: - # if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }} + if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }} strategy: fail-fast: false matrix: diff --git a/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp b/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp index c75ec6490c..001adf599b 100644 --- a/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp +++ b/bingo/postgres/src/pg_common/bingo_pg_buffer.cpp @@ -291,9 +291,9 @@ void BingoPgBuffer::formIndexTuple(void* map_data, int size) #endif #if PG_VERSION_NUM / 100 >= 1800 - TupleDescAttr(index_desc, 0).attlen = size; - TupleDescAttr(index_desc, 0).attalign = 'c'; - TupleDescAttr(index_desc, 0).attbyval = false; + TupleDescAttr(index_desc, 0)->attlen = size; + TupleDescAttr(index_desc, 0)->attalign = 'c'; + TupleDescAttr(index_desc, 0)->attbyval = false; #elif PG_VERSION_NUM / 100 >= 1100 index_desc->attrs[0].attlen = size; index_desc->attrs[0].attalign = 'c'; diff --git a/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp b/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp index 5b6a4c3103..c9f79b98d2 100644 --- a/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp +++ b/bingo/postgres/src/pg_common/bingo_pg_cursor.cpp @@ -202,7 +202,7 @@ unsigned int BingoPgCursor::getArgOid(int arg_idx) if (arg_idx >= tupdesc->natts) elog(ERROR, "internal error: can not get argument %d natts = %d", arg_idx, tupdesc->natts); #if PG_VERSION_NUM / 100 >= 1800 - result = TupleDescAttr(tupdesc, arg_idx).atttypid; + result = TupleDescAttr(tupdesc, arg_idx)->atttypid; #elif PG_VERSION_NUM / 100 >= 1100 result = tupdesc->attrs[arg_idx].atttypid; #else From 9b124bdae017b7444b34f16b89608c6268eb9e50 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:21:22 +0300 Subject: [PATCH 05/10] fix typo --- .github/workflows/indigo-ci.yaml | 5 +- bingo/postgres/patches/generic-msvc-18.h | 92 ++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 bingo/postgres/patches/generic-msvc-18.h diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index e46a949bf3..4b66fa6567 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1191,6 +1191,9 @@ jobs: - name: Apply patch if: ${{ matrix.postgres_major_version < 18 }} run: cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h + - name: Apply patch 18 + if: ${{ matrix.postgres_major_version >= 18 }} + run: cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h - name: Build bingo-postgres run: | mkdir build @@ -1210,7 +1213,7 @@ jobs: matrix: postgres_major_version: [ 14, 15, 16, 17, 18 ] runs-on: macos-15 - # needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] + needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/bingo/postgres/patches/generic-msvc-18.h b/bingo/postgres/patches/generic-msvc-18.h new file mode 100644 index 0000000000..7e63677d1d --- /dev/null +++ b/bingo/postgres/patches/generic-msvc-18.h @@ -0,0 +1,92 @@ +/*------------------------------------------------------------------------- + * + * generic-msvc.h + * Atomic operations support when using MSVC + * + * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * NOTES: + * + * Documentation: + * * Interlocked Variable Access + * http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx + * + * src/include/port/atomics/generic-msvc.h + * + *------------------------------------------------------------------------- + */ +#include +#include + +/* intentionally no include guards, should only be included by atomics.h */ +#ifndef INSIDE_ATOMICS_H +#error "should be included via atomics.h" +#endif + +/* Should work on both MSVC and Borland. */ +#pragma intrinsic(_ReadWriteBarrier) +#define pg_compiler_barrier_impl() _ReadWriteBarrier() + +#ifndef pg_memory_barrier_impl +#define pg_memory_barrier_impl() MemoryBarrier() +#endif + +#define PG_HAVE_ATOMIC_U32_SUPPORT +typedef struct pg_atomic_uint32 +{ + volatile uint32 value; +} pg_atomic_uint32; + +#define PG_HAVE_ATOMIC_U64_SUPPORT +typedef struct __declspec(align(8)) pg_atomic_uint64 +{ + volatile uint64 value; +} pg_atomic_uint64; + +#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 +static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32* ptr, uint32* expected, uint32 newval) +{ + bool ret; + uint32 current; + current = InterlockedCompareExchange(&ptr->value, newval, *expected); + ret = current == *expected; + *expected = current; + return ret; +} + +#define PG_HAVE_ATOMIC_FETCH_ADD_U32 +static inline uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32* ptr, int32 add_) +{ + return InterlockedExchangeAdd(&ptr->value, add_); +} + +/* + * The non-intrinsics versions are only available in vista upwards, so use the + * intrinsic version. Only supported on >486, but we require XP as a minimum + * baseline, which doesn't support the 486, so we don't need to add checks for + * that case. + */ +#pragma intrinsic(_InterlockedCompareExchange64) + +#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 +static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64* ptr, uint64* expected, uint64 newval) +{ + bool ret; + uint64 current; + current = _InterlockedCompareExchange64((volatile LONG64*)&ptr->value, newval, *expected); + ret = current == *expected; + *expected = current; + return ret; +} + +/* Only implemented on itanium and 64bit builds */ +#ifdef _WIN64 +#pragma intrinsic(_InterlockedExchangeAdd64) + +#define PG_HAVE_ATOMIC_FETCH_ADD_U64 +static inline uint64 pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64* ptr, int64 add_) +{ + return _InterlockedExchangeAdd64((volatile LONG64*)&ptr->value, add_); +} +#endif /* _WIN64 */ From 1e6248fe017c7a82ff4b08337314485286abfd74 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:39:40 +0300 Subject: [PATCH 06/10] Fix typo --- .github/workflows/indigo-ci.yaml | 2 +- bingo/postgres/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index 4b66fa6567..ca0b41f5ea 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1169,7 +1169,7 @@ jobs: fail-fast: false matrix: # postgres_major_version: [ "14", "15", "16", "17", "18" ] - postgres_major_version: [ "18" ] + postgres_major_version: [ "17", "18" ] runs-on: windows-latest # needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64] steps: diff --git a/bingo/postgres/CMakeLists.txt b/bingo/postgres/CMakeLists.txt index 9380e8d0c9..cfd6117ca2 100644 --- a/bingo/postgres/CMakeLists.txt +++ b/bingo/postgres/CMakeLists.txt @@ -39,6 +39,10 @@ else() PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/pg_core) if (WIN32) + if (PostgreSQL_VERSION_MAJOR GREATER 16) + set(CMAKE_CXX_STANDARD 20) + endif() + string(REPLACE "libpq.lib" "postgres.lib" PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARIES}) if (MSVC) target_include_directories(${PROJECT_NAME} From 324af5987c2c7a27322409a362773fa47f42935b Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:31:18 +0300 Subject: [PATCH 07/10] fix typo --- bingo/postgres/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bingo/postgres/CMakeLists.txt b/bingo/postgres/CMakeLists.txt index cfd6117ca2..65fde6736f 100644 --- a/bingo/postgres/CMakeLists.txt +++ b/bingo/postgres/CMakeLists.txt @@ -40,7 +40,7 @@ else() if (WIN32) if (PostgreSQL_VERSION_MAJOR GREATER 16) - set(CMAKE_CXX_STANDARD 20) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) endif() string(REPLACE "libpq.lib" "postgres.lib" PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARIES}) From 7755fdcfa8c3d6e8a219d65f5ac2fc43e19b8739 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:38:34 +0300 Subject: [PATCH 08/10] Fix win postgresql --- .github/workflows/indigo-ci.yaml | 4 +- bingo/postgres/patches/port.h | 545 +++++++++++++++++++++++++++++++ 2 files changed, 548 insertions(+), 1 deletion(-) create mode 100644 bingo/postgres/patches/port.h diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index ca0b41f5ea..8630dbfa41 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1193,7 +1193,9 @@ jobs: run: cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h - name: Apply patch 18 if: ${{ matrix.postgres_major_version >= 18 }} - run: cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h + run: | + cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h + cp bingo/postgres/patches/port.h pgsql/include/server/port.h - name: Build bingo-postgres run: | mkdir build diff --git a/bingo/postgres/patches/port.h b/bingo/postgres/patches/port.h new file mode 100644 index 0000000000..18dcb52332 --- /dev/null +++ b/bingo/postgres/patches/port.h @@ -0,0 +1,545 @@ +/*------------------------------------------------------------------------- + * + * port.h + * Header for src/port/ compatibility functions. + * + * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/include/port.h + * + *------------------------------------------------------------------------- + */ +#ifndef PG_PORT_H +#define PG_PORT_H + +#include + +/* + * Windows has enough specialized port stuff that we push most of it off + * into another file. + * Note: Some CYGWIN includes might #define WIN32. + */ +#if defined(WIN32) && !defined(__CYGWIN__) +#include "port/win32_port.h" +#endif + +/* socket has a different definition on WIN32 */ +#ifndef WIN32 +typedef int pgsocket; + +#define PGINVALID_SOCKET (-1) +#else +typedef SOCKET pgsocket; + +#define PGINVALID_SOCKET INVALID_SOCKET +#endif + +/* if platform lacks socklen_t, we assume this will work */ +#ifndef HAVE_SOCKLEN_T +typedef unsigned int socklen_t; +#endif + +/* non-blocking */ +extern bool pg_set_noblock(pgsocket sock); +extern bool pg_set_block(pgsocket sock); + +/* Portable path handling for Unix/Win32 (in path.c) */ + +extern bool has_drive_prefix(const char* path); +extern char* first_dir_separator(const char* filename); +extern char* last_dir_separator(const char* filename); +extern char* first_path_var_separator(const char* pathlist); +extern void join_path_components(char* ret_path, const char* head, const char* tail); +extern void canonicalize_path(char* path); +extern void canonicalize_path_enc(char* path, int encoding); +extern void make_native_path(char* filename); +extern void cleanup_path(char* path); +extern bool path_contains_parent_reference(const char* path); +extern bool path_is_relative_and_below_cwd(const char* path); +extern bool path_is_prefix_of_path(const char* path1, const char* path2); +extern char* make_absolute_path(const char* path); +extern const char* get_progname(const char* argv0); +extern void get_share_path(const char* my_exec_path, char* ret_path); +extern void get_etc_path(const char* my_exec_path, char* ret_path); +extern void get_include_path(const char* my_exec_path, char* ret_path); +extern void get_pkginclude_path(const char* my_exec_path, char* ret_path); +extern void get_includeserver_path(const char* my_exec_path, char* ret_path); +extern void get_lib_path(const char* my_exec_path, char* ret_path); +extern void get_pkglib_path(const char* my_exec_path, char* ret_path); +extern void get_locale_path(const char* my_exec_path, char* ret_path); +extern void get_doc_path(const char* my_exec_path, char* ret_path); +extern void get_html_path(const char* my_exec_path, char* ret_path); +extern void get_man_path(const char* my_exec_path, char* ret_path); +extern bool get_home_path(char* ret_path); +extern void get_parent_directory(char* path); + +/* common/pgfnames.c */ +extern char** pgfnames(const char* path); +extern void pgfnames_cleanup(char** filenames); + +#define IS_NONWINDOWS_DIR_SEP(ch) ((ch) == '/') +#define is_nonwindows_absolute_path(filename) (IS_NONWINDOWS_DIR_SEP((filename)[0])) + +#define IS_WINDOWS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') +/* See path_is_relative_and_below_cwd() for how we handle 'E:abc'. */ +#define is_windows_absolute_path(filename) \ + (IS_WINDOWS_DIR_SEP((filename)[0]) || (isalpha((unsigned char)((filename)[0])) && (filename)[1] == ':' && IS_WINDOWS_DIR_SEP((filename)[2]))) + +/* + * is_absolute_path and IS_DIR_SEP + * + * By using macros here we avoid needing to include path.c in libpq. + */ +#ifndef WIN32 +#define IS_DIR_SEP(ch) IS_NONWINDOWS_DIR_SEP(ch) +#define is_absolute_path(filename) is_nonwindows_absolute_path(filename) +#else +#define IS_DIR_SEP(ch) IS_WINDOWS_DIR_SEP(ch) +#define is_absolute_path(filename) is_windows_absolute_path(filename) +#endif + +/* + * This macro provides a centralized list of all errnos that identify + * hard failure of a previously-established network connection. + * The macro is intended to be used in a switch statement, in the form + * "case ALL_CONNECTION_FAILURE_ERRNOS:". + * + * Note: this groups EPIPE and ECONNRESET, which we take to indicate a + * probable server crash, with other errors that indicate loss of network + * connectivity without proving much about the server's state. Places that + * are actually reporting errors typically single out EPIPE and ECONNRESET, + * while allowing the network failures to be reported generically. + */ +#define ALL_CONNECTION_FAILURE_ERRNOS \ + EPIPE: \ + case ECONNRESET: \ + case ECONNABORTED: \ + case EHOSTDOWN: \ + case EHOSTUNREACH: \ + case ENETDOWN: \ + case ENETRESET: \ + case ENETUNREACH: \ + case ETIMEDOUT + +/* Portable locale initialization (in exec.c) */ +extern void set_pglocale_pgservice(const char* argv0, const char* app); + +/* Portable way to find and execute binaries (in exec.c) */ +extern int validate_exec(const char* path); +extern int find_my_exec(const char* argv0, char* retpath); +extern int find_other_exec(const char* argv0, const char* target, const char* versionstr, char* retpath); +extern char* pipe_read_line(char* cmd); + +/* Doesn't belong here, but this is used with find_other_exec(), so... */ +#define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" + +#ifdef EXEC_BACKEND +/* Disable ASLR before exec, for developer builds only (in exec.c) */ +extern int pg_disable_aslr(void); +#endif + +#if defined(WIN32) || defined(__CYGWIN__) +#define EXE ".exe" +#else +#define EXE "" +#endif + +#if defined(WIN32) && !defined(__CYGWIN__) +#define DEVNULL "nul" +#else +#define DEVNULL "/dev/null" +#endif + +/* Portable delay handling */ +extern void pg_usleep(long microsec); + +/* Portable SQL-like case-independent comparisons and conversions */ +extern int pg_strcasecmp(const char* s1, const char* s2); +extern int pg_strncasecmp(const char* s1, const char* s2, size_t n); +extern unsigned char pg_toupper(unsigned char ch); +extern unsigned char pg_tolower(unsigned char ch); +extern unsigned char pg_ascii_toupper(unsigned char ch); +extern unsigned char pg_ascii_tolower(unsigned char ch); + +/* + * Beginning in v12, we always replace snprintf() and friends with our own + * implementation. This symbol is no longer consulted by the core code, + * but keep it defined anyway in case any extensions are looking at it. + */ +#define USE_REPL_SNPRINTF 1 + +/* + * Versions of libintl >= 0.13 try to replace printf() and friends with + * macros to their own versions that understand the %$ format. We do the + * same, so disable their macros, if they exist. + */ +#ifdef vsnprintf +#undef vsnprintf +#endif +#ifdef snprintf +#undef snprintf +#endif +#ifdef vsprintf +#undef vsprintf +#endif +#ifdef sprintf +#undef sprintf +#endif +#ifdef vfprintf +#undef vfprintf +#endif +#ifdef fprintf +#undef fprintf +#endif +#ifdef vprintf +#undef vprintf +#endif +#ifdef printf +#undef printf +#endif + +extern int pg_vsnprintf(char* str, size_t count, const char* fmt, va_list args) pg_attribute_printf(3, 0); +extern int pg_snprintf(char* str, size_t count, const char* fmt, ...) pg_attribute_printf(3, 4); +extern int pg_vsprintf(char* str, const char* fmt, va_list args) pg_attribute_printf(2, 0); +extern int pg_sprintf(char* str, const char* fmt, ...) pg_attribute_printf(2, 3); +extern int pg_vfprintf(FILE* stream, const char* fmt, va_list args) pg_attribute_printf(2, 0); +extern int pg_fprintf(FILE* stream, const char* fmt, ...) pg_attribute_printf(2, 3); +extern int pg_vprintf(const char* fmt, va_list args) pg_attribute_printf(1, 0); +extern int pg_printf(const char* fmt, ...) pg_attribute_printf(1, 2); + +#ifndef WIN32 +/* + * We add a pg_ prefix as a warning that the Windows implementations have the + * non-standard side-effect of changing the current file position. + */ +#define pg_pread pread +#define pg_pwrite pwrite +#endif + +/* + * We use __VA_ARGS__ for printf to prevent replacing references to + * the "printf" format archetype in format() attribute declarations. + * That unfortunately means that taking a function pointer to printf + * will not do what we'd wish. (If you need to do that, you must name + * pg_printf explicitly.) For printf's sibling functions, use + * parameterless macros so that function pointers will work unsurprisingly. + */ +#define vsnprintf pg_vsnprintf +#define snprintf pg_snprintf +#define vsprintf pg_vsprintf +#define sprintf pg_sprintf +#define vfprintf pg_vfprintf +#define fprintf pg_fprintf +#define vprintf pg_vprintf +#define printf(...) pg_printf(__VA_ARGS__) + +/* This is also provided by snprintf.c */ +extern int pg_strfromd(char* str, size_t count, int precision, double value); + +/* Replace strerror() with our own, somewhat more robust wrapper */ +extern char* pg_strerror(int errnum); +#define strerror pg_strerror + +/* Likewise for strerror_r(); note we prefer the GNU API for that */ +extern char* pg_strerror_r(int errnum, char* buf, size_t buflen); +#define strerror_r pg_strerror_r +#define PG_STRERROR_R_BUFLEN 256 /* Recommended buffer size for strerror_r */ + +/* Wrap strsignal(), or provide our own version if necessary */ +extern const char* pg_strsignal(int signum); + +extern int pclose_check(FILE* stream); + +/* Global variable holding time zone information. */ +#if defined(WIN32) || defined(__CYGWIN__) +#define TIMEZONE_GLOBAL _timezone +#define TZNAME_GLOBAL _tzname +#else +#define TIMEZONE_GLOBAL timezone +#define TZNAME_GLOBAL tzname +#endif + +#if defined(WIN32) || defined(__CYGWIN__) +/* + * Win32 doesn't have reliable rename/unlink during concurrent access. + */ +extern int pgrename(const char* from, const char* to); +extern int pgunlink(const char* path); + +/* Include this first so later includes don't see these defines */ +#ifdef _MSC_VER +#include +#endif + +#define rename(from, to) pgrename(from, to) +#define unlink(path) pgunlink(path) +#endif /* defined(WIN32) || defined(__CYGWIN__) */ + +/* + * Win32 also doesn't have symlinks, but we can emulate them with + * junction points on newer Win32 versions. + * + * Cygwin has its own symlinks which work on Win95/98/ME where + * junction points don't, so use those instead. We have no way of + * knowing what type of system Cygwin binaries will be run on. + * Note: Some CYGWIN includes might #define WIN32. + */ +#if defined(WIN32) && !defined(__CYGWIN__) +extern int pgsymlink(const char* oldpath, const char* newpath); +extern int pgreadlink(const char* path, char* buf, size_t size); + +#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath) +#define readlink(path, buf, size) pgreadlink(path, buf, size) +#endif + +extern bool rmtree(const char* path, bool rmtopdir); + +#if defined(WIN32) && !defined(__CYGWIN__) + +/* + * We want the 64-bit variant of lseek(). + * + * For Visual Studio, this must be after to avoid messing up its + * lseek() and _lseeki64() function declarations. + * + * For MinGW there is already a macro, so we have to undefine it (depending on + * _FILE_OFFSET_BITS, it may point at its own lseek64, but we don't want to + * count on that being set). + */ +#undef lseek +#define lseek(a, b, c) _lseeki64((a), (b), (c)) + +/* + * We want the 64-bit variant of chsize(). It sets errno and also returns it, + * so convert non-zero result to -1 to match POSIX. + * + * Prevent MinGW from declaring functions, and undefine its macro before we + * define our own. + */ +#ifndef _MSC_VER +#define FTRUNCATE_DEFINED +#include +#undef ftruncate +#endif +#define ftruncate(a, b) (_chsize_s((a), (b)) == 0 ? 0 : -1) + +/* + * open() and fopen() replacements to allow deletion of open files and + * passing of other special options. + */ +extern HANDLE pgwin32_open_handle(const char*, int, bool); +extern int pgwin32_open(const char*, int, ...); +extern FILE* pgwin32_fopen(const char*, const char*); +/* #define open(a, b, c) pgwin32_open(a, b, c) */ +#define fopen(a, b) pgwin32_fopen(a, b) + +/* + * Mingw-w64 headers #define popen and pclose to _popen and _pclose. We want + * to use our popen wrapper, rather than plain _popen, so override that. For + * consistency, use our version of pclose, too. + */ +#ifdef popen +#undef popen +#endif +#ifdef pclose +#undef pclose +#endif + +/* + * system() and popen() replacements to enclose the command in an extra + * pair of quotes. + */ +extern int pgwin32_system(const char* command); +extern FILE* pgwin32_popen(const char* command, const char* type); + +#define system(a) pgwin32_system(a) +#define popen(a, b) pgwin32_popen(a, b) +#define pclose(a) _pclose(a) + +#else /* !WIN32 */ + +/* + * Win32 requires a special close for sockets and pipes, while on Unix + * close() does them all. + */ +#define closesocket close +#endif /* WIN32 */ + +/* + * On Windows, setvbuf() does not support _IOLBF mode, and interprets that + * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) + * crashes outright if "parameter validation" is enabled. Therefore, in + * places where we'd like to select line-buffered mode, we fall back to + * unbuffered mode instead on Windows. Always use PG_IOLBF not _IOLBF + * directly in order to implement this behavior. + */ +#ifndef WIN32 +#define PG_IOLBF _IOLBF +#else +#define PG_IOLBF _IONBF +#endif + +/* + * Default "extern" declarations or macro substitutes for library routines. + * When necessary, these routines are provided by files in src/port/. + */ + +/* Type to use with fseeko/ftello */ +#ifndef WIN32 /* WIN32 is handled in port/win32_port.h */ +#define pgoff_t off_t +#endif + +#ifndef HAVE_GETPEEREID +/* On Windows, Perl might have incompatible definitions of uid_t and gid_t. */ +#ifndef PLPERL_HAVE_UID_GID +extern int getpeereid(int sock, uid_t* uid, gid_t* gid); +#endif +#endif + +/* + * Glibc doesn't use the builtin for clang due to a *gcc* bug in a version + * newer than the gcc compatibility clang claims to have. This would cause a + * *lot* of superfluous function calls, therefore revert when using clang. In + * C++ there's issues with libc++ (not libstdc++), so disable as well. + */ +#if defined(__clang__) && !defined(__cplusplus) +/* needs to be separate to not confuse other compilers */ +#if __has_builtin(__builtin_isinf) +/* need to include before, to avoid getting overwritten */ +#include +#undef isinf +#define isinf __builtin_isinf +#endif /* __has_builtin(isinf) */ +#endif /* __clang__ && !__cplusplus */ + +#ifndef HAVE_EXPLICIT_BZERO +extern void explicit_bzero(void* buf, size_t len); +#endif + +#ifdef HAVE_BUGGY_STRTOF +extern float pg_strtof(const char* nptr, char** endptr); +#define strtof(a, b) (pg_strtof((a), (b))) +#endif + +#ifdef WIN32 +/* src/port/win32link.c */ +extern int link(const char* src, const char* dst); +#endif + +#ifndef HAVE_MKDTEMP +extern char* mkdtemp(char* path); +#endif + +#ifndef HAVE_INET_ATON +#include +#include +extern int inet_aton(const char* cp, struct in_addr* addr); +#endif + +#if !HAVE_DECL_STRLCAT +extern size_t strlcat(char* dst, const char* src, size_t siz); +#endif + +#if !HAVE_DECL_STRLCPY +extern size_t strlcpy(char* dst, const char* src, size_t siz); +#endif + +#if !HAVE_DECL_STRNLEN +extern size_t strnlen(const char* str, size_t maxlen); +#endif + +#if !HAVE_DECL_STRSEP +extern char* strsep(char** stringp, const char* delim); +#endif + +#if !HAVE_DECL_TIMINGSAFE_BCMP +extern int timingsafe_bcmp(const void* b1, const void* b2, size_t len); +#endif + +/* + * Callers should use the qsort() macro defined below instead of calling + * pg_qsort() directly. + */ +extern void pg_qsort(void* base, size_t nel, size_t elsize, int (*cmp)(const void*, const void*)); +extern int pg_qsort_strcmp(const void* a, const void* b); + +#define qsort(a, b, c, d) pg_qsort(a, b, c, d) + +typedef int (*qsort_arg_comparator)(const void* a, const void* b, void* arg); + +extern void qsort_arg(void* base, size_t nel, size_t elsize, qsort_arg_comparator cmp, void* arg); + +extern void qsort_interruptible(void* base, size_t nel, size_t elsize, qsort_arg_comparator cmp, void* arg); + +extern void* bsearch_arg(const void* key, const void* base0, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void* arg); + +/* port/pg_localeconv_r.c */ +extern int pg_localeconv_r(const char* lc_monetary, const char* lc_numeric, struct lconv* output); +extern void pg_localeconv_free(struct lconv* lconv); + +/* port/chklocale.c */ +extern int pg_get_encoding_from_locale(const char* ctype, bool write_message); + +#if defined(WIN32) && !defined(FRONTEND) +extern int pg_codepage_to_encoding(UINT cp); +#endif + +/* port/inet_net_ntop.c */ +extern char* pg_inet_net_ntop(int af, const void* src, int bits, char* dst, size_t size); + +/* port/pg_strong_random.c */ +extern void pg_strong_random_init(void); +extern bool pg_strong_random(void* buf, size_t len); + +/* + * pg_backend_random used to be a wrapper for pg_strong_random before + * Postgres 12 for the backend code. + */ +#define pg_backend_random pg_strong_random + +/* port/pgcheckdir.c */ +extern int pg_check_dir(const char* dir); + +/* port/pgmkdirp.c */ +extern int pg_mkdir_p(char* path, int omode); + +/* port/pqsignal.c (see also interfaces/libpq/legacy-pqsignal.c) */ +#ifdef FRONTEND +#define pqsignal pqsignal_fe +#else +#define pqsignal pqsignal_be +#endif +typedef void (*pqsigfunc)(SIGNAL_ARGS); +extern void pqsignal(int signo, pqsigfunc func); + +/* port/quotes.c */ +extern char* escape_single_quotes_ascii(const char* src); + +/* common/wait_error.c */ +extern char* wait_result_to_str(int exitstatus); +extern bool wait_result_is_signal(int exit_status, int signum); +extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found); +extern int wait_result_to_exit_code(int exit_status); + +/* + * Interfaces that we assume all Unix system have. We retain individual macros + * for better documentation. + * + * For symlink-related functions, there is often no need to test these macros, + * because we provided basic support on Windows that can work with absolute + * paths to directories. Code that wants to test for complete symlink support + * (including relative paths and non-directories) should be conditional on + * HAVE_READLINK or HAVE_SYMLINK. + */ +#ifndef WIN32 +#define HAVE_GETRLIMIT 1 +#define HAVE_POLL 1 +#define HAVE_POLL_H 1 +#define HAVE_READLINK 1 +#define HAVE_SETSID 1 +#define HAVE_SHM_OPEN 1 +#define HAVE_SYMLINK 1 +#endif + +#endif /* PG_PORT_H */ From 52900e21c8e688f2533588cb228a8c66c54d89f9 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:16:59 +0300 Subject: [PATCH 09/10] fix win postgre 17 --- .github/workflows/indigo-ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index 8630dbfa41..c7394e7683 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1193,9 +1193,9 @@ jobs: run: cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h - name: Apply patch 18 if: ${{ matrix.postgres_major_version >= 18 }} - run: | - cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h - cp bingo/postgres/patches/port.h pgsql/include/server/port.h + run: cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h + if: ${{ matrix.postgres_major_version >= 17 }} + run: cp bingo/postgres/patches/port.h pgsql/include/server/port.h - name: Build bingo-postgres run: | mkdir build From 8abc2a65420f4bb21cf8ec1760ae27b1a77b77de Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:24:54 +0300 Subject: [PATCH 10/10] fix win postgre 17 --- .github/workflows/indigo-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/indigo-ci.yaml b/.github/workflows/indigo-ci.yaml index c7394e7683..58046f9053 100644 --- a/.github/workflows/indigo-ci.yaml +++ b/.github/workflows/indigo-ci.yaml @@ -1194,6 +1194,7 @@ jobs: - name: Apply patch 18 if: ${{ matrix.postgres_major_version >= 18 }} run: cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h + - name: Apply patch 17 if: ${{ matrix.postgres_major_version >= 17 }} run: cp bingo/postgres/patches/port.h pgsql/include/server/port.h - name: Build bingo-postgres