diff --git a/databases/postgresql17-server/Portfile b/databases/postgresql17-server/Portfile new file mode 100644 index 0000000000000..116458afce3da --- /dev/null +++ b/databases/postgresql17-server/Portfile @@ -0,0 +1,61 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 + +name postgresql17-server +version 17.0 +revision 0 +categories databases +platforms {darwin any} +maintainers {gmail.com:davidgilman1 @dgilman} \ + {@barracuda156 gmail.com:vital.had} \ + openmaintainer +license Permissive + +set rname postgresql17 +description run ${rname} as server +long_description {*}${description} +distfiles + +homepage https://www.postgresql.org/ +master_sites postgresql + +depends_run port:${rname} + +supported_archs noarch + +use_configure no +build {} + +set libdir ${prefix}/lib/${rname} +set dbdir ${prefix}/var/db/${rname}/defaultdb +set logdir ${prefix}/var/log/${rname} +set dbuser postgres +set dbgrp postgres +set dbhome ${prefix}/var/db/${rname} + +add_users ${dbuser} shell=/usr/bin/false group=${dbgrp} \ + home=${prefix}/var/db \ + realname=PostgreSQL-17\ Server + +startupitem.create yes +startupitem.init \ + "PGCTL=${libdir}/bin/pg_ctl" +startupitem.start \ + "sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL17DATA:=${dbdir}} start -l ${logdir}/postgres.log\"" +startupitem.stop \ +"sudo -u ${dbuser} /bin/sh -c \"\${PGCTL} -D \${POSTGRESQL17DATA:=${dbdir}} stop -s -m fast\"" + +destroot { + xinstall -m 755 -d ${destroot}${logdir} + touch ${destroot}${logdir}/postgres.log + system "chown ${dbuser}:${dbgrp} ${destroot}${logdir}/postgres.log" +} + +notes "\nTo create a database instance, after install do\n\ + sudo port select postgresql ${rname}\n\ + sudo mkdir -p ${dbdir}\n\ + sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\ + sudo -u ${dbuser} /bin/sh -c \'cd ${dbhome} && ${libdir}/bin/initdb -D ${dbdir}\' " + +livecheck.type none diff --git a/databases/postgresql17/Portfile b/databases/postgresql17/Portfile new file mode 100644 index 0000000000000..8fd9a65e92c3e --- /dev/null +++ b/databases/postgresql17/Portfile @@ -0,0 +1,179 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup compilers 1.0 +PortGroup compiler_blacklist_versions 1.0 +PortGroup muniversal 1.0 +PortGroup legacysupport 1.1 + +name postgresql17 +version 17.0 +revision 0 + +categories databases +maintainers {gmail.com:davidgilman1 @dgilman} \ + {@barracuda156 gmail.com:vital.had} \ + openmaintainer +license Permissive +description The most advanced open-source database available anywhere. +long_description PostgreSQL is Object-Relational Database Management System.\ + It supports almost all SQL constructs, including transactions, \ + subselects, and user-defined types and functions. Write-ahead \ + logging means increased performance while retaining data \ + integrity. +conflicts postgresql96-doc postgresql10-doc postgresql11-doc postgresql12-doc \ + postgresql13-doc postgresql14-doc postgresql15-doc + +homepage https://www.postgresql.org/ +master_sites postgresql:source/v${version}/ +distname postgresql-${version} + +checksums rmd160 eb681ee451d85f8163150f92facd97a09f017629 \ + sha256 7e276131c0fdd6b62588dbad9b3bb24b8c3498d5009328dba59af16e819109de \ + size 21419388 + +use_bzip2 yes + +# https://trac.macports.org/ticket/66060 +# https://trac.macports.org/ticket/67365 +# https://postgrespro.ru/list/thread-id/2551610 +# The problem is specific to PPC: https://github.com/macports/macports-ports/pull/16460 +platform darwin powerpc { + patchfiles-append patch-icu.diff \ + patch-fix-ppc-asm.diff +} + +depends_lib port:readline path:lib/libssl.dylib:openssl port:zlib \ + port:libxml2 port:libxslt \ + path:lib/pkgconfig/icu-uc.pc:icu \ + path:lib/libgssapi_krb5.dylib:kerberos5 \ + path:lib/libzstd.dylib:zstd \ + path:lib/liblz4.dylib:lz4 +depends_build port:bison port:pkgconfig \ + port:docbook-xml-4.5 port:docbook-xsl-nons +depends_run port:postgresql_select-17 + +legacysupport.newest_darwin_requires_legacy \ + 15 +worksrcdir postgresql-${version} + +if {${universal_possible} && [variant_isset universal]} { + set zicpath ${worksrcpath}-${build_arch}/src/timezone/zic +} else { + set zicpath ${worksrcpath}/src/timezone/zic +} +set libdir ${prefix}/lib/${name} +set mandir ${prefix}/share/doc/${name}/man +configure.args PG_SYSROOT=disabled \ + ZIC=${zicpath} \ + --sysconfdir=${prefix}/etc/${name} \ + --bindir=${libdir}/bin \ + --libdir=${libdir} \ + --includedir=${prefix}/include/${name} \ + --datadir=${prefix}/share/${name} \ + --docdir=${prefix}/share/doc/${name} \ + --mandir=${mandir} \ + --with-includes=${prefix}/include \ + --with-libraries=${prefix}/lib \ + --with-openssl \ + --with-bonjour \ + --with-readline \ + --with-zlib \ + --with-lz4 \ + --with-zstd \ + --with-libxml \ + --with-libxslt \ + --with-gssapi \ + --with-uuid=e2fs \ + --with-icu + +configure.universal_args-delete --disable-dependency-tracking + +# building psql with clang from Xcode prior to 4.4 causes segfault on query; see #31717 +compiler.blacklist-append {clang < 421} +compilers.choose cc cxx +compilers.setup -gcc -fortran -clang33 -clang34 -clang37 -clang90 +notes "To use the postgresql server as a startup item install the ${name}-server port." + +if {${universal_possible} && [variant_isset universal]} { + configure.cflags-append -DAC_APPLE_UNIVERSAL_BUILD +} + +build.type gnu +build.target world + +destroot.target install-world + +test.run yes +test.target check + +# remember to change livecheck with first proper release +livecheck.type regex +#livecheck.regex (17\\.\[.0-9\]*\[a-z\]+\[0-9\]) +#livecheck.regex (17\[a-z\]+\[0-9\]) +livecheck.regex alt="v(17\\.\[.0-9\]+)" +livecheck.url ${homepage}/ftp/source/ + +post-destroot { + ln -s ${libdir}/bin/psql ${destroot}${prefix}/bin/psql17 + + reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \ + ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global + reinplace -E "s#^MKDIR_P.*#MKDIR_P = /bin/mkdir -p#g" \ + ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global + + set gzip [findBinary gzip ${portutil::autoconf::gzip_path}] + foreach manpage [glob -type f ${destroot}${mandir}/man\[1-9\]/*] { + system "$gzip -9vf ${manpage}" + } +} + +if {!${universal_possible} || ![variant_isset universal]} { + post-destroot { + reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \ + ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global + } +} else { + merger-post-destroot { + foreach arch ${configure.universal_archs} { + reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \ + ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global + + reinplace -E "s#${worksrcpath}-${arch}#${worksrcpath}#g" \ + ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global + } + } +} + +variant python3 description {add support for python 3.x} { + depends_lib-append port:python312 + configure.args-append --with-python + configure.python ${prefix}/bin/python3.12 +} + +variant perl description {add Perl support} { + depends_lib-append bin:perl:perl5 + configure.args-append --with-perl +} + +variant tcl description {add Tcl support} { + depends_lib-append port:tcl + configure.args-append --with-tcl --with-tclconfig=${prefix}/lib + configure.env-append TCLSH=${prefix}/bin/tclsh +} + +variant llvm description {add support for JIT compilation} { + set llvm_ver 19 + + foreach clang ${compilers.clang_variants} { + if { [variant_exists ${clang}] && [variant_isset ${clang}] } { + set clang_port_ver [string range ${clang} 5 6] + set llvm_ver ${clang_port_ver} + } + } + + depends_lib-append port:llvm-${llvm_ver} + configure.args-append --with-llvm + configure.env-append LLVM_CONFIG=${prefix}/libexec/llvm-${llvm_ver}/bin/llvm-config \ + CLANG=${configure.cc} +} diff --git a/databases/postgresql17/files/patch-fix-ppc-asm.diff b/databases/postgresql17/files/patch-fix-ppc-asm.diff new file mode 100644 index 0000000000000..220c8aabfe534 --- /dev/null +++ b/databases/postgresql17/files/patch-fix-ppc-asm.diff @@ -0,0 +1,317 @@ +From 842accd12472f563523ba92ac4fe540ae71c99e9 Mon Sep 17 00:00:00 2001 +From: barracuda156 +Date: Tue, 29 Aug 2023 22:34:19 +0800 +Subject: [PATCH] Revert "Remove configurability of PPC spinlock assembly + code." + +Upstream has broken PowerPC build in 8ded65682bee2a1c04392a88e0df0f4fc7552623 +Revert that. + +diff --git configure configure +index 028434b56e..7c10905dfd 100755 +--- configure ++++ configure +@@ -15336,7 +15336,39 @@ $as_echo "#define HAVE_X86_64_POPCNTQ 1" >>confdefs.h + fi + ;; + ppc*|powerpc*) +- # On PPC, check if compiler accepts "i"(x) when __builtin_constant_p(x). ++ # On PPC, check if assembler supports LWARX instruction's mutex hint bit ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5 ++$as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; } ++if ${pgac_cv_have_ppc_mutex_hint+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++int a = 0; int *p = &a; int r; ++ __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ pgac_cv_have_ppc_mutex_hint=yes ++else ++ pgac_cv_have_ppc_mutex_hint=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5 ++$as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; } ++ if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then ++ ++$as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h ++ ++ fi ++ # Check if compiler accepts "i"(x) when __builtin_constant_p(x). + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __builtin_constant_p(x) implies \"i\"(x) acceptance" >&5 + $as_echo_n "checking whether __builtin_constant_p(x) implies \"i\"(x) acceptance... " >&6; } + if ${pgac_cv_have_i_constraint__builtin_constant_p+:} false; then : +diff --git configure.ac configure.ac +index f8ab273674..d3e402dfc0 100644 +--- configure.ac ++++ configure.ac +@@ -1677,7 +1677,18 @@ case $host_cpu in + fi + ;; + ppc*|powerpc*) +- # On PPC, check if compiler accepts "i"(x) when __builtin_constant_p(x). ++ # On PPC, check if assembler supports LWARX instruction's mutex hint bit ++ AC_CACHE_CHECK([whether assembler supports lwarx hint bit], ++ [pgac_cv_have_ppc_mutex_hint], ++ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], ++ [int a = 0; int *p = &a; int r; ++ __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));])], ++ [pgac_cv_have_ppc_mutex_hint=yes], ++ [pgac_cv_have_ppc_mutex_hint=no])]) ++ if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then ++ AC_DEFINE(HAVE_PPC_LWARX_MUTEX_HINT, 1, [Define to 1 if the assembler supports PPC's LWARX mutex hint bit.]) ++ fi ++ # Check if compiler accepts "i"(x) when __builtin_constant_p(x). + AC_CACHE_CHECK([whether __builtin_constant_p(x) implies "i"(x) acceptance], + [pgac_cv_have_i_constraint__builtin_constant_p], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +diff --git src/include/pg_config.h.in src/include/pg_config.h.in +index 85150f90b2..31674bde4e 100644 +--- src/include/pg_config.h.in ++++ src/include/pg_config.h.in +@@ -349,6 +349,9 @@ + /* Define to 1 if you have the `posix_fallocate' function. */ + #undef HAVE_POSIX_FALLOCATE + ++/* Define to 1 if the assembler supports PPC's LWARX mutex hint bit. */ ++#undef HAVE_PPC_LWARX_MUTEX_HINT ++ + /* Define to 1 if you have the `ppoll' function. */ + #undef HAVE_PPOLL + +diff --git src/include/pg_config_manual.h src/include/pg_config_manual.h +index 844c3e0f09..5ee2c46267 100644 +--- src/include/pg_config_manual.h ++++ src/include/pg_config_manual.h +@@ -227,6 +227,32 @@ + */ + #define DEFAULT_EVENT_SOURCE "PostgreSQL" + ++/* ++ * On PPC machines, decide whether to use the mutex hint bit in LWARX ++ * instructions. Setting the hint bit will slightly improve spinlock ++ * performance on POWER6 and later machines, but does nothing before that, ++ * and will result in illegal-instruction failures on some pre-POWER4 ++ * machines. By default we use the hint bit when building for 64-bit PPC, ++ * which should be safe in nearly all cases. You might want to override ++ * this if you are building 32-bit code for a known-recent PPC machine. ++ */ ++#ifdef HAVE_PPC_LWARX_MUTEX_HINT /* must have assembler support in any case */ ++#if defined(__ppc64__) || defined(__powerpc64__) ++#define USE_PPC_LWARX_MUTEX_HINT ++#endif ++#endif ++ ++/* ++ * On PPC machines, decide whether to use LWSYNC instructions in place of ++ * ISYNC and SYNC. This provides slightly better performance, but will ++ * result in illegal-instruction failures on some pre-POWER4 machines. ++ * By default we use LWSYNC when building for 64-bit PPC, which should be ++ * safe in nearly all cases. ++ */ ++#if defined(__ppc64__) || defined(__powerpc64__) ++#define USE_PPC_LWSYNC ++#endif ++ + /* + * Assumed cache line size. This doesn't affect correctness, but can be used + * for low-level optimizations. Currently, this is used to pad some data +diff --git src/include/port/atomics/arch-ppc.h src/include/port/atomics/arch-ppc.h +index 35a79042c0..eb64513626 100644 +--- src/include/port/atomics/arch-ppc.h ++++ src/include/port/atomics/arch-ppc.h +@@ -90,12 +90,12 @@ pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, + (int32) *expected >= PG_INT16_MIN) + __asm__ __volatile__( + " sync \n" +- " lwarx %0,0,%5,1 \n" ++ " lwarx %0,0,%5 \n" + " cmpwi %0,%3 \n" +- " bne $+12 \n" /* branch to lwsync */ ++ " bne $+12 \n" /* branch to isync */ + " stwcx. %4,0,%5 \n" + " bne $-16 \n" /* branch to lwarx */ +- " lwsync \n" ++ " isync \n" + " mfcr %1 \n" + : "=&r"(found), "=r"(condition_register), "+m"(ptr->value) + : "i"(*expected), "r"(newval), "r"(&ptr->value) +@@ -104,12 +104,12 @@ pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, + #endif + __asm__ __volatile__( + " sync \n" +- " lwarx %0,0,%5,1 \n" ++ " lwarx %0,0,%5 \n" + " cmpw %0,%3 \n" +- " bne $+12 \n" /* branch to lwsync */ ++ " bne $+12 \n" /* branch to isync */ + " stwcx. %4,0,%5 \n" + " bne $-16 \n" /* branch to lwarx */ +- " lwsync \n" ++ " isync \n" + " mfcr %1 \n" + : "=&r"(found), "=r"(condition_register), "+m"(ptr->value) + : "r"(*expected), "r"(newval), "r"(&ptr->value) +@@ -138,11 +138,11 @@ pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) + add_ <= PG_INT16_MAX && add_ >= PG_INT16_MIN) + __asm__ __volatile__( + " sync \n" +- " lwarx %1,0,%4,1 \n" ++ " lwarx %1,0,%4 \n" + " addi %0,%1,%3 \n" + " stwcx. %0,0,%4 \n" + " bne $-12 \n" /* branch to lwarx */ +- " lwsync \n" ++ " isync \n" + : "=&r"(_t), "=&b"(res), "+m"(ptr->value) + : "i"(add_), "r"(&ptr->value) + : "memory", "cc"); +@@ -150,11 +150,11 @@ pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) + #endif + __asm__ __volatile__( + " sync \n" +- " lwarx %1,0,%4,1 \n" ++ " lwarx %1,0,%4 \n" + " add %0,%1,%3 \n" + " stwcx. %0,0,%4 \n" + " bne $-12 \n" /* branch to lwarx */ +- " lwsync \n" ++ " isync \n" + : "=&r"(_t), "=&r"(res), "+m"(ptr->value) + : "r"(add_), "r"(&ptr->value) + : "memory", "cc"); +@@ -180,12 +180,12 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, + (int64) *expected >= PG_INT16_MIN) + __asm__ __volatile__( + " sync \n" +- " ldarx %0,0,%5,1 \n" ++ " ldarx %0,0,%5 \n" + " cmpdi %0,%3 \n" +- " bne $+12 \n" /* branch to lwsync */ ++ " bne $+12 \n" /* branch to isync */ + " stdcx. %4,0,%5 \n" + " bne $-16 \n" /* branch to ldarx */ +- " lwsync \n" ++ " isync \n" + " mfcr %1 \n" + : "=&r"(found), "=r"(condition_register), "+m"(ptr->value) + : "i"(*expected), "r"(newval), "r"(&ptr->value) +@@ -194,12 +194,12 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, + #endif + __asm__ __volatile__( + " sync \n" +- " ldarx %0,0,%5,1 \n" ++ " ldarx %0,0,%5 \n" + " cmpd %0,%3 \n" +- " bne $+12 \n" /* branch to lwsync */ ++ " bne $+12 \n" /* branch to isync */ + " stdcx. %4,0,%5 \n" + " bne $-16 \n" /* branch to ldarx */ +- " lwsync \n" ++ " isync \n" + " mfcr %1 \n" + : "=&r"(found), "=r"(condition_register), "+m"(ptr->value) + : "r"(*expected), "r"(newval), "r"(&ptr->value) +@@ -224,11 +224,11 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) + add_ <= PG_INT16_MAX && add_ >= PG_INT16_MIN) + __asm__ __volatile__( + " sync \n" +- " ldarx %1,0,%4,1 \n" ++ " ldarx %1,0,%4 \n" + " addi %0,%1,%3 \n" + " stdcx. %0,0,%4 \n" + " bne $-12 \n" /* branch to ldarx */ +- " lwsync \n" ++ " isync \n" + : "=&r"(_t), "=&b"(res), "+m"(ptr->value) + : "i"(add_), "r"(&ptr->value) + : "memory", "cc"); +@@ -236,11 +236,11 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) + #endif + __asm__ __volatile__( + " sync \n" +- " ldarx %1,0,%4,1 \n" ++ " ldarx %1,0,%4 \n" + " add %0,%1,%3 \n" + " stdcx. %0,0,%4 \n" + " bne $-12 \n" /* branch to ldarx */ +- " lwsync \n" ++ " isync \n" + : "=&r"(_t), "=&r"(res), "+m"(ptr->value) + : "r"(add_), "r"(&ptr->value) + : "memory", "cc"); +diff --git src/include/storage/s_lock.h src/include/storage/s_lock.h +index cc83d561b2..0877cf65b0 100644 +--- src/include/storage/s_lock.h ++++ src/include/storage/s_lock.h +@@ -435,8 +435,7 @@ typedef unsigned int slock_t; + * + * NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002, + * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. +- * But if the spinlock is in ordinary memory, we can use lwsync instead for +- * better performance. ++ * On newer machines, we can use lwsync instead for better performance. + * + * Ordinarily, we'd code the branches here using GNU-style local symbols, that + * is "1f" referencing "1:" and so on. But some people run gcc on AIX with +@@ -451,15 +450,23 @@ tas(volatile slock_t *lock) + int _res; + + __asm__ __volatile__( ++#ifdef USE_PPC_LWARX_MUTEX_HINT + " lwarx %0,0,%3,1 \n" ++#else ++" lwarx %0,0,%3 \n" ++#endif + " cmpwi %0,0 \n" + " bne $+16 \n" /* branch to li %1,1 */ + " addi %0,%0,1 \n" + " stwcx. %0,0,%3 \n" +-" beq $+12 \n" /* branch to lwsync */ ++" beq $+12 \n" /* branch to lwsync/isync */ + " li %1,1 \n" + " b $+12 \n" /* branch to end of asm sequence */ ++#ifdef USE_PPC_LWSYNC + " lwsync \n" ++#else ++" isync \n" ++#endif + " li %1,0 \n" + + : "=&b"(_t), "=r"(_res), "+m"(*lock) +@@ -470,14 +477,23 @@ tas(volatile slock_t *lock) + + /* + * PowerPC S_UNLOCK is almost standard but requires a "sync" instruction. +- * But we can use lwsync instead for better performance. ++ * On newer machines, we can use lwsync instead for better performance. + */ ++#ifdef USE_PPC_LWSYNC + #define S_UNLOCK(lock) \ + do \ + { \ + __asm__ __volatile__ (" lwsync \n" ::: "memory"); \ + *((volatile slock_t *) (lock)) = 0; \ + } while (0) ++#else ++#define S_UNLOCK(lock) \ ++do \ ++{ \ ++ __asm__ __volatile__ (" sync \n" ::: "memory"); \ ++ *((volatile slock_t *) (lock)) = 0; \ ++} while (0) ++#endif /* USE_PPC_LWSYNC */ + + #endif /* powerpc */ + diff --git a/databases/postgresql17/files/patch-icu.diff b/databases/postgresql17/files/patch-icu.diff new file mode 100644 index 0000000000000..a6758292f3478 --- /dev/null +++ b/databases/postgresql17/files/patch-icu.diff @@ -0,0 +1,25 @@ +--- src/include/utils/pg_locale.h.orig 2022-08-09 04:44:29.000000000 +0800 ++++ src/include/utils/pg_locale.h 2022-10-25 01:49:09.000000000 +0800 +@@ -17,6 +17,9 @@ + #endif + #ifdef USE_ICU + #include ++#ifdef bool ++#undef bool ++#endif + #endif + + #include "utils/guc.h" + +--- src/backend/utils/adt/formatting.c.orig 2022-10-25 02:07:10.000000000 +0800 ++++ src/backend/utils/adt/formatting.c 2022-10-25 02:07:21.000000000 +0800 +@@ -81,6 +81,9 @@ + + #ifdef USE_ICU + #include ++#ifdef bool ++#undef bool ++#endif + #endif + + #include "catalog/pg_collation.h"