Skip to content

Commit c33d595

Browse files
committed
Merge remote-tracking branch 'origin/merge-17.10-stable' into BABEL_5_6_STABLE__PG_17_10
2 parents 4d07452 + fe35cd9 commit c33d595

291 files changed

Lines changed: 13006 additions & 6328 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.abi-compliance-history

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
# Be sure to replace "<ADD JUSTIFICATION HERE>" with details of your change and
1919
# why it is deemed acceptable.
2020

21+
586f4266fb4945f6ea3564b9c1bab093eb74bee4
22+
#
23+
# Fix ABI break by moving PROCSIG_SLOTSYNC_MESSAGE in ProcSignalReason
24+
# 2026-04-09 15:30:59 +0900
25+
#
26+
# This commit added PROCSIG_SLOTSYNC_MESSAGE just before the final entry,
27+
# NUM_PROCSIGNALS, in enum ProcSignalReason. This increased the value of
28+
# NUM_PROCSIGNALS, but no affected third-party code is known.
29+
2130
4dac22aa10d2882c2e6fb465d7c314cc2d8fb754
2231
#
2332
# Add file_extend_method=posix_fallocate,write_zeros.

config/c-compiler.m4

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
# Select the format archetype to be used by gcc to check printf-type functions.
88
# We prefer "gnu_printf", as that most closely matches the features supported
99
# by src/port/snprintf.c (particularly the %m conversion spec). However,
10-
# on some NetBSD versions, that doesn't work while "__syslog__" does.
11-
# If all else fails, use "printf".
10+
# on clang and on some NetBSD versions, that doesn't work while "__syslog__"
11+
# does. If all else fails, use "printf".
1212
AC_DEFUN([PGAC_PRINTF_ARCHETYPE],
13-
[AC_CACHE_CHECK([for printf format archetype], pgac_cv_printf_archetype,
13+
[AC_CACHE_CHECK([for C printf format archetype], pgac_cv_printf_archetype,
1414
[pgac_cv_printf_archetype=gnu_printf
1515
PGAC_TEST_PRINTF_ARCHETYPE
1616
if [[ "$ac_archetype_ok" = no ]]; then
@@ -20,8 +20,8 @@ if [[ "$ac_archetype_ok" = no ]]; then
2020
pgac_cv_printf_archetype=printf
2121
fi
2222
fi])
23-
AC_DEFINE_UNQUOTED([PG_PRINTF_ATTRIBUTE], [$pgac_cv_printf_archetype],
24-
[Define to best printf format archetype, usually gnu_printf if available.])
23+
AC_DEFINE_UNQUOTED([PG_C_PRINTF_ATTRIBUTE], [$pgac_cv_printf_archetype],
24+
[Define to best C printf format archetype, usually gnu_printf if available.])
2525
])# PGAC_PRINTF_ARCHETYPE
2626

2727
# Subroutine: test $pgac_cv_printf_archetype, set $ac_archetype_ok to yes or no
@@ -92,6 +92,42 @@ undefine([Ac_cachevar])dnl
9292
])# PGAC_TYPE_64BIT_INT
9393

9494

95+
# PGAC_CXX_PRINTF_ARCHETYPE
96+
# -------------------------
97+
# Because we support using gcc as C compiler with clang as C++ compiler,
98+
# we have to be prepared to use different printf archetypes in C++ code.
99+
# So, do the above test all over in C++.
100+
AC_DEFUN([PGAC_CXX_PRINTF_ARCHETYPE],
101+
[AC_CACHE_CHECK([for C++ printf format archetype], pgac_cv_cxx_printf_archetype,
102+
[pgac_cv_cxx_printf_archetype=gnu_printf
103+
PGAC_TEST_CXX_PRINTF_ARCHETYPE
104+
if [[ "$ac_archetype_ok" = no ]]; then
105+
pgac_cv_cxx_printf_archetype=__syslog__
106+
PGAC_TEST_CXX_PRINTF_ARCHETYPE
107+
if [[ "$ac_archetype_ok" = no ]]; then
108+
pgac_cv_cxx_printf_archetype=printf
109+
fi
110+
fi])
111+
AC_DEFINE_UNQUOTED([PG_CXX_PRINTF_ATTRIBUTE], [$pgac_cv_cxx_printf_archetype],
112+
[Define to best C++ printf format archetype, usually gnu_printf if available.])
113+
])# PGAC_CXX_PRINTF_ARCHETYPE
114+
115+
# Subroutine: test $pgac_cv_cxx_printf_archetype, set $ac_archetype_ok to yes or no
116+
AC_DEFUN([PGAC_TEST_CXX_PRINTF_ARCHETYPE],
117+
[ac_save_cxx_werror_flag=$ac_cxx_werror_flag
118+
ac_cxx_werror_flag=yes
119+
AC_LANG_PUSH(C++)
120+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
121+
[extern void pgac_write(int ignore, const char *fmt,...)
122+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));],
123+
[pgac_write(0, "error %s: %m", "foo");])],
124+
[ac_archetype_ok=yes],
125+
[ac_archetype_ok=no])
126+
AC_LANG_POP([])
127+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
128+
])# PGAC_TEST_CXX_PRINTF_ARCHETYPE
129+
130+
95131
# PGAC_TYPE_128BIT_INT
96132
# --------------------
97133
# Check if __int128 is a working 128 bit integer type, and if so

