Skip to content

Commit cd314d6

Browse files
committed
Merge remote-tracking branch 'origin/merge-18.4' into BABEL_6_X_DEV__PG_18_X
2 parents 84ee727 + 8dcd10d commit cd314d6

341 files changed

Lines changed: 12695 additions & 4465 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.

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
@@ -38,6 +38,42 @@ ac_c_werror_flag=$ac_save_c_werror_flag
3838
])# PGAC_TEST_PRINTF_ARCHETYPE
3939

4040

41+
# PGAC_CXX_PRINTF_ARCHETYPE
42+
# -------------------------
43+
# Because we support using gcc as C compiler with clang as C++ compiler,
44+
# we have to be prepared to use different printf archetypes in C++ code.
45+
# So, do the above test all over in C++.
46+
AC_DEFUN([PGAC_CXX_PRINTF_ARCHETYPE],
47+
[AC_CACHE_CHECK([for C++ printf format archetype], pgac_cv_cxx_printf_archetype,
48+
[pgac_cv_cxx_printf_archetype=gnu_printf
49+
PGAC_TEST_CXX_PRINTF_ARCHETYPE
50+
if [[ "$ac_archetype_ok" = no ]]; then
51+
pgac_cv_cxx_printf_archetype=__syslog__
52+
PGAC_TEST_CXX_PRINTF_ARCHETYPE
53+
if [[ "$ac_archetype_ok" = no ]]; then
54+
pgac_cv_cxx_printf_archetype=printf
55+
fi
56+
fi])
57+
AC_DEFINE_UNQUOTED([PG_CXX_PRINTF_ATTRIBUTE], [$pgac_cv_cxx_printf_archetype],
58+
[Define to best C++ printf format archetype, usually gnu_printf if available.])
59+
])# PGAC_CXX_PRINTF_ARCHETYPE
60+
61+
# Subroutine: test $pgac_cv_cxx_printf_archetype, set $ac_archetype_ok to yes or no
62+
AC_DEFUN([PGAC_TEST_CXX_PRINTF_ARCHETYPE],
63+
[ac_save_cxx_werror_flag=$ac_cxx_werror_flag
64+
ac_cxx_werror_flag=yes
65+
AC_LANG_PUSH(C++)
66+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
67+
[extern void pgac_write(int ignore, const char *fmt,...)
68+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));],
69+
[pgac_write(0, "error %s: %m", "foo");])],
70+
[ac_archetype_ok=yes],
71+
[ac_archetype_ok=no])
72+
AC_LANG_POP([])
73+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
74+
])# PGAC_TEST_CXX_PRINTF_ARCHETYPE
75+
76+
4177
# PGAC_TYPE_128BIT_INT
4278
# --------------------
4379
# Check if __int128 is a working 128 bit integer type, and if so

configure

Lines changed: 102 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 18.3.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 18.4.
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='18.3'
586-
PACKAGE_STRING='PostgreSQL 18.3'
585+
PACKAGE_VERSION='18.4'
586+
PACKAGE_STRING='PostgreSQL 18.4'
587587
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
588588
PACKAGE_URL='https://www.postgresql.org/'
589589

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

14731473
Usage: $0 [OPTION]... [VAR=VALUE]...
14741474

@@ -1533,7 +1533,7 @@ fi
15331533

15341534
if test -n "$ac_init_help"; then
15351535
case $ac_init_help in
1536-
short | recursive ) echo "Configuration of PostgreSQL 18.3:";;
1536+
short | recursive ) echo "Configuration of PostgreSQL 18.4:";;
15371537
esac
15381538
cat <<\_ACEOF
15391539

@@ -1724,7 +1724,7 @@ fi
17241724
test -n "$ac_init_help" && exit $ac_status
17251725
if $ac_init_version; then
17261726
cat <<\_ACEOF
1727-
PostgreSQL configure 18.3
1727+
PostgreSQL configure 18.4
17281728
generated by GNU Autoconf 2.69
17291729

17301730
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2477,7 +2477,7 @@ cat >config.log <<_ACEOF
24772477
This file contains any messages produced by compilers while
24782478
running configure, to aid debugging if configure makes a mistake.
24792479

2480-
It was created by PostgreSQL $as_me 18.3, which was
2480+
It was created by PostgreSQL $as_me 18.4, which was
24812481
generated by GNU Autoconf 2.69. Invocation command line was
24822482

24832483
$ $0 $@
@@ -14837,8 +14837,8 @@ _ACEOF
1483714837
;;
1483814838
esac
1483914839

14840-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
14841-
$as_echo_n "checking for printf format archetype... " >&6; }
14840+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C printf format archetype" >&5
14841+
$as_echo_n "checking for C printf format archetype... " >&6; }
1484214842
if ${pgac_cv_printf_archetype+:} false; then :
1484314843
$as_echo_n "(cached) " >&6
1484414844
else
@@ -14898,7 +14898,97 @@ fi
1489814898
$as_echo "$pgac_cv_printf_archetype" >&6; }
1489914899

