Skip to content

Commit 6a34139

Browse files
committed
Merge tag 'REL_17_10' into merge_17_10
# Conflicts: # src/backend/access/heap/visibilitymap.c # src/backend/access/transam/multixact.c # src/backend/replication/logical/slotsync.c # src/backend/replication/walsender.c # src/include/pg_config.h.in # src/include/storage/procsignal.h # src/test/Makefile
2 parents d6ba61c + 25c49f3 commit 6a34139

291 files changed

Lines changed: 13050 additions & 6319 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

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

14711471
Usage: $0 [OPTION]... [VAR=VALUE]...
14721472

@@ -1531,7 +1531,7 @@ fi
15311531

15321532
if test -n "$ac_init_help"; then
15331533
case $ac_init_help in
1534-
short | recursive ) echo "Configuration of PostgreSQL 17.9:";;
1534+
short | recursive ) echo "Configuration of PostgreSQL 17.10:";;
15351535
esac
15361536
cat <<\_ACEOF
15371537

@@ -1716,7 +1716,7 @@ fi
17161716
test -n "$ac_init_help" && exit $ac_status
17171717
if $ac_init_version; then
17181718
cat <<\_ACEOF
1719-
PostgreSQL configure 17.9
1719+
PostgreSQL configure 17.10
17201720
generated by GNU Autoconf 2.69
17211721

17221722
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2469,7 +2469,7 @@ cat >config.log <<_ACEOF
24692469
This file contains any messages produced by compilers while
24702470
running configure, to aid debugging if configure makes a mistake.
24712471

2472-
It was created by PostgreSQL $as_me 17.9, which was
2472+
It was created by PostgreSQL $as_me 17.10, which was
24732473
generated by GNU Autoconf 2.69. Invocation command line was
24742474

24752475
$ $0 $@
@@ -14957,8 +14957,8 @@ _ACEOF
1495714957
;;
1495814958
esac
1495914959

14960-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
14961-
$as_echo_n "checking for printf format archetype... " >&6; }
14960+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C printf format archetype" >&5
14961+
$as_echo_n "checking for C printf format archetype... " >&6; }
1496214962
if ${pgac_cv_printf_archetype+:} false; then :
1496314963
$as_echo_n "(cached) " >&6
1496414964
else
@@ -15018,7 +15018,97 @@ fi
1501815018
$as_echo "$pgac_cv_printf_archetype" >&6; }
1501915019

1502015020
cat >>confdefs.h <<_ACEOF
15021-
#define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
15021+
#define PG_C_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
15022+
_ACEOF
15023+
15024+
15025+
15026+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ printf format archetype" >&5
15027+
$as_echo_n "checking for C++ printf format archetype... " >&6; }
15028+
if ${pgac_cv_cxx_printf_archetype+:} false; then :
15029+
$as_echo_n "(cached) " >&6
15030+
else
15031+
pgac_cv_cxx_printf_archetype=gnu_printf
15032+
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
15033+
ac_cxx_werror_flag=yes
15034+
ac_ext=cpp
15035+
ac_cpp='$CXXCPP $CPPFLAGS'
15036+
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15037+
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15038+
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
15039+
15040+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15041+
/* end confdefs.h. */
15042+
extern void pgac_write(int ignore, const char *fmt,...)
15043+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));
15044+
int
15045+
main ()
15046+
{
15047+
pgac_write(0, "error %s: %m", "foo");
15048+
;
15049+
return 0;
15050+
}
15051+
_ACEOF
15052+
if ac_fn_cxx_try_compile "$LINENO"; then :
15053+
ac_archetype_ok=yes
15054+
else
15055+
ac_archetype_ok=no
15056+
fi
15057+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15058+
ac_ext=c
15059+
ac_cpp='$CPP $CPPFLAGS'
15060+
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15061+
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15062+
ac_compiler_gnu=$ac_cv_c_compiler_gnu
15063+
15064+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
15065+
15066+
if [ "$ac_archetype_ok" = no ]; then
15067+
pgac_cv_cxx_printf_archetype=__syslog__
15068+
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
15069+
ac_cxx_werror_flag=yes
15070+
ac_ext=cpp
15071+
ac_cpp='$CXXCPP $CPPFLAGS'
15072+
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15073+
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15074+
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
15075+
15076+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15077+
/* end confdefs.h. */
15078+
extern void pgac_write(int ignore, const char *fmt,...)
15079+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));
15080+
int
15081+
main ()
15082+
{
15083+
pgac_write(0, "error %s: %m", "foo");
15084+
;
15085+
return 0;
15086+
}
15087+
_ACEOF
15088+
if ac_fn_cxx_try_compile "$LINENO"; then :
15089+
ac_archetype_ok=yes
15090+
else
15091+
ac_archetype_ok=no
15092+
fi
15093+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15094+
ac_ext=c
15095+
ac_cpp='$CPP $CPPFLAGS'
15096+
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15097+
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15098+
ac_compiler_gnu=$ac_cv_c_compiler_gnu
15099+
15100+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
15101+
15102+
if [ "$ac_archetype_ok" = no ]; then
15103+
pgac_cv_cxx_printf_archetype=printf
15104+
fi
15105+
fi
15106+
fi
15107+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_cxx_printf_archetype" >&5
15108+
$as_echo "$pgac_cv_cxx_printf_archetype" >&6; }
15109+
15110+
cat >>confdefs.h <<_ACEOF
15111+
#define PG_CXX_PRINTF_ATTRIBUTE $pgac_cv_cxx_printf_archetype
1502215112
_ACEOF
1502315113

