Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pkg/postgresql-13
1 result
Show changes
Commits on Source (9)
Showing
with 813 additions and 177 deletions
......@@ -25,9 +25,12 @@ src/interfaces/libpq/test/expected.out whitespace=-blank-at-eof
# These files are maintained or generated elsewhere. We take them as is.
configure -whitespace
ppport.h -whitespace
src/backend/jit/llvm/SectionMemoryManager.cpp -whitespace
src/backend/jit/llvm/SectionMemoryManager.LICENSE -whitespace
src/backend/regex/COPYRIGHT -whitespace
src/backend/regex/re_syntax.n -whitespace
src/backend/snowball/libstemmer/*.c -whitespace
src/backend/utils/mb/Unicode/*-std.txt -whitespace
src/include/jit/SectionMemoryManager.h -whitespace
src/include/snowball/libstemmer/* -whitespace
src/timezone/data/* -whitespace
0dc08bbfcc93ac4f04d2a3f4b9d1231a80e2cc0c
bf5710d3b6656516d828ebe9f6e2ffd49e54d084
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)
Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for PostgreSQL 13.16.
# Generated by GNU Autoconf 2.69 for PostgreSQL 13.19.
#
# Report bugs to <pgsql-bugs@lists.postgresql.org>.
#
......@@ -582,8 +582,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='PostgreSQL'
PACKAGE_TARNAME='postgresql'
PACKAGE_VERSION='13.16'
PACKAGE_STRING='PostgreSQL 13.16'
PACKAGE_VERSION='13.19'
PACKAGE_STRING='PostgreSQL 13.19'
PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org'
PACKAGE_URL='https://www.postgresql.org/'
 
......@@ -1436,7 +1436,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures PostgreSQL 13.16 to adapt to many kinds of systems.
\`configure' configures PostgreSQL 13.19 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1501,7 +1501,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of PostgreSQL 13.16:";;
short | recursive ) echo "Configuration of PostgreSQL 13.19:";;
esac
cat <<\_ACEOF
 
......@@ -1668,7 +1668,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
PostgreSQL configure 13.16
PostgreSQL configure 13.19
generated by GNU Autoconf 2.69
 
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2074,116 +2074,116 @@ $as_echo "$ac_res" >&6; }
 
} # ac_fn_c_check_func
 
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
# INCLUDES, setting cache variable VAR accordingly.
ac_fn_c_check_member ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
if eval \${$4+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
$5
int
main ()
{
if (sizeof ($2))
return 0;
static $2 ac_aggr;
if (ac_aggr.$3)
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
$5
int
main ()
{
if (sizeof (($2)))
return 0;
static $2 ac_aggr;
if (sizeof ac_aggr.$3)
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
eval "$3=yes"
eval "$4=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
eval ac_res=\$$4
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
} # ac_fn_c_check_type
} # ac_fn_c_check_member
 
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
# INCLUDES, setting cache variable VAR accordingly.
ac_fn_c_check_member ()
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
if eval \${$4+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
$4
int
main ()
{
static $2 ac_aggr;
if (ac_aggr.$3)
return 0;
if (sizeof ($2))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
$4
int
main ()
{
static $2 ac_aggr;
if (sizeof ac_aggr.$3)
return 0;
if (sizeof (($2)))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
eval "$4=no"
eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$4
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
} # ac_fn_c_check_member
} # ac_fn_c_check_type
 
# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
# --------------------------------------------
......@@ -2421,7 +2421,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by PostgreSQL $as_me 13.16, which was
It was created by PostgreSQL $as_me 13.19, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
$ $0 $@
......@@ -5258,6 +5258,83 @@ else
BITCODE_CXXFLAGS="-O2 $BITCODE_CXXFLAGS"
fi
 
# We use C constructs that became invalid in C23. Check if the compiler
# reports a standard higher than C17, with the flags selected above (so the
# user can control the language level explicitly to avoid the gcc/clang-only
# fallback logic below if preferred).
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC reports a C standard higher than ISO C17" >&5
$as_echo_n "checking whether $CC reports a C standard higher than ISO C17... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#if __STDC_VERSION__ > 201710L
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
POSTC17=no
else
POSTC17=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${POSTC17}" >&5
$as_echo "${POSTC17}" >&6; }
# If a too recent standard was detected with the user's CFLAGS, try asking for
# C17 with GNU extensions explicitly.
if test "$POSTC17" = yes; then
old_CFLAGS="$CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -std=gnu17, for CFLAGS" >&5
$as_echo_n "checking whether ${CC} supports -std=gnu17, for CFLAGS... " >&6; }
if ${pgac_cv_prog_CC_cflags__std_gnu17+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CC}
CFLAGS="${CFLAGS} -std=gnu17"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CC_cflags__std_gnu17=yes
else
pgac_cv_prog_CC_cflags__std_gnu17=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__std_gnu17" >&5
$as_echo "$pgac_cv_prog_CC_cflags__std_gnu17" >&6; }
if test x"$pgac_cv_prog_CC_cflags__std_gnu17" = x"yes"; then
CFLAGS="${CFLAGS} -std=gnu17"
fi
if test "$CFLAGS" = "$old_CFLAGS"; then
as_fn_error $? "cannot proceed" "$LINENO" 5
fi
fi
# C[XX]FLAGS we determined above will be added back at the end
user_CFLAGS=$CFLAGS
CFLAGS=""
......@@ -5645,6 +5722,97 @@ if test x"$pgac_cv_prog_CXX_cxxflags__Wimplicit_fallthrough_3" = x"yes"; then
fi
 
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wcast-function-type, for CFLAGS" >&5
$as_echo_n "checking whether ${CC} supports -Wcast-function-type, for CFLAGS... " >&6; }
if ${pgac_cv_prog_CC_cflags__Wcast_function_type+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CC}
CFLAGS="${CFLAGS} -Wcast-function-type"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CC_cflags__Wcast_function_type=yes
else
pgac_cv_prog_CC_cflags__Wcast_function_type=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wcast_function_type" >&5
$as_echo "$pgac_cv_prog_CC_cflags__Wcast_function_type" >&6; }
if test x"$pgac_cv_prog_CC_cflags__Wcast_function_type" = x"yes"; then
CFLAGS="${CFLAGS} -Wcast-function-type"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wcast-function-type, for CXXFLAGS" >&5
$as_echo_n "checking whether ${CXX} supports -Wcast-function-type, for CXXFLAGS... " >&6; }
if ${pgac_cv_prog_CXX_cxxflags__Wcast_function_type+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CXXFLAGS=$CXXFLAGS
pgac_save_CXX=$CXX
CXX=${CXX}
CXXFLAGS="${CXXFLAGS} -Wcast-function-type"
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
pgac_cv_prog_CXX_cxxflags__Wcast_function_type=yes
else
pgac_cv_prog_CXX_cxxflags__Wcast_function_type=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="$pgac_save_CXXFLAGS"
CXX="$pgac_save_CXX"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wcast_function_type" >&5
$as_echo "$pgac_cv_prog_CXX_cxxflags__Wcast_function_type" >&6; }
if test x"$pgac_cv_prog_CXX_cxxflags__Wcast_function_type" = x"yes"; then
CXXFLAGS="${CXXFLAGS} -Wcast-function-type"
fi
# This was included in -Wall/-Wformat in older GCC versions
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-security, for CFLAGS" >&5
......@@ -6320,6 +6488,50 @@ fi
if test -n "$NOT_THE_CFLAGS"; then
CFLAGS="$CFLAGS -Wno-stringop-truncation"
fi
# Suppress clang 16's strict warnings about function casts
NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wcast-function-type-strict, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CC} supports -Wcast-function-type-strict, for NOT_THE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CC_cflags__Wcast_function_type_strict+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
pgac_save_CC=$CC
CC=${CC}
CFLAGS="${NOT_THE_CFLAGS} -Wcast-function-type-strict"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_prog_CC_cflags__Wcast_function_type_strict=yes
else
pgac_cv_prog_CC_cflags__Wcast_function_type_strict=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"
CC="$pgac_save_CC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wcast_function_type_strict" >&5
$as_echo "$pgac_cv_prog_CC_cflags__Wcast_function_type_strict" >&6; }
if test x"$pgac_cv_prog_CC_cflags__Wcast_function_type_strict" = x"yes"; then
NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wcast-function-type-strict"
fi
if test -n "$NOT_THE_CFLAGS"; then
CFLAGS="$CFLAGS -Wno-cast-function-type-strict"
fi
elif test "$ICC" = yes; then
# Intel's compiler has a bug/misoptimization in checking for
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
......@@ -7151,6 +7363,111 @@ if test x"$pgac_cv_prog_CLANGXX_cxxflags__Xclang__no_opaque_pointers" = x"yes";
fi
 
 
# Ideally bitcode should perhaps match $CC's use, or not, of outline atomic
# functions, but for now we err on the side of suppressing them in bitcode,
# because we can't assume they're available at runtime. This affects aarch64
# builds using the basic armv8-a ISA without LSE support.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -mno-outline-atomics, for BITCODE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -mno-outline-atomics, for BITCODE_CFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CXXFLAGS=$CXXFLAGS
pgac_save_CXX=$CXX
CXX=${CLANG}
CXXFLAGS="${BITCODE_CFLAGS} -mno-outline-atomics"
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics=yes
else
pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="$pgac_save_CXXFLAGS"
CXX="$pgac_save_CXX"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics" >&5
$as_echo "$pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics" >&6; }
if test x"$pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics" = x"yes"; then
BITCODE_CFLAGS="${BITCODE_CFLAGS} -mno-outline-atomics"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -mno-outline-atomics, for BITCODE_CXXFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -mno-outline-atomics, for BITCODE_CXXFLAGS... " >&6; }
if ${pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CXXFLAGS=$CXXFLAGS
pgac_save_CXX=$CXX
CXX=${CLANG}
CXXFLAGS="${BITCODE_CXXFLAGS} -mno-outline-atomics"
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics=yes
else
pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="$pgac_save_CXXFLAGS"
CXX="$pgac_save_CXX"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics" >&5
$as_echo "$pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics" >&6; }
if test x"$pgac_cv_prog_CLANG_cxxflags__mno_outline_atomics" = x"yes"; then
BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -mno-outline-atomics"
fi
NOT_THE_CFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
$as_echo_n "checking whether ${CLANG} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
......@@ -13288,100 +13605,6 @@ fi
## Header files
##
 
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
if ${ac_cv_header_stdbool_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdbool.h>
#ifndef bool
"error: bool is not defined"
#endif
#ifndef false
"error: false is not defined"
#endif
#if false
"error: false is not 0"
#endif
#ifndef true
"error: true is not defined"
#endif
#if true != 1
"error: true is not 1"
#endif
#ifndef __bool_true_false_are_defined
"error: __bool_true_false_are_defined is not defined"
#endif
struct s { _Bool s: 1; _Bool t; } s;
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
char d[(bool) 0.5 == true ? 1 : -1];
/* See body of main program for 'e'. */
char f[(_Bool) 0.0 == false ? 1 : -1];
char g[true];
char h[sizeof (_Bool)];
char i[sizeof s.t];
enum { j = false, k = true, l = false * true, m = true * 256 };
/* The following fails for
HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
_Bool n[m];
char o[sizeof n == m * sizeof n[0] ? 1 : -1];
char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
/* Catch a bug in an HP-UX C compiler. See
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
*/
_Bool q = true;
_Bool *pq = &q;
int
main ()
{
bool e = &s;
*pq |= q;
*pq |= ! q;
/* Refer to every declared value, to avoid compiler optimizations. */
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ !m + !n + !o + !p + !q + !pq);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdbool_h=yes
else
ac_cv_header_stdbool_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
$as_echo "$ac_cv_header_stdbool_h" >&6; }
ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
if test "x$ac_cv_type__Bool" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE__BOOL 1
_ACEOF
fi
if test $ac_cv_header_stdbool_h = yes; then
$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h wctype.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
......@@ -15236,9 +15459,7 @@ $as_echo_n "checking size of bool... " >&6; }
if ${ac_cv_sizeof_bool+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "#include <stdbool.h>
"; then :
 
else
......@@ -15264,7 +15485,7 @@ _ACEOF
 
 
 
if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then
if test "$ac_cv_sizeof_bool" = 1; then
 
$as_echo "#define PG_USE_STDBOOL 1" >>confdefs.h
 
......@@ -16503,6 +16724,12 @@ esac
;;
esac
 
case " $LIBOBJS " in
*" win32ntdll.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS win32ntdll.$ac_objext"
;;
esac
case " $LIBOBJS " in
*" win32security.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS win32security.$ac_objext"
......@@ -16515,6 +16742,12 @@ esac
;;
esac
 
case " $LIBOBJS " in
*" win32stat.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS win32stat.$ac_objext"
;;
esac
 
$as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
 
......@@ -18084,7 +18317,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Check for ARMv8 CRC Extension intrinsics to do CRC calculations.
#
# First check if __crc32c* intrinsics can be used with the default compiler
# flags. If not, check if adding -march=armv8-a+crc flag helps.
# flags. If not, check if adding "-march=armv8-a+crc+simd" flag helps.
# On systems using soft-float ABI, "-march=armv8-a+crc" is required instead.
# CFLAGS_ARMV8_CRC32C is set if the extra flag is required.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=" >&5
$as_echo_n "checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... " >&6; }
......@@ -18127,7 +18361,48 @@ if test x"$pgac_cv_armv8_crc32c_intrinsics_" = x"yes"; then
fi
 