configure

Lines changed: 125 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 17.9.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 17.10.
44
#
55
# Report bugs to <pgsql-bugs@lists.postgresql.org>.
66
#
@@ -582,8 +582,8 @@ MAKEFLAGS=
582582
# Identity of this package.
583583
PACKAGE_NAME='PostgreSQL'
584584
PACKAGE_TARNAME='postgresql'
585-
PACKAGE_VERSION='17.9'
586-
PACKAGE_STRING='PostgreSQL 17.9'
585+
PACKAGE_VERSION='17.10'
586+
PACKAGE_STRING='PostgreSQL 17.10'
587587
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
588588
PACKAGE_URL='https://www.postgresql.org/'
589589

@@ -1450,7 +1450,7 @@ if test "$ac_init_help" = "long"; then
14501450
# Omit some internal or obsolete options to make the list less imposing.
14511451
# This message is too long to be a string in the A/UX 3.1 sh.
14521452
cat <<_ACEOF
1453-
\`configure' configures PostgreSQL 17.9 to adapt to many kinds of systems.
1453+
\`configure' configures PostgreSQL 17.10 to adapt to many kinds of systems.
14541454

14551455
Usage: $0 [OPTION]... [VAR=VALUE]...
14561456

@@ -1515,7 +1515,7 @@ fi
15151515

15161516
if test -n "$ac_init_help"; then
15171517
case $ac_init_help in
1518-
short | recursive ) echo "Configuration of PostgreSQL 17.9:";;
1518+
short | recursive ) echo "Configuration of PostgreSQL 17.10:";;
15191519
esac
15201520
cat <<\_ACEOF
15211521

@@ -1690,7 +1690,7 @@ fi
16901690
test -n "$ac_init_help" && exit $ac_status
16911691
if $ac_init_version; then
16921692
cat <<\_ACEOF
1693-
PostgreSQL configure 17.9
1693+
PostgreSQL configure 17.10
16941694
generated by GNU Autoconf 2.69
16951695

16961696
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2443,7 +2443,7 @@ cat >config.log <<_ACEOF
24432443
This file contains any messages produced by compilers while
24442444
running configure, to aid debugging if configure makes a mistake.
24452445

2446-
It was created by PostgreSQL $as_me 17.9, which was
2446+
It was created by PostgreSQL $as_me 17.10, which was
24472447
generated by GNU Autoconf 2.69. Invocation command line was
24482448

24492449
$ $0 $@
@@ -14364,8 +14364,8 @@ _ACEOF
1436414364
;;
1436514365
esac
1436614366

14367-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
14368-
$as_echo_n "checking for printf format archetype... " >&6; }
14367+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C printf format archetype" >&5
14368+
$as_echo_n "checking for C printf format archetype... " >&6; }
1436914369
if ${pgac_cv_printf_archetype+:} false; then :
1437014370
$as_echo_n "(cached) " >&6
1437114371
else
@@ -14425,7 +14425,97 @@ fi
1442514425
$as_echo "$pgac_cv_printf_archetype" >&6; }
1442614426

1442714427
cat >>confdefs.h <<_ACEOF
14428-
#define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
14428+
#define PG_C_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
14429+
_ACEOF
14430+
14431+
14432+
14433+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ printf format archetype" >&5
14434+
$as_echo_n "checking for C++ printf format archetype... " >&6; }
14435+
if ${pgac_cv_cxx_printf_archetype+:} false; then :
14436+
$as_echo_n "(cached) " >&6
14437+
else
14438+
pgac_cv_cxx_printf_archetype=gnu_printf
14439+
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
14440+
ac_cxx_werror_flag=yes
14441+
ac_ext=cpp
14442+
ac_cpp='$CXXCPP $CPPFLAGS'
14443+
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14444+
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14445+
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
14446+
14447+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14448+
/* end confdefs.h. */
14449+
extern void pgac_write(int ignore, const char *fmt,...)
14450+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));
14451+
int
14452+
main ()
14453+
{
14454+
pgac_write(0, "error %s: %m", "foo");
14455+
;
14456+
return 0;
14457+
}
14458+
_ACEOF
14459+
if ac_fn_cxx_try_compile "$LINENO"; then :
14460+
ac_archetype_ok=yes
14461+
else
14462+
ac_archetype_ok=no
14463+
fi
14464+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14465+
ac_ext=c
14466+
ac_cpp='$CPP $CPPFLAGS'
14467+
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14468+
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14469+
ac_compiler_gnu=$ac_cv_c_compiler_gnu
14470+
14471+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
14472+
14473+
if [ "$ac_archetype_ok" = no ]; then
14474+
pgac_cv_cxx_printf_archetype=__syslog__
14475+
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
14476+
ac_cxx_werror_flag=yes
14477+
ac_ext=cpp
14478+
ac_cpp='$CXXCPP $CPPFLAGS'
14479+
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14480+
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14481+
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
14482+
14483+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14484+
/* end confdefs.h. */
14485+
extern void pgac_write(int ignore, const char *fmt,...)
14486+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));
14487+
int
14488+
main ()
14489+
{
14490+
pgac_write(0, "error %s: %m", "foo");
14491+
;
14492+
return 0;
14493+
}
14494+
_ACEOF
14495+
if ac_fn_cxx_try_compile "$LINENO"; then :
14496+
ac_archetype_ok=yes
14497+
else
14498+
ac_archetype_ok=no
14499+
fi
14500+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14501+
ac_ext=c
14502+
ac_cpp='$CPP $CPPFLAGS'
14503+
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14504+
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14505+
ac_compiler_gnu=$ac_cv_c_compiler_gnu
14506+
14507+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
14508+
14509+
if [ "$ac_archetype_ok" = no ]; then
14510+
pgac_cv_cxx_printf_archetype=printf
14511+
fi
14512+
fi
14513+
fi
14514+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_cxx_printf_archetype" >&5
14515+
$as_echo "$pgac_cv_cxx_printf_archetype" >&6; }
14516+
14517+
cat >>confdefs.h <<_ACEOF
14518+
#define PG_CXX_PRINTF_ATTRIBUTE $pgac_cv_cxx_printf_archetype
1442914519
_ACEOF
1443014520

1443114521

@@ -15788,6 +15878,16 @@ fi
1578815878
cat >>confdefs.h <<_ACEOF
1578915879
#define HAVE_DECL_STRNLEN $ac_have_decl
1579015880
_ACEOF
15881+
ac_fn_c_check_decl "$LINENO" "timingsafe_bcmp" "ac_cv_have_decl_timingsafe_bcmp" "$ac_includes_default"
15882+
if test "x$ac_cv_have_decl_timingsafe_bcmp" = xyes; then :
15883+
ac_have_decl=1
15884+
else
15885+
ac_have_decl=0
15886+
fi
15887+
15888+
cat >>confdefs.h <<_ACEOF
15889+
#define HAVE_DECL_TIMINGSAFE_BCMP $ac_have_decl
15890+
_ACEOF
1579115891

1579215892

1579315893
# We can't use AC_CHECK_FUNCS to detect these functions, because it
@@ -15960,6 +16060,19 @@ esac
1596016060

1596116061
fi
1596216062

16063+
ac_fn_c_check_func "$LINENO" "timingsafe_bcmp" "ac_cv_func_timingsafe_bcmp"
16064+
if test "x$ac_cv_func_timingsafe_bcmp" = xyes; then :
16065+
$as_echo "#define HAVE_TIMINGSAFE_BCMP 1" >>confdefs.h
16066+
16067+
else
16068+
case " $LIBOBJS " in
16069+
*" timingsafe_bcmp.$ac_objext "* ) ;;
16070+
*) LIBOBJS="$LIBOBJS timingsafe_bcmp.$ac_objext"
16071+
;;
16072+
esac
16073+
16074+
fi
16075+
1596316076

1596416077

1596516078
ac_fn_c_check_func "$LINENO" "pthread_barrier_wait" "ac_cv_func_pthread_barrier_wait"
@@ -19866,7 +19979,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1986619979
# report actual input values of CONFIG_FILES etc. instead of their
1986719980
# values after options handling.
1986819981
ac_log="
19869-
This file was extended by PostgreSQL $as_me 17.9, which was
19982+
This file was extended by PostgreSQL $as_me 17.10, which was
1987019983
generated by GNU Autoconf 2.69. Invocation command line was
1987119984

1987219985
CONFIG_FILES = $CONFIG_FILES
@@ -19937,7 +20050,7 @@ _ACEOF
1993720050
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1993820051
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1993920052
ac_cs_version="\\
19940-
PostgreSQL config.status 17.9
20053+
PostgreSQL config.status 17.10
1994120054
configured by $0, generated by GNU Autoconf 2.69,
1994220055
with options \\"\$ac_cs_config\\"
1994320056

configure.ac

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [17.9], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
20+
AC_INIT([PostgreSQL], [17.10], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
2121

2222
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2323
Untested combinations of 'autoconf' and PostgreSQL versions are not
@@ -1631,6 +1631,7 @@ m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that.
16311631
AC_C_BIGENDIAN
16321632
AC_C_INLINE
16331633
PGAC_PRINTF_ARCHETYPE
1634+
PGAC_CXX_PRINTF_ARCHETYPE
16341635
PGAC_C_STATIC_ASSERT
16351636
PGAC_C_TYPEOF
16361637
PGAC_C_TYPES_COMPATIBLE
@@ -1795,7 +1796,7 @@ AC_CHECK_DECLS(posix_fadvise, [], [], [#include <fcntl.h>])
17951796
]) # fi
17961797

17971798
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
1798-
AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
1799+
AC_CHECK_DECLS([strlcat, strlcpy, strnlen, timingsafe_bcmp])
17991800

18001801
# We can't use AC_CHECK_FUNCS to detect these functions, because it
18011802
# won't handle deployment target restrictions on macOS
@@ -1817,6 +1818,7 @@ AC_REPLACE_FUNCS(m4_normalize([
18171818
strlcat
18181819
strlcpy
18191820
strnlen
1821+
timingsafe_bcmp
18201822
]))
18211823

18221824
AC_REPLACE_FUNCS(pthread_barrier_wait)

contrib/basic_archive/basic_archive.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,11 @@ _PG_archive_module_init(void)
8888
/*
8989
* check_archive_directory
9090
*
91-
* Checks that the provided archive directory exists.
91+
* Checks that the provided archive directory path isn't too long.
9292
*/
9393
static bool
9494
check_archive_directory(char **newval, void **extra, GucSource source)
9595
{
96-
struct stat st;
97-
9896
/*
9997
* The default value is an empty string, so we have to accept that value.
10098
* Our check_configured callback also checks for this and prevents
@@ -113,17 +111,6 @@ check_archive_directory(char **newval, void **extra, GucSource source)
113111
return false;
114112
}
115113

116-
/*
117-
* Do a basic sanity check that the specified archive directory exists. It
118-
* could be removed at some point in the future, so we still need to be
119-
* prepared for it not to exist in the actual archiving logic.
120-
*/
121-
if (stat(*newval, &st) != 0 || !S_ISDIR(st.st_mode))
122-
{
123-
GUC_check_errdetail("Specified archive directory does not exist.");
124-
return false;
125-
}
126-
127114
return true;
128115
}
129116

contrib/hstore_plperl/hstore_plperl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ plperl_to_hstore(PG_FUNCTION_ARGS)
118118

119119
pcount = hv_iterinit(hv);
120120

121-
pairs = palloc(pcount * sizeof(Pairs));
121+
pairs = palloc_array(Pairs, pcount);
122122

123123
i = 0;
124124
while ((he = hv_iternext(hv)))

contrib/hstore_plpython/hstore_plpython.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ plpython_to_hstore(PG_FUNCTION_ARGS)
147147
Py_ssize_t i;
148148
Pairs *pairs;
149149

150-
pairs = palloc(pcount * sizeof(*pairs));
150+
pairs = palloc_array(Pairs, pcount);
151151

152152
for (i = 0; i < pcount; i++)
153153
{

0 commit comments

Comments
 (0)