1502415114

@@ -16381,6 +16471,16 @@ fi
1638116471
cat >>confdefs.h <<_ACEOF
1638216472
#define HAVE_DECL_STRNLEN $ac_have_decl
1638316473
_ACEOF
16474+
ac_fn_c_check_decl "$LINENO" "timingsafe_bcmp" "ac_cv_have_decl_timingsafe_bcmp" "$ac_includes_default"
16475+
if test "x$ac_cv_have_decl_timingsafe_bcmp" = xyes; then :
16476+
ac_have_decl=1
16477+
else
16478+
ac_have_decl=0
16479+
fi
16480+
16481+
cat >>confdefs.h <<_ACEOF
16482+
#define HAVE_DECL_TIMINGSAFE_BCMP $ac_have_decl
16483+
_ACEOF
1638416484

1638516485

1638616486
# We can't use AC_CHECK_FUNCS to detect these functions, because it
@@ -16553,6 +16653,19 @@ esac
1655316653

1655416654
fi
1655516655

16656+
ac_fn_c_check_func "$LINENO" "timingsafe_bcmp" "ac_cv_func_timingsafe_bcmp"
16657+
if test "x$ac_cv_func_timingsafe_bcmp" = xyes; then :
16658+
$as_echo "#define HAVE_TIMINGSAFE_BCMP 1" >>confdefs.h
16659+
16660+
else
16661+
case " $LIBOBJS " in
16662+
*" timingsafe_bcmp.$ac_objext "* ) ;;
16663+
*) LIBOBJS="$LIBOBJS timingsafe_bcmp.$ac_objext"
16664+
;;
16665+
esac
16666+
16667+
fi
16668+
1655616669

1655716670

1655816671
ac_fn_c_check_func "$LINENO" "pthread_barrier_wait" "ac_cv_func_pthread_barrier_wait"
@@ -20463,7 +20576,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2046320576
# report actual input values of CONFIG_FILES etc. instead of their
2046420577
# values after options handling.
2046520578
ac_log="
20466-
This file was extended by PostgreSQL $as_me 17.9, which was
20579+
This file was extended by PostgreSQL $as_me 17.10, which was
2046720580
generated by GNU Autoconf 2.69. Invocation command line was
2046820581

2046920582
CONFIG_FILES = $CONFIG_FILES
@@ -20534,7 +20647,7 @@ _ACEOF
2053420647
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2053520648
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2053620649
ac_cs_version="\\
20537-
PostgreSQL config.status 17.9
20650+
PostgreSQL config.status 17.10
2053820651
configured by $0, generated by GNU Autoconf 2.69,
2053920652
with options \\"\$ac_cs_config\\"
2054020653

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
@@ -1759,6 +1759,7 @@ m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that.
17591759
AC_C_BIGENDIAN
17601760
AC_C_INLINE
17611761
PGAC_PRINTF_ARCHETYPE
1762+
PGAC_CXX_PRINTF_ARCHETYPE
17621763
PGAC_C_STATIC_ASSERT
17631764
PGAC_C_TYPEOF
17641765
PGAC_C_TYPES_COMPATIBLE
@@ -1924,7 +1925,7 @@ AC_CHECK_DECLS(posix_fadvise, [], [], [#include <fcntl.h>])
19241925
]) # fi
19251926

19261927
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
1927-
AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
1928+
AC_CHECK_DECLS([strlcat, strlcpy, strnlen, timingsafe_bcmp])
19281929

19291930
# We can't use AC_CHECK_FUNCS to detect these functions, because it
19301931
# won't handle deployment target restrictions on macOS
@@ -1946,6 +1947,7 @@ AC_REPLACE_FUNCS(m4_normalize([
19461947
strlcat
19471948
strlcpy
19481949
strnlen
1950+
timingsafe_bcmp
19491951
]))
19501952

19511953
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
@@ -91,13 +91,11 @@ _PG_archive_module_init(void)
9191
/*
9292
* check_archive_directory
9393
*
94-
* Checks that the provided archive directory exists.
94+
* Checks that the provided archive directory path isn't too long.
9595
*/
9696
static bool
9797
check_archive_directory(char **newval, void **extra, GucSource source)
9898
{
99-
struct stat st;
100-
10199
/*
102100
* The default value is an empty string, so we have to accept that value.
103101
* Our check_configured callback also checks for this and prevents
@@ -116,17 +114,6 @@ check_archive_directory(char **newval, void **extra, GucSource source)
116114
return false;
117115
}
118116

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

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)