if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc+simd" >&5
$as_echo_n "checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc+simd... " >&6; }
if ${pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrcpsimd+:} false; then :
$as_echo_n "(cached) " >&6
else
pgac_save_CFLAGS=$CFLAGS
CFLAGS="$pgac_save_CFLAGS -march=armv8-a+crc+simd"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <arm_acle.h>
int
main ()
{
unsigned int crc = 0;
crc = __crc32cb(crc, 0);
crc = __crc32ch(crc, 0);
crc = __crc32cw(crc, 0);
crc = __crc32cd(crc, 0);
/* return computed value, to prevent the above being optimized away */
return crc == 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrcpsimd=yes
else
pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrcpsimd=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS="$pgac_save_CFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrcpsimd" >&5
$as_echo "$pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrcpsimd" >&6; }
if test x"$pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrcpsimd" = x"yes"; then
CFLAGS_ARMV8_CRC32C="-march=armv8-a+crc+simd"
pgac_armv8_crc32c_intrinsics=yes
fi
if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc" >&5
$as_echo_n "checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... " >&6; }
if ${pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc+:} false; then :
$as_echo_n "(cached) " >&6
......@@ -18167,6 +18442,7 @@ if test x"$pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc" = x"yes"; then
pgac_armv8_crc32c_intrinsics=yes
fi
 