1490014900
cat >>confdefs.h <<_ACEOF
14901-
#define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
14901+
#define PG_C_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
14902+
_ACEOF
14903+
14904+
14905+
14906+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ printf format archetype" >&5
14907+
$as_echo_n "checking for C++ printf format archetype... " >&6; }
14908+
if ${pgac_cv_cxx_printf_archetype+:} false; then :
14909+
$as_echo_n "(cached) " >&6
14910+
else
14911+
pgac_cv_cxx_printf_archetype=gnu_printf
14912+
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
14913+
ac_cxx_werror_flag=yes
14914+
ac_ext=cpp
14915+
ac_cpp='$CXXCPP $CPPFLAGS'
14916+
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14917+
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14918+
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
14919+
14920+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14921+
/* end confdefs.h. */
14922+
extern void pgac_write(int ignore, const char *fmt,...)
14923+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));
14924+
int
14925+
main ()
14926+
{
14927+
pgac_write(0, "error %s: %m", "foo");
14928+
;
14929+
return 0;
14930+
}
14931+
_ACEOF
14932+
if ac_fn_cxx_try_compile "$LINENO"; then :
14933+
ac_archetype_ok=yes
14934+
else
14935+
ac_archetype_ok=no
14936+
fi
14937+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14938+
ac_ext=c
14939+
ac_cpp='$CPP $CPPFLAGS'
14940+
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14941+
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14942+
ac_compiler_gnu=$ac_cv_c_compiler_gnu
14943+
14944+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
14945+
14946+
if [ "$ac_archetype_ok" = no ]; then
14947+
pgac_cv_cxx_printf_archetype=__syslog__
14948+
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
14949+
ac_cxx_werror_flag=yes
14950+
ac_ext=cpp
14951+
ac_cpp='$CXXCPP $CPPFLAGS'
14952+
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14953+
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14954+
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
14955+
14956+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14957+
/* end confdefs.h. */
14958+
extern void pgac_write(int ignore, const char *fmt,...)
14959+
__attribute__((format($pgac_cv_cxx_printf_archetype, 2, 3)));
14960+
int
14961+
main ()
14962+
{
14963+
pgac_write(0, "error %s: %m", "foo");
14964+
;
14965+
return 0;
14966+
}
14967+
_ACEOF
14968+
if ac_fn_cxx_try_compile "$LINENO"; then :
14969+
ac_archetype_ok=yes
14970+
else
14971+
ac_archetype_ok=no
14972+
fi
14973+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14974+
ac_ext=c
14975+
ac_cpp='$CPP $CPPFLAGS'
14976+
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14977+
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14978+
ac_compiler_gnu=$ac_cv_c_compiler_gnu
14979+
14980+
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
14981+
14982+
if [ "$ac_archetype_ok" = no ]; then
14983+
pgac_cv_cxx_printf_archetype=printf
14984+
fi
14985+
fi
14986+
fi
14987+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_cxx_printf_archetype" >&5
14988+
$as_echo "$pgac_cv_cxx_printf_archetype" >&6; }
14989+
14990+
cat >>confdefs.h <<_ACEOF
14991+
#define PG_CXX_PRINTF_ATTRIBUTE $pgac_cv_cxx_printf_archetype
1490214992
_ACEOF
1490314993

1490414994

@@ -20089,7 +20179,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2008920179
# report actual input values of CONFIG_FILES etc. instead of their
2009020180
# values after options handling.
2009120181
ac_log="
20092-
This file was extended by PostgreSQL $as_me 18.3, which was
20182+
This file was extended by PostgreSQL $as_me 18.4, which was
2009320183
generated by GNU Autoconf 2.69. Invocation command line was
2009420184

2009520185
CONFIG_FILES = $CONFIG_FILES
@@ -20160,7 +20250,7 @@ _ACEOF
2016020250
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2016120251
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2016220252
ac_cs_version="\\
20163-
PostgreSQL config.status 18.3
20253+
PostgreSQL config.status 18.4
2016420254
configured by $0, generated by GNU Autoconf 2.69,
2016520255
with options \\"\$ac_cs_config\\"
2016620256

configure.ac

Lines changed: 2 additions & 1 deletion
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], [18.3], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
20+
AC_INIT([PostgreSQL], [18.4], [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
@@ -1681,6 +1681,7 @@ m4_defun([AC_PROG_CC_STDC], []) dnl We don't want that.
16811681
AC_C_BIGENDIAN
16821682
AC_C_INLINE
16831683
PGAC_PRINTF_ARCHETYPE
1684+
PGAC_CXX_PRINTF_ARCHETYPE
16841685
PGAC_C_STATIC_ASSERT
16851686
PGAC_C_TYPEOF
16861687
PGAC_C_TYPES_COMPATIBLE

contrib/basic_archive/basic_archive.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@ _PG_archive_module_init(void)
9090
/*
9191
* check_archive_directory
9292
*
93-
* Checks that the provided archive directory exists.
93+
* Checks that the provided archive directory path isn't too long.
9494
*/
9595
static bool
9696
check_archive_directory(char **newval, void **extra, GucSource source)
9797
{
98-
struct stat st;
99-
10098
/*
10199
* The default value is an empty string, so we have to accept that value.
102100
* Our check_configured callback also checks for this and prevents
@@ -115,17 +113,6 @@ check_archive_directory(char **newval, void **extra, GucSource source)
115113
return false;
116114
}
117115

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

contrib/hstore_plperl/hstore_plperl.c

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

122122
pcount = hv_iterinit(hv);
123123

124-
pairs = palloc(pcount * sizeof(Pairs));
124+
pairs = palloc_array(Pairs, pcount);
125125

126126
i = 0;
127127
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
@@ -150,7 +150,7 @@ plpython_to_hstore(PG_FUNCTION_ARGS)
150150
Py_ssize_t i;
151151
Pairs *pairs;
152152

153-
pairs = palloc(pcount * sizeof(*pairs));
153+
pairs = palloc_array(Pairs, pcount);
154154

155155
for (i = 0; i < pcount; i++)
156156
{

0 commit comments

Comments
 (0)