fi
fi
 
 
......@@ -20038,7 +20314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by PostgreSQL $as_me 13.16, which was
This file was extended by PostgreSQL $as_me 13.19, which was
generated by GNU Autoconf 2.69. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -20109,7 +20385,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
PostgreSQL config.status 13.16
PostgreSQL config.status 13.19
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
 
......
......@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
AC_INIT([PostgreSQL], [13.16], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
AC_INIT([PostgreSQL], [13.19], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
......@@ -456,6 +456,26 @@ else
BITCODE_CXXFLAGS="-O2 $BITCODE_CXXFLAGS"
fi
# We use C constructs that became invalid in C23. Check if the compiler
# reports a standard higher than C17, with the flags selected above (so the
# user can control the language level explicitly to avoid the gcc/clang-only
# fallback logic below if preferred).
AC_MSG_CHECKING([whether $CC reports a C standard higher than ISO C17])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [@%:@if __STDC_VERSION__ > 201710L
choke me
@%:@endif])], [POSTC17=no], [POSTC17=yes])
AC_MSG_RESULT(${POSTC17})
# If a too recent standard was detected with the user's CFLAGS, try asking for
# C17 with GNU extensions explicitly.
if test "$POSTC17" = yes; then
old_CFLAGS="$CFLAGS"
PGAC_PROG_CC_CFLAGS_OPT([-std=gnu17])
if test "$CFLAGS" = "$old_CFLAGS"; then
AC_MSG_ERROR([cannot proceed])
fi
fi
# C[XX]FLAGS we determined above will be added back at the end
user_CFLAGS=$CFLAGS
CFLAGS=""
......@@ -498,6 +518,8 @@ if test "$GCC" = yes -a "$ICC" = no; then
PGAC_PROG_CXX_CFLAGS_OPT([-Wmissing-format-attribute])
PGAC_PROG_CC_CFLAGS_OPT([-Wimplicit-fallthrough=3])
PGAC_PROG_CXX_CFLAGS_OPT([-Wimplicit-fallthrough=3])
PGAC_PROG_CC_CFLAGS_OPT([-Wcast-function-type])
PGAC_PROG_CXX_CFLAGS_OPT([-Wcast-function-type])
# This was included in -Wall/-Wformat in older GCC versions
PGAC_PROG_CC_CFLAGS_OPT([-Wformat-security])
PGAC_PROG_CXX_CFLAGS_OPT([-Wformat-security])
......@@ -551,6 +573,12 @@ if test "$GCC" = yes -a "$ICC" = no; then
if test -n "$NOT_THE_CFLAGS"; then
CFLAGS="$CFLAGS -Wno-stringop-truncation"
fi
# Suppress clang 16's strict warnings about function casts
NOT_THE_CFLAGS=""
PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wcast-function-type-strict])
if test -n "$NOT_THE_CFLAGS"; then
CFLAGS="$CFLAGS -Wno-cast-function-type-strict"
fi
elif test "$ICC" = yes; then
# Intel's compiler has a bug/misoptimization in checking for
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
......@@ -593,6 +621,13 @@ if test "$with_llvm" = yes ; then
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, BITCODE_CFLAGS, [-Xclang -no-opaque-pointers])
PGAC_PROG_VARCXX_VARFLAGS_OPT(CLANGXX, BITCODE_CXXFLAGS, [-Xclang -no-opaque-pointers])
# Ideally bitcode should perhaps match $CC's use, or not, of outline atomic
# functions, but for now we err on the side of suppressing them in bitcode,
# because we can't assume they're available at runtime. This affects aarch64
# builds using the basic armv8-a ISA without LSE support.
PGAC_PROG_VARCXX_VARFLAGS_OPT(CLANG, BITCODE_CFLAGS, [-mno-outline-atomics])
PGAC_PROG_VARCXX_VARFLAGS_OPT(CLANG, BITCODE_CXXFLAGS, [-mno-outline-atomics])
NOT_THE_CFLAGS=""
PGAC_PROG_VARCC_VARFLAGS_OPT(CLANG, NOT_THE_CFLAGS, [-Wunused-command-line-argument])
if test -n "$NOT_THE_CFLAGS"; then
......@@ -1368,8 +1403,6 @@ AC_SUBST(UUID_LIBS)
## Header files
##
AC_HEADER_STDBOOL
AC_CHECK_HEADERS(m4_normalize([
atomic.h
copyfile.h
......@@ -1678,14 +1711,11 @@ if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.])
fi
AC_CHECK_SIZEOF([bool], [],
[#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif])
AC_CHECK_SIZEOF([bool], [], [#include <stdbool.h>])
dnl We use <stdbool.h> if we have it and it declares type bool as having
dnl size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then
dnl We use <stdbool.h> if bool has size 1 after including it. Otherwise, c.h
dnl will fall back to declaring bool as unsigned char.
if test "$ac_cv_sizeof_bool" = 1; then
AC_DEFINE([PG_USE_STDBOOL], 1,
[Define to 1 to use <stdbool.h> to define type bool.])
fi
......@@ -1871,8 +1901,10 @@ if test "$PORTNAME" = "win32"; then
AC_LIBOBJ(system)
AC_LIBOBJ(win32env)
AC_LIBOBJ(win32error)
AC_LIBOBJ(win32ntdll)
AC_LIBOBJ(win32security)
AC_LIBOBJ(win32setlocale)
AC_LIBOBJ(win32stat)
AC_DEFINE([HAVE_SYMLINK], 1,
[Define to 1 if you have the `symlink' function.])
AC_CHECK_TYPES(MINIDUMP_TYPE, [pgac_minidump_type=yes], [pgac_minidump_type=no], [
......@@ -2092,11 +2124,15 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
# Check for ARMv8 CRC Extension intrinsics to do CRC calculations.
#
# First check if __crc32c* intrinsics can be used with the default compiler
# flags. If not, check if adding -march=armv8-a+crc flag helps.
# flags. If not, check if adding "-march=armv8-a+crc+simd" flag helps.
# On systems using soft-float ABI, "-march=armv8-a+crc" is required instead.
# CFLAGS_ARMV8_CRC32C is set if the extra flag is required.
PGAC_ARMV8_CRC32C_INTRINSICS([])
if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc])
PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc+simd])
if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc])
fi
fi
AC_SUBST(CFLAGS_ARMV8_CRC32C)
......
......@@ -121,6 +121,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
*/
bas = GetAccessStrategy(BAS_BULKREAD);
npages = RelationGetNumberOfBlocks(scan->indexRelation);
pgstat_count_index_scan(scan->indexRelation);
for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
{
......
......@@ -47,4 +47,73 @@ SELECT lo_get(43214);
DELETE FROM image;
SELECT lo_get(43214);
ERROR: large object 43214 does not exist
-- Now let's try it with an AFTER trigger
DROP TRIGGER t_raster ON image;
CREATE CONSTRAINT TRIGGER t_raster AFTER UPDATE OR DELETE ON image
DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster);
SELECT lo_create(43223);
lo_create
-----------
43223
(1 row)
SELECT lo_create(43224);
lo_create
-----------
43224
(1 row)
SELECT lo_create(43225);
lo_create
-----------
43225
(1 row)
INSERT INTO image (title, raster) VALUES ('beautiful image', 43223);
SELECT lo_get(43223);
lo_get
--------
\x
(1 row)
UPDATE image SET raster = 43224 WHERE title = 'beautiful image';
SELECT lo_get(43223); -- gone
ERROR: large object 43223 does not exist
SELECT lo_get(43224);
lo_get
--------
\x
(1 row)
-- test updating of unrelated column
UPDATE image SET title = 'beautiful picture' WHERE title = 'beautiful image';
SELECT lo_get(43224);
lo_get
--------
\x
(1 row)
-- this case used to be buggy
BEGIN;
UPDATE image SET title = 'beautiful image' WHERE title = 'beautiful picture';
UPDATE image SET raster = 43225 WHERE title = 'beautiful image';
SELECT lo_get(43224);
lo_get
--------
\x
(1 row)
COMMIT;
SELECT lo_get(43224); -- gone
ERROR: large object 43224 does not exist
SELECT lo_get(43225);
lo_get
--------
\x
(1 row)
DELETE FROM image;
SELECT lo_get(43225); -- gone
ERROR: large object 43225 does not exist
DROP TABLE image;
......@@ -27,4 +27,44 @@ DELETE FROM image;
SELECT lo_get(43214);
-- Now let's try it with an AFTER trigger
DROP TRIGGER t_raster ON image;
CREATE CONSTRAINT TRIGGER t_raster AFTER UPDATE OR DELETE ON image
DEFERRABLE INITIALLY DEFERRED
FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster);
SELECT lo_create(43223);
SELECT lo_create(43224);
SELECT lo_create(43225);
INSERT INTO image (title, raster) VALUES ('beautiful image', 43223);
SELECT lo_get(43223);
UPDATE image SET raster = 43224 WHERE title = 'beautiful image';
SELECT lo_get(43223); -- gone
SELECT lo_get(43224);
-- test updating of unrelated column
UPDATE image SET title = 'beautiful picture' WHERE title = 'beautiful image';
SELECT lo_get(43224);
-- this case used to be buggy
BEGIN;
UPDATE image SET title = 'beautiful image' WHERE title = 'beautiful picture';
UPDATE image SET raster = 43225 WHERE title = 'beautiful image';
SELECT lo_get(43224);
COMMIT;
SELECT lo_get(43224); -- gone
SELECT lo_get(43225);
DELETE FROM image;
SELECT lo_get(43225); -- gone
DROP TABLE image;
......@@ -232,3 +232,13 @@ SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);
(1 row)
-- tests for sequences
create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
tuple_data_split
-------------------------------------------------------
{"\\x0100000000000001","\\x0000000000000000","\\x00"}
(1 row)
drop sequence test_sequence;
......@@ -318,7 +318,11 @@ tuple_data_split_internal(Oid relid, char *tupdata,
raw_attrs = initArrayResult(BYTEAOID, CurrentMemoryContext, false);
nattrs = tupdesc->natts;
if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
/*
* Sequences always use heap AM, but they don't show that in the catalogs.
*/
if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));
......
......@@ -95,3 +95,9 @@ SHOW block_size \gset
SELECT fsm_page_contents(decode(repeat('00', :block_size), 'hex'));
SELECT page_header(decode(repeat('00', :block_size), 'hex'));
SELECT page_checksum(decode(repeat('00', :block_size), 'hex'), 1);
-- tests for sequences
create sequence test_sequence start 72057594037927937;
select tuple_data_split('test_sequence'::regclass, t_data, t_infomask, t_infomask2, t_bits)
from heap_page_items(get_raw_page('test_sequence', 0));
drop sequence test_sequence;
......@@ -2372,6 +2372,9 @@ ERROR: value 2025 out of bounds for option "siglen"
DETAIL: Valid values are between "1" and "2024".
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
set enable_seqscan=off;
-- check index compatibility handling when opclass option is specified
alter table test_trgm alter column t type varchar(768);
alter table test_trgm alter column t type text;
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
t | sml
-------------+----------
......
......@@ -52,6 +52,10 @@ create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2025));
create index trgm_idx on test_trgm using gist (t gist_trgm_ops(siglen=2024));
set enable_seqscan=off;
-- check index compatibility handling when opclass option is specified
alter table test_trgm alter column t type varchar(768);
alter table test_trgm alter column t type text;
select t,similarity(t,'qwertyu0988') as sml from test_trgm where t % 'qwertyu0988' order by sml desc, t;
select t,similarity(t,'gwertyu0988') as sml from test_trgm where t % 'gwertyu0988' order by sml desc, t;
select t,similarity(t,'gwertyu1988') as sml from test_trgm where t % 'gwertyu1988' order by sml desc, t;
......
......@@ -18,6 +18,7 @@
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "storage/smgr.h"
#include "utils/rel.h"
......@@ -385,6 +386,7 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
Relation rel;
ForkNumber fork;
BlockNumber block;
BlockNumber old_block;
rel = relation_open(relid, AccessExclusiveLock);
......@@ -394,15 +396,24 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
/* Forcibly reset cached file size */
RelationGetSmgr(rel)->smgr_vm_nblocks = InvalidBlockNumber;
/* Compute new and old size before entering critical section. */
fork = VISIBILITYMAP_FORKNUM;
block = visibilitymap_prepare_truncate(rel, 0);
if (BlockNumberIsValid(block))
{
fork = VISIBILITYMAP_FORKNUM;
smgrtruncate(RelationGetSmgr(rel), &fork, 1, &block);
}
old_block = BlockNumberIsValid(block) ? smgrnblocks(RelationGetSmgr(rel), fork) : 0;
/*
* WAL-logging, buffer dropping, file truncation must be atomic and all on
* one side of a checkpoint. See RelationTruncate() for discussion.
*/
Assert(!MyProc->delayChkpt);
MyProc->delayChkpt = true;
Assert(!MyProc->delayChkptEnd);
MyProc->delayChkptEnd = true;
START_CRIT_SECTION();
if (RelationNeedsWAL(rel))
{
XLogRecPtr lsn;
xl_smgr_truncate xlrec;
xlrec.blkno = 0;
......@@ -412,9 +423,18 @@ pg_truncate_visibility_map(PG_FUNCTION_ARGS)
XLogBeginInsert();
XLogRegisterData((char *) &xlrec, sizeof(xlrec));
XLogInsert(RM_SMGR_ID, XLOG_SMGR_TRUNCATE | XLR_SPECIAL_REL_UPDATE);
lsn = XLogInsert(RM_SMGR_ID,
XLOG_SMGR_TRUNCATE | XLR_SPECIAL_REL_UPDATE);
XLogFlush(lsn);
}
if (BlockNumberIsValid(block))
smgrtruncate2(RelationGetSmgr(rel), &fork, 1, &old_block, &block);
END_CRIT_SECTION();
MyProc->delayChkpt = false;
MyProc->delayChkptEnd = false;
/*
* Release the lock right away, not at commit time.
*
......
......@@ -244,6 +244,30 @@ select pgstathashindex('test_partition_hash_idx');
(4,8,0,1,0,0,0,100)
(1 row)
-- these should work for sequences
create sequence test_sequence;
select count(*) from pgstattuple('test_sequence');
count
-------
1
(1 row)
select pg_relpages('test_sequence');
pg_relpages
-------------
1
(1 row)
-- these should fail for sequences
select pgstatindex('test_sequence');
ERROR: relation "test_sequence" is not a btree index
select pgstatginindex('test_sequence');
ERROR: relation "test_sequence" is not a GIN index
select pgstathashindex('test_sequence');
ERROR: relation "test_sequence" is not a hash index
select pgstattuple_approx('test_sequence');
ERROR: "test_sequence" is not a table or materialized view
drop sequence test_sequence;
drop table test_partitioned;
drop view test_view;
drop foreign table test_foreign_table;
......
......@@ -335,7 +335,11 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
pgstattuple_type stat = {0};
SnapshotData SnapshotDirty;
if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
/*
* Sequences always use heap AM, but they don't show that in the catalogs.
*/
if (rel->rd_rel->relkind != RELKIND_SEQUENCE &&
rel->rd_rel->relam != HEAP_TABLE_AM_OID)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("only heap AM is supported")));
......
......@@ -114,6 +114,18 @@ create index test_partition_hash_idx on test_partition using hash (a);
select pgstatindex('test_partition_idx');
select pgstathashindex('test_partition_hash_idx');
-- these should work for sequences
create sequence test_sequence;
select count(*) from pgstattuple('test_sequence');
select pg_relpages('test_sequence');
-- these should fail for sequences
select pgstatindex('test_sequence');
select pgstatginindex('test_sequence');
select pgstathashindex('test_sequence');
select pgstattuple_approx('test_sequence');
drop sequence test_sequence;
drop table test_partitioned;
drop view test_view;
drop foreign table test_foreign_table;
......
......@@ -432,7 +432,7 @@ pgxml_xpath(text *document, xmlChar *xpath, xpath_workspace *workspace)
workspace->ctxt->node = xmlDocGetRootElement(workspace->doctree);
/* compile the path */
comppath = xmlXPathCompile(xpath);
comppath = xmlXPathCtxtCompile(workspace->ctxt, xpath);
if (comppath == NULL)
xml_ereport(xmlerrcxt, ERROR, ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
"XPath Syntax Error");
......@@ -746,7 +746,7 @@ xpath_table(PG_FUNCTION_ARGS)
ctxt->node = xmlDocGetRootElement(doctree);
/* compile the path */
comppath = xmlXPathCompile(xpaths[j]);
comppath = xmlXPathCtxtCompile(ctxt, xpaths[j]);
if (comppath == NULL)
xml_ereport(xmlerrcxt, ERROR,
ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
......
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: COPYRIGHT
Copyright: 1996-2024, PostgreSQL Global Development Group
Copyright: 1996-2025, PostgreSQL Global Development Group
1994, The Regents of the University of California
License: PostgreSQL
......@@ -122,7 +122,7 @@ Copyright: no-info-found
License: JSON
Files: doc/src/sgml/html/legalnotice.html
Copyright: 1996-2024, the PostgreSQL Global Development Group.
Copyright: 1996-2025, the PostgreSQL Global Development Group.
1994, –5
License: PostgreSQL
......@@ -135,7 +135,7 @@ Copyright: no-info-found
License: JSON
Files: doc/src/sgml/legal.sgml
Copyright: 1996-2024, the PostgreSQL Global Development Group.
Copyright: 1996-2025, the PostgreSQL Global Development Group.
1994, 1995
License: PostgreSQL
......
postgresql-13 (13.19-0+deb11u1+apertis0) apertis; urgency=medium
* Sync from debian/bullseye-security.
-- Apertis CI <devel@lists.apertis.org> Fri, 14 Feb 2025 07:42:59 +0000
postgresql-13 (13.19-0+deb11u1) bullseye-security; urgency=medium
* New upstream version 13.19.
+ Harden PQescapeString and allied functions against invalidly-encoded
input strings (Andres Freund, Noah Misch)
Data-quoting functions supplied by libpq now fully check the encoding
validity of their input. If invalid characters are detected, they
report an error if possible. For the ones that lack an error return
convention, the output string is adjusted to ensure that the server will
report invalid encoding and no intervening processing will be fooled by
bytes that might happen to match single quote, backslash, etc.
The purpose of this change is to guard against SQL-injection attacks
that are possible if one of these functions is used to quote crafted
input. There is no hazard when the resulting string is sent directly to
a PostgreSQL server (which would check its encoding anyway), but there
is a risk when it is passed through psql or other client-side code.
Historically such code has not carefully vetted encoding, and in many
cases it's not clear what it should do if it did detect such a problem.
This fix is effective only if the data-quoting function, the server, and
any intermediate processing agree on the character encoding that's being
used. Applications that insert untrusted input into SQL commands should
take special care to ensure that that's true.
Applications and drivers that quote untrusted input without using these
libpq functions may be at risk of similar problems. They should first
confirm the data is valid in the encoding expected by the server.
The PostgreSQL Project thanks Stephen Fewer for reporting this problem.
(CVE-2025-1094)
-- Christoph Berg <myon@debian.org> Tue, 11 Feb 2025 11:27:41 +0100
postgresql-13 (13.18-0+deb11u1+apertis0) apertis; urgency=medium
* Sync from debian/bullseye-security.
-- Apertis CI <devel@lists.apertis.org> Fri, 22 Nov 2024 08:33:15 +0000
postgresql-13 (13.18-0+deb11u1) bullseye-security; urgency=medium
* New upstream version 13.18.
+ Restore functionality of ALTER {ROLE|DATABASE} SET role
The fix for CVE-2024-10978 accidentally caused settings for role to not
be applied if they come from non-interactive sources, including previous
ALTER {ROLE|DATABASE} commands and the PGOPTIONS environment variable.
-- Christoph Berg <myon@debian.org> Tue, 19 Nov 2024 15:36:12 +0100
postgresql-13 (13.17-0+deb11u1) bullseye-security; urgency=medium
* New upstream version 13.17.
+ Ensure cached plans are marked as dependent on the calling role when RLS
applies to a non-top-level table reference (Nathan Bossart)
If a CTE, subquery, sublink, security invoker view, or coercion
projection in a query references a table with row-level security
policies, we neglected to mark the resulting plan as potentially
dependent on which role is executing it. This could lead to later query
executions in the same session using the wrong plan, and then returning
or hiding rows that should have been hidden or returned instead.
The PostgreSQL Project thanks Wolfgang Walther for reporting this
problem. (CVE-2024-10976)
+ Make libpq discard error messages received during SSL or GSS protocol
negotiation (Jacob Champion)
An error message received before encryption negotiation is completed
might have been injected by a man-in-the-middle, rather than being real
server output. Reporting it opens the door to various security hazards;
for example, the message might spoof a query result that a careless user
could mistake for correct output. The best answer seems to be to
discard such data and rely only on libpq's own report of the connection
failure.
The PostgreSQL Project thanks Jacob Champion for reporting this problem.
(CVE-2024-10977)
+ Fix unintended interactions between SET SESSION AUTHORIZATION and SET
ROLE (Tom Lane)
The SQL standard mandates that SET SESSION AUTHORIZATION have a
side-effect of doing SET ROLE NONE. Our implementation of that was
flawed, creating more interaction between the two settings than
intended. Notably, rolling back a transaction that had done SET SESSION
AUTHORIZATION would revert ROLE to NONE even if that had not been the
previous state, so that the effective user ID might now be different
from what it had been before the transaction. Transiently setting
session_authorization in a function SET clause had a similar effect. A
related bug was that if a parallel worker inspected
current_setting('role'), it saw none even when it should see something
else.
The PostgreSQL Project thanks Tom Lane for reporting this problem.
(CVE-2024-10978)
+ Prevent trusted PL/Perl code from changing environment variables
(Andrew Dunstan, Noah Misch)
The ability to manipulate process environment variables such as PATH
gives an attacker opportunities to execute arbitrary code. Therefore,
trusted PLs must not offer the ability to do that. To fix plperl,
replace %ENV with a tied hash that rejects any modification attempt with
a warning. Untrusted plperlu retains the ability to change the
environment.
The PostgreSQL Project thanks Coby Abrams for reporting this problem.
(CVE-2024-10979)
-- Christoph Berg <myon@debian.org> Tue, 12 Nov 2024 15:12:10 +0100
postgresql-13 (13.16-0+deb11u1+apertis0) apertis; urgency=medium
* Sync from debian/bullseye-security.
......