diff -Nru postgresql-9.5-9.5.10/config/c-compiler.m4 postgresql-9.5-9.5.14/config/c-compiler.m4 --- postgresql-9.5-9.5.10/config/c-compiler.m4 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/config/c-compiler.m4 2018-08-06 20:09:28.000000000 +0000 @@ -128,9 +128,11 @@ # PGAC_TYPE_128BIT_INT # --------------------- # Check if __int128 is a working 128 bit integer type, and if so -# define PG_INT128_TYPE to that typename. This currently only detects -# a GCC/clang extension, but support for different environments may be -# added in the future. +# define PG_INT128_TYPE to that typename, and define ALIGNOF_PG_INT128_TYPE +# as its alignment requirement. +# +# This currently only detects a GCC/clang extension, but support for other +# environments may be added in the future. # # For the moment we only test for support for 128bit math; support for # 128bit literals and snprintf is not required. @@ -138,28 +140,61 @@ [AC_CACHE_CHECK([for __int128], [pgac_cv__128bit_int], [AC_LINK_IFELSE([AC_LANG_PROGRAM([ /* + * We don't actually run this test, just link it to verify that any support + * functions needed for __int128 are present. + * * These are globals to discourage the compiler from folding all the * arithmetic tests down to compile-time constants. We do not have - * convenient support for 64bit literals at this point... + * convenient support for 128bit literals at this point... */ __int128 a = 48828125; -__int128 b = 97656255; +__int128 b = 97656250; ],[ __int128 c,d; a = (a << 12) + 1; /* 200000000001 */ b = (b << 12) + 5; /* 400000000005 */ -/* use the most relevant arithmetic ops */ +/* try the most relevant arithmetic ops */ c = a * b; d = (c + b) / b; -/* return different values, to prevent optimizations */ +/* must use the results, else compiler may optimize arithmetic away */ if (d != a+1) - return 0; -return 1; + return 1; ])], [pgac_cv__128bit_int=yes], [pgac_cv__128bit_int=no])]) if test x"$pgac_cv__128bit_int" = xyes ; then - AC_DEFINE(PG_INT128_TYPE, __int128, [Define to the name of a signed 128-bit integer type.]) + # Use of non-default alignment with __int128 tickles bugs in some compilers. + # If not cross-compiling, we can test for bugs and disable use of __int128 + # with buggy compilers. If cross-compiling, hope for the best. + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83925 + AC_CACHE_CHECK([for __int128 alignment bug], [pgac_cv__128bit_int_bug], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([ +/* This must match the corresponding code in c.h: */ +#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__) +#define pg_attribute_aligned(a) __attribute__((aligned(a))) +#endif +typedef __int128 int128a +#if defined(pg_attribute_aligned) +pg_attribute_aligned(8) +#endif +; +int128a holder; +void pass_by_val(void *buffer, int128a par) { holder = par; } +],[ +long int i64 = 97656225L << 12; +int128a q; +pass_by_val(main, (int128a) i64); +q = (int128a) i64; +if (q != holder) + return 1; +])], + [pgac_cv__128bit_int_bug=ok], + [pgac_cv__128bit_int_bug=broken], + [pgac_cv__128bit_int_bug="assuming ok"])]) + if test x"$pgac_cv__128bit_int_bug" != xbroken ; then + AC_DEFINE(PG_INT128_TYPE, __int128, [Define to the name of a signed 128-bit integer type.]) + AC_CHECK_ALIGNOF(PG_INT128_TYPE) + fi fi])# PGAC_TYPE_128BIT_INT @@ -424,7 +459,7 @@ [pgac_cv_gcc_sync_int32_cas="yes"], [pgac_cv_gcc_sync_int32_cas="no"])]) if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then - AC_DEFINE(HAVE_GCC__SYNC_INT32_CAS, 1, [Define to 1 if you have __sync_compare_and_swap(int *, int, int).]) + AC_DEFINE(HAVE_GCC__SYNC_INT32_CAS, 1, [Define to 1 if you have __sync_val_compare_and_swap(int *, int, int).]) fi])# PGAC_HAVE_GCC__SYNC_INT32_CAS # PGAC_HAVE_GCC__SYNC_INT64_CAS @@ -439,7 +474,7 @@ [pgac_cv_gcc_sync_int64_cas="yes"], [pgac_cv_gcc_sync_int64_cas="no"])]) if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then - AC_DEFINE(HAVE_GCC__SYNC_INT64_CAS, 1, [Define to 1 if you have __sync_compare_and_swap(int64 *, int64, int64).]) + AC_DEFINE(HAVE_GCC__SYNC_INT64_CAS, 1, [Define to 1 if you have __sync_val_compare_and_swap(int64 *, int64, int64).]) fi])# PGAC_HAVE_GCC__SYNC_INT64_CAS # PGAC_HAVE_GCC__ATOMIC_INT32_CAS @@ -471,7 +506,7 @@ [pgac_cv_gcc_atomic_int64_cas="yes"], [pgac_cv_gcc_atomic_int64_cas="no"])]) if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then - AC_DEFINE(HAVE_GCC__ATOMIC_INT64_CAS, 1, [Define to 1 if you have __atomic_compare_exchange_n(int64 *, int *, int64).]) + AC_DEFINE(HAVE_GCC__ATOMIC_INT64_CAS, 1, [Define to 1 if you have __atomic_compare_exchange_n(int64 *, int64 *, int64).]) fi])# PGAC_HAVE_GCC__ATOMIC_INT64_CAS # PGAC_SSE42_CRC32_INTRINSICS diff -Nru postgresql-9.5-9.5.10/config/perl.m4 postgresql-9.5-9.5.14/config/perl.m4 --- postgresql-9.5-9.5.10/config/perl.m4 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/config/perl.m4 2018-08-06 20:09:28.000000000 +0000 @@ -51,19 +51,23 @@ # PGAC_CHECK_PERL_EMBED_CCFLAGS # ----------------------------- -# We selectively extract stuff from $Config{ccflags}. We don't really need -# anything except -D switches, and other sorts of compiler switches can -# actively break things if Perl was compiled with a different compiler. -# Moreover, although Perl likes to put stuff like -D_LARGEFILE_SOURCE and -# -D_FILE_OFFSET_BITS=64 here, it would be fatal to try to compile PL/Perl -# to a different libc ABI than core Postgres uses. The available information -# says that all the symbols that affect Perl's own ABI begin with letters, -# so it should be sufficient to adopt -D switches for symbols not beginning -# with underscore. An exception is that we need to let through -# -D_USE_32BIT_TIME_T if it's present. (We probably could restrict that to -# only get through on Windows, but for the moment we let it through always.) -# For debugging purposes, let's have the configure output report the raw -# ccflags value as well as the set of flags we chose to adopt. +# We selectively extract stuff from $Config{ccflags}. For debugging purposes, +# let's have the configure output report the raw ccflags value as well as the +# set of flags we chose to adopt. We don't really need anything except -D +# switches, and other sorts of compiler switches can actively break things if +# Perl was compiled with a different compiler. Moreover, although Perl likes +# to put stuff like -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 here, it +# would be fatal to try to compile PL/Perl to a different libc ABI than core +# Postgres uses. The available information says that most symbols that affect +# Perl's own ABI begin with letters, so it's almost sufficient to adopt -D +# switches for symbols not beginning with underscore. Some exceptions are the +# Windows-specific -D_USE_32BIT_TIME_T and -D__MINGW_USE_VC2005_COMPAT; see +# Mkvcbuild.pm for details. We absorb the former when Perl reports it. Perl +# never reports the latter, and we don't attempt to deduce when it's needed. +# Consequently, we don't support using MinGW to link to MSVC-built Perl. As +# of 2017, all supported ActivePerl and Strawberry Perl are MinGW-built. If +# that changes or an MSVC-built Perl distribution becomes prominent, we can +# revisit this limitation. AC_DEFUN([PGAC_CHECK_PERL_EMBED_CCFLAGS], [AC_REQUIRE([PGAC_PATH_PERL]) AC_MSG_CHECKING([for CFLAGS recommended by Perl]) @@ -86,12 +90,19 @@ [AC_REQUIRE([PGAC_PATH_PERL]) AC_MSG_CHECKING(for flags to link embedded Perl) if test "$PORTNAME" = "win32" ; then -perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib` -test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib" + perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib` + if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then + perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib" + else + perl_lib=`basename $perl_archlibexp/CORE/libperl[[5-9]]*.a .a | sed 's/^lib//'` + if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then + perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib" + fi + fi else -pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts` -pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'` -perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]` + pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts` + pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'` + perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]` fi AC_SUBST(perl_embed_ldflags)dnl if test -z "$perl_embed_ldflags" ; then diff -Nru postgresql-9.5-9.5.10/configure postgresql-9.5-9.5.14/configure --- postgresql-9.5-9.5.10/configure 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/configure 2018-08-06 20:09:28.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for PostgreSQL 9.5.10. +# Generated by GNU Autoconf 2.69 for PostgreSQL 9.5.14. # # Report bugs to . # @@ -582,8 +582,8 @@ # Identity of this package. PACKAGE_NAME='PostgreSQL' PACKAGE_TARNAME='postgresql' -PACKAGE_VERSION='9.5.10' -PACKAGE_STRING='PostgreSQL 9.5.10' +PACKAGE_VERSION='9.5.14' +PACKAGE_STRING='PostgreSQL 9.5.14' PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org' PACKAGE_URL='' @@ -1396,7 +1396,7 @@ # 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 9.5.10 to adapt to many kinds of systems. +\`configure' configures PostgreSQL 9.5.14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1461,7 +1461,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of PostgreSQL 9.5.10:";; + short | recursive ) echo "Configuration of PostgreSQL 9.5.14:";; esac cat <<\_ACEOF @@ -1611,7 +1611,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -PostgreSQL configure 9.5.10 +PostgreSQL configure 9.5.14 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2322,7 +2322,7 @@ 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 9.5.10, which was +It was created by PostgreSQL $as_me 9.5.14, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4728,6 +4728,7 @@ # We want to suppress clang's unhelpful unused-command-line-argument warnings # but gcc won't complain about unrecognized -Wno-foo switches, so we have to # test for the positive form and if that works, add the negative form + NOT_THE_CFLAGS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5 $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; } if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then : @@ -4766,6 +4767,85 @@ if test -n "$NOT_THE_CFLAGS"; then CFLAGS="$CFLAGS -Wno-unused-command-line-argument" fi + # Similarly disable useless truncation warnings from gcc 8+ + NOT_THE_CFLAGS="" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-truncation" >&5 +$as_echo_n "checking whether $CC supports -Wformat-truncation... " >&6; } +if ${pgac_cv_prog_cc_cflags__Wformat_truncation+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +CFLAGS="$pgac_save_CFLAGS -Wformat-truncation" +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__Wformat_truncation=yes +else + pgac_cv_prog_cc_cflags__Wformat_truncation=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" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_truncation" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__Wformat_truncation" >&6; } +if test x"$pgac_cv_prog_cc_cflags__Wformat_truncation" = x"yes"; then + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" +fi + + if test -n "$NOT_THE_CFLAGS"; then + CFLAGS="$CFLAGS -Wno-format-truncation" + fi + NOT_THE_CFLAGS="" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstringop-truncation" >&5 +$as_echo_n "checking whether $CC supports -Wstringop-truncation... " >&6; } +if ${pgac_cv_prog_cc_cflags__Wstringop_truncation+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +CFLAGS="$pgac_save_CFLAGS -Wstringop-truncation" +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__Wstringop_truncation=yes +else + pgac_cv_prog_cc_cflags__Wstringop_truncation=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" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wstringop_truncation" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__Wstringop_truncation" >&6; } +if test x"$pgac_cv_prog_cc_cflags__Wstringop_truncation" = x"yes"; then + NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation" +fi + + if test -n "$NOT_THE_CFLAGS"; then + CFLAGS="$CFLAGS -Wno-stringop-truncation" + 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. @@ -7441,12 +7521,19 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5 $as_echo_n "checking for flags to link embedded Perl... " >&6; } if test "$PORTNAME" = "win32" ; then -perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib` -test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib" + perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib` + if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then + perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib" + else + perl_lib=`basename $perl_archlibexp/CORE/libperl[5-9]*.a .a | sed 's/^lib//'` + if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then + perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib" + fi + fi else -pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts` -pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'` -perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"` + pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts` + pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'` + perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"` fi if test -z "$perl_embed_ldflags" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -12549,7 +12636,7 @@ fi -for ac_func in strtoll strtoq +for ac_func in strtoll __strtoll strtoq do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -12561,7 +12648,7 @@ fi done -for ac_func in strtoull strtouq +for ac_func in strtoull __strtoull strtouq do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -12573,6 +12660,28 @@ fi done +# strto[u]ll may exist but not be declared +ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoll" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOLL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoull" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOULL $ac_have_decl +_ACEOF + # Lastly, restore full LIBS list and check for readline/libedit symbols LIBS="$LIBS_including_readline" @@ -13961,7 +14070,10 @@ # Compute maximum alignment of any basic type. # We assume long's alignment is at least as strong as char, short, or int; -# but we must check long long (if it exists) and double. +# but we must check long long (if it is being used for int64) and double. +# Note that we intentionally do not consider any types wider than 64 bits, +# as allowing MAXIMUM_ALIGNOF to exceed 8 would be too much of a penalty +# for disk and memory space. MAX_ALIGNOF=$ac_cv_alignof_long if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then @@ -14035,7 +14147,7 @@ fi -# Check for extensions offering the integer scalar type __int128. +# Some compilers offer a 128-bit integer scalar type. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5 $as_echo_n "checking for __int128... " >&6; } if ${pgac_cv__128bit_int+:} false; then : @@ -14045,12 +14157,15 @@ /* end confdefs.h. */ /* + * We don't actually run this test, just link it to verify that any support + * functions needed for __int128 are present. + * * These are globals to discourage the compiler from folding all the * arithmetic tests down to compile-time constants. We do not have - * convenient support for 64bit literals at this point... + * convenient support for 128bit literals at this point... */ __int128 a = 48828125; -__int128 b = 97656255; +__int128 b = 97656250; int main () @@ -14059,13 +14174,12 @@ __int128 c,d; a = (a << 12) + 1; /* 200000000001 */ b = (b << 12) + 5; /* 400000000005 */ -/* use the most relevant arithmetic ops */ +/* try the most relevant arithmetic ops */ c = a * b; d = (c + b) / b; -/* return different values, to prevent optimizations */ +/* must use the results, else compiler may optimize arithmetic away */ if (d != a+1) - return 0; -return 1; + return 1; ; return 0; @@ -14082,9 +14196,100 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5 $as_echo "$pgac_cv__128bit_int" >&6; } if test x"$pgac_cv__128bit_int" = xyes ; then + # Use of non-default alignment with __int128 tickles bugs in some compilers. + # If not cross-compiling, we can test for bugs and disable use of __int128 + # with buggy compilers. If cross-compiling, hope for the best. + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83925 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128 alignment bug" >&5 +$as_echo_n "checking for __int128 alignment bug... " >&6; } +if ${pgac_cv__128bit_int_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + pgac_cv__128bit_int_bug="assuming ok" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* This must match the corresponding code in c.h: */ +#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__) +#define pg_attribute_aligned(a) __attribute__((aligned(a))) +#endif +typedef __int128 int128a +#if defined(pg_attribute_aligned) +pg_attribute_aligned(8) +#endif +; +int128a holder; +void pass_by_val(void *buffer, int128a par) { holder = par; } + +int +main () +{ + +long int i64 = 97656225L << 12; +int128a q; +pass_by_val(main, (int128a) i64); +q = (int128a) i64; +if (q != holder) + return 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + pgac_cv__128bit_int_bug=ok +else + pgac_cv__128bit_int_bug=broken +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int_bug" >&5 +$as_echo "$pgac_cv__128bit_int_bug" >&6; } + if test x"$pgac_cv__128bit_int_bug" != xbroken ; then $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h + # The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of PG_INT128_TYPE" >&5 +$as_echo_n "checking alignment of PG_INT128_TYPE... " >&6; } +if ${ac_cv_alignof_PG_INT128_TYPE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_PG_INT128_TYPE" "$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; PG_INT128_TYPE y; } ac__type_alignof_;"; then : + +else + if test "$ac_cv_type_PG_INT128_TYPE" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of PG_INT128_TYPE +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_PG_INT128_TYPE=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_PG_INT128_TYPE" >&5 +$as_echo "$ac_cv_alignof_PG_INT128_TYPE" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define ALIGNOF_PG_INT128_TYPE $ac_cv_alignof_PG_INT128_TYPE +_ACEOF + + + fi fi # Check for various atomic operations now that we have checked how to declare @@ -16214,7 +16419,7 @@ # 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 9.5.10, which was +This file was extended by PostgreSQL $as_me 9.5.14, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16284,7 +16489,7 @@ 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 9.5.10 +PostgreSQL config.status 9.5.14 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru postgresql-9.5-9.5.10/configure.in postgresql-9.5-9.5.14/configure.in --- postgresql-9.5-9.5.10/configure.in 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/configure.in 2018-08-06 20:09:28.000000000 +0000 @@ -17,7 +17,7 @@ dnl m4_pattern_forbid(^PGAC_)dnl to catch undefined macros -AC_INIT([PostgreSQL], [9.5.10], [pgsql-bugs@postgresql.org]) +AC_INIT([PostgreSQL], [9.5.14], [pgsql-bugs@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 @@ -448,10 +448,22 @@ # We want to suppress clang's unhelpful unused-command-line-argument warnings # but gcc won't complain about unrecognized -Wno-foo switches, so we have to # test for the positive form and if that works, add the negative form + NOT_THE_CFLAGS="" PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wunused-command-line-argument]) if test -n "$NOT_THE_CFLAGS"; then CFLAGS="$CFLAGS -Wno-unused-command-line-argument" fi + # Similarly disable useless truncation warnings from gcc 8+ + NOT_THE_CFLAGS="" + PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation]) + if test -n "$NOT_THE_CFLAGS"; then + CFLAGS="$CFLAGS -Wno-format-truncation" + fi + NOT_THE_CFLAGS="" + PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wstringop-truncation]) + if test -n "$NOT_THE_CFLAGS"; then + CFLAGS="$CFLAGS -Wno-stringop-truncation" + 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. @@ -1031,8 +1043,8 @@ AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])]) else - AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])]) - AC_SEARCH_LIBS(SSL_new, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])]) + AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])]) + AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])]) fi AC_CHECK_FUNCS([SSL_get_current_compression]) # Functions introduced in OpenSSL 1.1.0. We used to check for @@ -1203,6 +1215,12 @@ if test "$with_bonjour" = yes ; then AC_CHECK_HEADER(dns_sd.h, [], [AC_MSG_ERROR([header file is required for Bonjour])]) +dnl At some point we might add something like +dnl AC_SEARCH_LIBS(DNSServiceRegister, dns_sd) +dnl but right now, what that would mainly accomplish is to encourage +dnl people to try to use the avahi implementation, which does not work. +dnl If you want to use Apple's own Bonjour code on another platform, +dnl just add -ldns_sd to LIBS manually. fi # for contrib/uuid-ossp @@ -1563,8 +1581,10 @@ AC_DEFINE(HAVE_INT_OPTRESET, 1, [Define to 1 if you have the global variable 'int optreset'.]) fi -AC_CHECK_FUNCS([strtoll strtoq], [break]) -AC_CHECK_FUNCS([strtoull strtouq], [break]) +AC_CHECK_FUNCS([strtoll __strtoll strtoq], [break]) +AC_CHECK_FUNCS([strtoull __strtoull strtouq], [break]) +# strto[u]ll may exist but not be declared +AC_CHECK_DECLS([strtoll, strtoull]) # Lastly, restore full LIBS list and check for readline/libedit symbols LIBS="$LIBS_including_readline" @@ -1799,7 +1819,10 @@ # Compute maximum alignment of any basic type. # We assume long's alignment is at least as strong as char, short, or int; -# but we must check long long (if it exists) and double. +# but we must check long long (if it is being used for int64) and double. +# Note that we intentionally do not consider any types wider than 64 bits, +# as allowing MAXIMUM_ALIGNOF to exceed 8 would be too much of a penalty +# for disk and memory space. MAX_ALIGNOF=$ac_cv_alignof_long if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then @@ -1820,7 +1843,7 @@ # C, but is missing on some old platforms. AC_CHECK_TYPES(sig_atomic_t, [], [], [#include ]) -# Check for extensions offering the integer scalar type __int128. +# Some compilers offer a 128-bit integer scalar type. PGAC_TYPE_128BIT_INT # Check for various atomic operations now that we have checked how to declare @@ -1909,11 +1932,11 @@ AC_MSG_RESULT(SSE 4.2) else if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then - AC_DEFINE(USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, 1, [Define to 1 to use Intel SSSE 4.2 CRC instructions with a runtime check.]) + AC_DEFINE(USE_SSE42_CRC32C_WITH_RUNTIME_CHECK, 1, [Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check.]) PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o" AC_MSG_RESULT(SSE 4.2 with runtime check) else - AC_DEFINE(USE_SLICING_BY_8_CRC32C, 1, [Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check.]) + AC_DEFINE(USE_SLICING_BY_8_CRC32C, 1, [Define to 1 to use software CRC-32C implementation (slicing-by-8).]) PG_CRC32C_OBJS="pg_crc32c_sb8.o" AC_MSG_RESULT(slicing-by-8) fi diff -Nru postgresql-9.5-9.5.10/contrib/adminpack/adminpack.c postgresql-9.5-9.5.14/contrib/adminpack/adminpack.c --- postgresql-9.5-9.5.10/contrib/adminpack/adminpack.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/adminpack/adminpack.c 2018-08-06 20:09:28.000000000 +0000 @@ -173,7 +173,7 @@ fn1 = convert_and_check_filename(PG_GETARG_TEXT_P(0), false); fn2 = convert_and_check_filename(PG_GETARG_TEXT_P(1), false); if (PG_ARGISNULL(2)) - fn3 = 0; + fn3 = NULL; else fn3 = convert_and_check_filename(PG_GETARG_TEXT_P(2), false); @@ -195,7 +195,7 @@ PG_RETURN_BOOL(false); } - rc = access(fn3 ? fn3 : fn2, 2); + rc = access(fn3 ? fn3 : fn2, W_OK); if (rc >= 0 || errno != ENOENT) { ereport(ERROR, diff -Nru postgresql-9.5-9.5.10/contrib/auto_explain/auto_explain.c postgresql-9.5-9.5.14/contrib/auto_explain/auto_explain.c --- postgresql-9.5-9.5.10/contrib/auto_explain/auto_explain.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/auto_explain/auto_explain.c 2018-08-06 20:09:28.000000000 +0000 @@ -74,7 +74,7 @@ "Zero prints all plans. -1 turns this feature off.", &auto_explain_log_min_duration, -1, - -1, INT_MAX / 1000, + -1, INT_MAX, PGC_SUSET, GUC_UNIT_MS, NULL, diff -Nru postgresql-9.5-9.5.10/contrib/btree_gist/btree_inet.c postgresql-9.5-9.5.14/contrib/btree_gist/btree_inet.c --- postgresql-9.5-9.5.10/contrib/btree_gist/btree_inet.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/btree_gist/btree_inet.c 2018-08-06 20:09:28.000000000 +0000 @@ -99,9 +99,11 @@ if (entry->leafkey) { inetKEY *r = (inetKEY *) palloc(sizeof(inetKEY)); + bool failure = false; retval = palloc(sizeof(GISTENTRY)); - r->lower = convert_network_to_scalar(entry->key, INETOID); + r->lower = convert_network_to_scalar(entry->key, INETOID, &failure); + Assert(!failure); r->upper = r->lower; gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, @@ -118,13 +120,18 @@ gbt_inet_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); - double query = convert_network_to_scalar(PG_GETARG_DATUM(1), INETOID); + Datum dquery = PG_GETARG_DATUM(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); /* Oid subtype = PG_GETARG_OID(3); */ bool *recheck = (bool *) PG_GETARG_POINTER(4); inetKEY *kkk = (inetKEY *) DatumGetPointer(entry->key); GBT_NUMKEY_R key; + double query; + bool failure = false; + + query = convert_network_to_scalar(dquery, INETOID, &failure); + Assert(!failure); /* All cases served by this function are inexact */ *recheck = true; diff -Nru postgresql-9.5-9.5.10/contrib/btree_gist/expected/inet.out postgresql-9.5-9.5.14/contrib/btree_gist/expected/inet.out --- postgresql-9.5-9.5.10/contrib/btree_gist/expected/inet.out 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/btree_gist/expected/inet.out 2018-08-06 20:09:28.000000000 +0000 @@ -64,3 +64,42 @@ 386 (1 row) +VACUUM inettmp; +-- gist_inet_ops lacks a fetch function, so this should not be index-only scan +EXPLAIN (COSTS OFF) +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + QUERY PLAN +-------------------------------------------------------- + Aggregate + -> Bitmap Heap Scan on inettmp + Recheck Cond: (a = '89.225.196.191'::inet) + -> Bitmap Index Scan on inetidx + Index Cond: (a = '89.225.196.191'::inet) +(5 rows) + +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + count +------- + 1 +(1 row) + +DROP INDEX inetidx; +CREATE INDEX ON inettmp USING gist (a gist_inet_ops, a inet_ops); +-- likewise here (checks for core planner bug) +EXPLAIN (COSTS OFF) +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + QUERY PLAN +-------------------------------------------------------- + Aggregate + -> Bitmap Heap Scan on inettmp + Recheck Cond: (a = '89.225.196.191'::inet) + -> Bitmap Index Scan on inettmp_a_a1_idx + Index Cond: (a = '89.225.196.191'::inet) +(5 rows) + +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + count +------- + 1 +(1 row) + diff -Nru postgresql-9.5-9.5.10/contrib/btree_gist/sql/inet.sql postgresql-9.5-9.5.14/contrib/btree_gist/sql/inet.sql --- postgresql-9.5-9.5.10/contrib/btree_gist/sql/inet.sql 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/btree_gist/sql/inet.sql 2018-08-06 20:09:28.000000000 +0000 @@ -29,3 +29,21 @@ SELECT count(*) FROM inettmp WHERE a >= '89.225.196.191'::inet; SELECT count(*) FROM inettmp WHERE a > '89.225.196.191'::inet; + +VACUUM inettmp; + +-- gist_inet_ops lacks a fetch function, so this should not be index-only scan +EXPLAIN (COSTS OFF) +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + +DROP INDEX inetidx; + +CREATE INDEX ON inettmp USING gist (a gist_inet_ops, a inet_ops); + +-- likewise here (checks for core planner bug) +EXPLAIN (COSTS OFF) +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; + +SELECT count(*) FROM inettmp WHERE a = '89.225.196.191'::inet; diff -Nru postgresql-9.5-9.5.10/contrib/cube/cubeparse.c postgresql-9.5-9.5.14/contrib/cube/cubeparse.c --- postgresql-9.5-9.5.10/contrib/cube/cubeparse.c 2017-11-06 22:34:09.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/cube/cubeparse.c 2018-08-06 20:32:16.000000000 +0000 @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" diff -Nru postgresql-9.5-9.5.10/contrib/cube/cubescan.c postgresql-9.5-9.5.14/contrib/cube/cubescan.c --- postgresql-9.5-9.5.10/contrib/cube/cubescan.c 2017-11-06 22:34:09.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/cube/cubescan.c 2018-08-06 20:32:16.000000000 +0000 @@ -27,8 +27,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -107,25 +107,13 @@ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ @@ -186,7 +174,7 @@ typedef size_t yy_size_t; #endif -extern yy_size_t cube_yyleng; +extern int cube_yyleng; extern FILE *cube_yyin, *cube_yyout; @@ -225,12 +213,12 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -253,7 +241,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -281,7 +269,7 @@ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -300,11 +288,11 @@ /* yy_hold_char holds the character lost when cube_yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t cube_yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int cube_yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -329,7 +317,7 @@ YY_BUFFER_STATE cube_yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE cube_yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE cube_yy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE cube_yy_scan_bytes (yyconst char *bytes,int len ); void *cube_yyalloc (yy_size_t ); void *cube_yyrealloc (void *,yy_size_t ); @@ -361,12 +349,12 @@ /* Begin user sect3 */ -#define cube_yywrap() 1 +#define cube_yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; -FILE *cube_yyin = (FILE *) 0, *cube_yyout = (FILE *) 0; +FILE *cube_yyin = NULL, *cube_yyout = NULL; typedef int yy_state_type; @@ -375,19 +363,22 @@ int cube_yylineno = 1; extern char *cube_yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr cube_yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static void yynoreturn yy_fatal_error (yyconst char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up cube_yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - cube_yyleng = (size_t) (yy_cp - yy_bp); \ + cube_yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -408,7 +399,7 @@ 1, 0, 1, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, @@ -440,13 +431,13 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[13] = +static yyconst YY_CHAR yy_meta[13] = { 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[26] = +static yyconst flex_uint16_t yy_base[26] = { 0, 0, 0, 28, 29, 0, 0, 29, 29, 5, 29, 18, 7, 29, 29, 0, 17, 0, 9, 16, 14, @@ -460,7 +451,7 @@ 19, 24, 24, 0, 24 } ; -static yyconst flex_int16_t yy_nxt[42] = +static yyconst flex_uint16_t yy_nxt[42] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 13, 14, 16, 17, 19, 17, 20, 18, 20, 22, @@ -518,7 +509,7 @@ /* static char *scanbuf; */ /* static int scanbuflen; */ #define YY_NO_INPUT 1 -#line 522 "cubescan.c" +#line 513 "cubescan.c" #define INITIAL 0 @@ -551,19 +542,19 @@ FILE *cube_yyget_in (void ); -void cube_yyset_in (FILE * in_str ); +void cube_yyset_in (FILE * _in_str ); FILE *cube_yyget_out (void ); -void cube_yyset_out (FILE * out_str ); +void cube_yyset_out (FILE * _out_str ); -yy_size_t cube_yyget_leng (void ); + int cube_yyget_leng (void ); char *cube_yyget_text (void ); int cube_yyget_lineno (void ); -void cube_yyset_lineno (int line_number ); +void cube_yyset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -577,6 +568,10 @@ #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -610,7 +605,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( cube_yytext, cube_yyleng, 1, cube_yyout )) {} } while (0) +#define ECHO do { if (fwrite( cube_yytext, (size_t) cube_yyleng, 1, cube_yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -621,7 +616,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( cube_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -634,7 +629,7 @@ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, (yy_size_t) max_size, cube_yyin)) == 0 && ferror(cube_yyin)) \ + while ( (result = (int) fread(buf, 1, max_size, cube_yyin))==0 && ferror(cube_yyin)) \ { \ if( errno != EINTR) \ { \ @@ -689,7 +684,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -699,9 +694,9 @@ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -733,9 +728,9 @@ #line 42 "cubescan.l" -#line 737 "cubescan.c" +#line 732 "cubescan.c" - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -751,7 +746,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -763,7 +758,7 @@ if ( yy_current_state >= 25 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; ++yy_cp; } while ( yy_current_state != 24 ); @@ -832,7 +827,7 @@ #line 53 "cubescan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 836 "cubescan.c" +#line 831 "cubescan.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -976,9 +971,9 @@ */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1007,7 +1002,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1034,7 +1029,7 @@ if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1047,7 +1042,7 @@ } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1089,9 +1084,9 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cube_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1110,14 +1105,14 @@ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1129,7 +1124,7 @@ if ( yy_current_state >= 25 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; } return yy_current_state; @@ -1142,10 +1137,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1157,12 +1152,16 @@ if ( yy_current_state >= 25 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_is_jam = (yy_current_state == 24); return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1187,7 +1186,7 @@ else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1211,7 +1210,7 @@ case EOB_ACT_END_OF_FILE: { if ( cube_yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1312,7 +1311,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in cube_yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1459,7 +1458,7 @@ */ static void cube_yyensure_buffer_stack (void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -1467,15 +1466,15 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)cube_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in cube_yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1484,7 +1483,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)cube_yyrealloc @@ -1504,7 +1503,7 @@ * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE cube_yy_scan_buffer (char * base, yy_size_t size ) { @@ -1514,7 +1513,7 @@ base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; b = (YY_BUFFER_STATE) cube_yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -1523,7 +1522,7 @@ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -1546,7 +1545,7 @@ YY_BUFFER_STATE cube_yy_scan_string (yyconst char * yystr ) { - return cube_yy_scan_bytes(yystr,strlen(yystr) ); + return cube_yy_scan_bytes(yystr,(int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to cube_yylex() will @@ -1556,15 +1555,15 @@ * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE cube_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE cube_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; + n = (yy_size_t) (_yybytes_len + 2); buf = (char *) cube_yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in cube_yy_scan_bytes()" ); @@ -1590,9 +1589,9 @@ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1620,7 +1619,7 @@ */ int cube_yyget_lineno (void) { - + return cube_yylineno; } @@ -1643,7 +1642,7 @@ /** Get the length of the current token. * */ -yy_size_t cube_yyget_leng (void) +int cube_yyget_leng (void) { return cube_yyleng; } @@ -1658,29 +1657,29 @@ } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void cube_yyset_lineno (int line_number ) +void cube_yyset_lineno (int _line_number ) { - cube_yylineno = line_number; + cube_yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see cube_yy_switch_to_buffer */ -void cube_yyset_in (FILE * in_str ) +void cube_yyset_in (FILE * _in_str ) { - cube_yyin = in_str ; + cube_yyin = _in_str ; } -void cube_yyset_out (FILE * out_str ) +void cube_yyset_out (FILE * _out_str ) { - cube_yyout = out_str ; + cube_yyout = _out_str ; } int cube_yyget_debug (void) @@ -1688,9 +1687,9 @@ return cube_yy_flex_debug; } -void cube_yyset_debug (int bdebug ) +void cube_yyset_debug (int _bdebug ) { - cube_yy_flex_debug = bdebug ; + cube_yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -1699,10 +1698,10 @@ * This function is called from cube_yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -1711,8 +1710,8 @@ cube_yyin = stdin; cube_yyout = stdout; #else - cube_yyin = (FILE *) 0; - cube_yyout = (FILE *) 0; + cube_yyin = NULL; + cube_yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -1750,7 +1749,8 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1759,7 +1759,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1769,11 +1769,12 @@ void *cube_yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *cube_yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1781,17 +1782,17 @@ * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void cube_yyfree (void * ptr ) { - free( (char *) ptr ); /* see cube_yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see cube_yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 52 "cubescan.l" +#line 53 "cubescan.l" diff -Nru postgresql-9.5-9.5.10/contrib/dblink/Makefile postgresql-9.5-9.5.14/contrib/dblink/Makefile --- postgresql-9.5-9.5.10/contrib/dblink/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/dblink/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -3,7 +3,7 @@ MODULE_big = dblink OBJS = dblink.o $(WIN32RES) PG_CPPFLAGS = -I$(libpq_srcdir) -SHLIB_LINK = $(libpq) +SHLIB_LINK_INTERNAL = $(libpq) EXTENSION = dblink DATA = dblink--1.1.sql dblink--1.0--1.1.sql dblink--unpackaged--1.0.sql diff -Nru postgresql-9.5-9.5.10/contrib/earthdistance/expected/earthdistance.out postgresql-9.5-9.5.14/contrib/earthdistance/expected/earthdistance.out --- postgresql-9.5-9.5.10/contrib/earthdistance/expected/earthdistance.out 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/earthdistance/expected/earthdistance.out 2018-08-06 20:09:28.000000000 +0000 @@ -881,11 +881,12 @@ -- -- Test the recommended constraints. -- -SELECT is_point(ll_to_earth(0,0)); -ERROR: function is_point(earth) does not exist -LINE 1: SELECT is_point(ll_to_earth(0,0)); - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT cube_is_point(ll_to_earth(0,0)); + cube_is_point +--------------- + t +(1 row) + SELECT cube_dim(ll_to_earth(0,0)) <= 3; ?column? ---------- @@ -899,11 +900,12 @@ t (1 row) -SELECT is_point(ll_to_earth(30,60)); -ERROR: function is_point(earth) does not exist -LINE 1: SELECT is_point(ll_to_earth(30,60)); - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT cube_is_point(ll_to_earth(30,60)); + cube_is_point +--------------- + t +(1 row) + SELECT cube_dim(ll_to_earth(30,60)) <= 3; ?column? ---------- @@ -917,11 +919,12 @@ t (1 row) -SELECT is_point(ll_to_earth(60,90)); -ERROR: function is_point(earth) does not exist -LINE 1: SELECT is_point(ll_to_earth(60,90)); - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT cube_is_point(ll_to_earth(60,90)); + cube_is_point +--------------- + t +(1 row) + SELECT cube_dim(ll_to_earth(60,90)) <= 3; ?column? ---------- @@ -935,11 +938,12 @@ t (1 row) -SELECT is_point(ll_to_earth(-30,-90)); -ERROR: function is_point(earth) does not exist -LINE 1: SELECT is_point(ll_to_earth(-30,-90)); - ^ -HINT: No function matches the given name and argument types. You might need to add explicit type casts. +SELECT cube_is_point(ll_to_earth(-30,-90)); + cube_is_point +--------------- + t +(1 row) + SELECT cube_dim(ll_to_earth(-30,-90)) <= 3; ?column? ---------- diff -Nru postgresql-9.5-9.5.10/contrib/earthdistance/sql/earthdistance.sql postgresql-9.5-9.5.14/contrib/earthdistance/sql/earthdistance.sql --- postgresql-9.5-9.5.10/contrib/earthdistance/sql/earthdistance.sql 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/earthdistance/sql/earthdistance.sql 2018-08-06 20:09:28.000000000 +0000 @@ -282,19 +282,19 @@ -- Test the recommended constraints. -- -SELECT is_point(ll_to_earth(0,0)); +SELECT cube_is_point(ll_to_earth(0,0)); SELECT cube_dim(ll_to_earth(0,0)) <= 3; SELECT abs(cube_distance(ll_to_earth(0,0), '(0)'::cube) / earth() - 1) < '10e-12'::float8; -SELECT is_point(ll_to_earth(30,60)); +SELECT cube_is_point(ll_to_earth(30,60)); SELECT cube_dim(ll_to_earth(30,60)) <= 3; SELECT abs(cube_distance(ll_to_earth(30,60), '(0)'::cube) / earth() - 1) < '10e-12'::float8; -SELECT is_point(ll_to_earth(60,90)); +SELECT cube_is_point(ll_to_earth(60,90)); SELECT cube_dim(ll_to_earth(60,90)) <= 3; SELECT abs(cube_distance(ll_to_earth(60,90), '(0)'::cube) / earth() - 1) < '10e-12'::float8; -SELECT is_point(ll_to_earth(-30,-90)); +SELECT cube_is_point(ll_to_earth(-30,-90)); SELECT cube_dim(ll_to_earth(-30,-90)) <= 3; SELECT abs(cube_distance(ll_to_earth(-30,-90), '(0)'::cube) / earth() - 1) < '10e-12'::float8; diff -Nru postgresql-9.5-9.5.10/contrib/hstore/hstore_io.c postgresql-9.5-9.5.14/contrib/hstore/hstore_io.c --- postgresql-9.5-9.5.10/contrib/hstore/hstore_io.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/hstore/hstore_io.c 2018-08-06 20:09:28.000000000 +0000 @@ -340,7 +340,8 @@ { *buflen += res->keylen + ((res->isnull) ? 0 : res->vallen); res++; - memcpy(res, ptr, sizeof(Pairs)); + if (res != ptr) + memcpy(res, ptr, sizeof(Pairs)); } ptr++; diff -Nru postgresql-9.5-9.5.10/contrib/hstore_plperl/expected/hstore_plperl.out postgresql-9.5-9.5.14/contrib/hstore_plperl/expected/hstore_plperl.out --- postgresql-9.5-9.5.10/contrib/hstore_plperl/expected/hstore_plperl.out 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/hstore_plperl/expected/hstore_plperl.out 2018-08-06 20:09:28.000000000 +0000 @@ -41,6 +41,25 @@ {"\"a\"=>\"1\", \"b\"=>\"boo\", \"c\"=>NULL","\"d\"=>\"2\""} (1 row) +-- check error cases +CREATE OR REPLACE FUNCTION test2() RETURNS hstore +LANGUAGE plperl +TRANSFORM FOR TYPE hstore +AS $$ +return 42; +$$; +SELECT test2(); +ERROR: cannot transform non-hash Perl value to hstore +CONTEXT: PL/Perl function "test2" +CREATE OR REPLACE FUNCTION test2() RETURNS hstore +LANGUAGE plperl +TRANSFORM FOR TYPE hstore +AS $$ +return [1, 2]; +$$; +SELECT test2(); +ERROR: cannot transform non-hash Perl value to hstore +CONTEXT: PL/Perl function "test2" DROP FUNCTION test2(); DROP FUNCTION test2arr(); DROP EXTENSION hstore_plperl; diff -Nru postgresql-9.5-9.5.10/contrib/hstore_plperl/hstore_plperl.c postgresql-9.5-9.5.14/contrib/hstore_plperl/hstore_plperl.c --- postgresql-9.5-9.5.10/contrib/hstore_plperl/hstore_plperl.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/hstore_plperl/hstore_plperl.c 2018-08-06 20:09:28.000000000 +0000 @@ -47,7 +47,8 @@ plperl_to_hstore(PG_FUNCTION_ARGS) { dTHX; - HV *hv = (HV *) SvRV((SV *) PG_GETARG_POINTER(0)); + SV *in = (SV *) PG_GETARG_POINTER(0); + HV *hv; HE *he; int32 buflen; int32 i; @@ -55,6 +56,17 @@ HStore *out; Pairs *pairs; + /* Dereference references recursively. */ + while (SvROK(in)) + in = SvRV(in); + + /* Now we must have a hash. */ + if (SvTYPE(in) != SVt_PVHV) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + (errmsg("cannot transform non-hash Perl value to hstore")))); + hv = (HV *) in; + pcount = hv_iterinit(hv); pairs = palloc(pcount * sizeof(Pairs)); diff -Nru postgresql-9.5-9.5.10/contrib/hstore_plperl/Makefile postgresql-9.5-9.5.14/contrib/hstore_plperl/Makefile --- postgresql-9.5-9.5.10/contrib/hstore_plperl/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/hstore_plperl/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -27,16 +27,18 @@ # dependency. This does preclude pgxs builds. ifeq ($(PORTNAME), aix) rpathdir = $(pkglibdir):$(perl_archlibexp)/CORE -SHLIB_LINK += ../hstore/libhstore.exp $(perl_embed_ldflags) +SHLIB_LINK_INTERNAL += ../hstore/libhstore.exp +SHLIB_LINK += $(perl_embed_ldflags) endif ifeq ($(PORTNAME), win32) # these settings are the same as for plperl override CPPFLAGS += -DPLPERL_HAVE_UID_GID -Wno-comment -SHLIB_LINK += ../hstore/libhstore.a $(sort $(wildcard ../../src/pl/plperl/libperl*.a)) +SHLIB_LINK_INTERNAL += ../hstore/libhstore.a $(sort $(wildcard ../../src/pl/plperl/libperl*.a)) endif ifeq ($(PORTNAME), cygwin) -SHLIB_LINK += -L../hstore -l hstore $(perl_embed_ldflags) +SHLIB_LINK_INTERNAL += -L../hstore -l hstore +SHLIB_LINK += $(perl_embed_ldflags) endif # As with plperl we need to make sure that the CORE directory is included diff -Nru postgresql-9.5-9.5.10/contrib/hstore_plperl/sql/hstore_plperl.sql postgresql-9.5-9.5.14/contrib/hstore_plperl/sql/hstore_plperl.sql --- postgresql-9.5-9.5.10/contrib/hstore_plperl/sql/hstore_plperl.sql 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/hstore_plperl/sql/hstore_plperl.sql 2018-08-06 20:09:28.000000000 +0000 @@ -33,6 +33,25 @@ SELECT test2arr(); +-- check error cases +CREATE OR REPLACE FUNCTION test2() RETURNS hstore +LANGUAGE plperl +TRANSFORM FOR TYPE hstore +AS $$ +return 42; +$$; + +SELECT test2(); + +CREATE OR REPLACE FUNCTION test2() RETURNS hstore +LANGUAGE plperl +TRANSFORM FOR TYPE hstore +AS $$ +return [1, 2]; +$$; + +SELECT test2(); + DROP FUNCTION test2(); DROP FUNCTION test2arr(); diff -Nru postgresql-9.5-9.5.10/contrib/hstore_plpython/Makefile postgresql-9.5-9.5.14/contrib/hstore_plpython/Makefile --- postgresql-9.5-9.5.10/contrib/hstore_plpython/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/hstore_plpython/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -27,15 +27,17 @@ # dependency. This does preclude pgxs builds. ifeq ($(PORTNAME), aix) rpathdir = $(pkglibdir):$(python_libdir) -SHLIB_LINK += ../hstore/libhstore.exp $(python_libspec) $(python_additional_libs) $(sort $(wildcard ../../src/pl/plpython/libplpython*.exp)) +SHLIB_LINK_INTERNAL += ../hstore/libhstore.exp $(sort $(wildcard ../../src/pl/plpython/libplpython*.exp)) +SHLIB_LINK += $(python_libspec) $(python_additional_libs) endif ifeq ($(PORTNAME), win32) -SHLIB_LINK += ../hstore/libhstore.a $(sort $(wildcard ../../src/pl/plpython/libpython*.a)) $(sort $(wildcard ../../src/pl/plpython/libplpython*.a)) +SHLIB_LINK_INTERNAL += ../hstore/libhstore.a $(sort $(wildcard ../../src/pl/plpython/libplpython*.a)) $(sort $(wildcard ../../src/pl/plpython/libpython*.a)) endif ifeq ($(PORTNAME), cygwin) -SHLIB_LINK += -L../hstore -lhstore -L../../src/pl/plpython \ - -lplpython$(python_majorversion) $(python_libspec) +SHLIB_LINK_INTERNAL += -L../hstore -lhstore -L../../src/pl/plpython \ + -lplpython$(python_majorversion) +SHLIB_LINK += $(python_libspec) endif REGRESS_OPTS += --load-extension=hstore diff -Nru postgresql-9.5-9.5.10/contrib/ltree/expected/ltree.out postgresql-9.5-9.5.14/contrib/ltree/expected/ltree.out --- postgresql-9.5-9.5.10/contrib/ltree/expected/ltree.out 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/ltree/expected/ltree.out 2018-08-06 20:09:28.000000000 +0000 @@ -251,6 +251,24 @@ 1.2 (1 row) +SELECT lca('{1.2.3}'); + lca +----- + 1.2 +(1 row) + +SELECT lca('{1}'), lca('{1}') IS NULL; + lca | ?column? +-----+---------- + | f +(1 row) + +SELECT lca('{}') IS NULL; + ?column? +---------- + t +(1 row) + SELECT lca('1.la.2.3','1.2.3.4.5.6'); lca ----- diff -Nru postgresql-9.5-9.5.10/contrib/ltree/ltree_op.c postgresql-9.5-9.5.14/contrib/ltree/ltree_op.c --- postgresql-9.5-9.5.10/contrib/ltree/ltree_op.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/ltree/ltree_op.c 2018-08-06 20:09:28.000000000 +0000 @@ -402,22 +402,34 @@ PG_RETURN_POINTER(r); } +/* + * Common code for variants of lca(), find longest common ancestor of inputs + * + * Returns NULL if there is no common ancestor, ie, the longest common + * prefix is empty. + */ ltree * lca_inner(ltree **a, int len) { int tmp, - num = ((*a)->numlevel) ? (*a)->numlevel - 1 : 0; - ltree **ptr = a + 1; - int i, - reslen = LTREE_HDRSIZE; + num, + i, + reslen; + ltree **ptr; ltree_level *l1, *l2; ltree *res; - + if (len <= 0) + return NULL; /* no inputs? */ if ((*a)->numlevel == 0) - return NULL; + return NULL; /* any empty input means NULL result */ + + /* num is the length of the longest common ancestor so far */ + num = (*a)->numlevel - 1; + /* Compare each additional input to *a */ + ptr = a + 1; while (ptr - a < len) { if ((*ptr)->numlevel == 0) @@ -428,11 +440,12 @@ { l1 = LTREE_FIRST(*a); l2 = LTREE_FIRST(*ptr); - tmp = num; + tmp = Min(num, (*ptr)->numlevel - 1); num = 0; - for (i = 0; i < Min(tmp, (*ptr)->numlevel - 1); i++) + for (i = 0; i < tmp; i++) { - if (l1->len == l2->len && memcmp(l1->name, l2->name, l1->len) == 0) + if (l1->len == l2->len && + memcmp(l1->name, l2->name, l1->len) == 0) num = i + 1; else break; @@ -443,6 +456,8 @@ ptr++; } + /* Now compute size of result ... */ + reslen = LTREE_HDRSIZE; l1 = LTREE_FIRST(*a); for (i = 0; i < num; i++) { @@ -450,6 +465,7 @@ l1 = LEVEL_NEXT(l1); } + /* ... and construct it by copying from *a */ res = (ltree *) palloc0(reslen); SET_VARSIZE(res, reslen); res->numlevel = num; diff -Nru postgresql-9.5-9.5.10/contrib/ltree/sql/ltree.sql postgresql-9.5-9.5.14/contrib/ltree/sql/ltree.sql --- postgresql-9.5-9.5.10/contrib/ltree/sql/ltree.sql 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/ltree/sql/ltree.sql 2018-08-06 20:09:28.000000000 +0000 @@ -49,6 +49,9 @@ SELECT lca('{la.2.3,1.2.3.4.5.6}') IS NULL; SELECT lca('{1.la.2.3,1.2.3.4.5.6}'); SELECT lca('{1.2.3,1.2.3.4.5.6}'); +SELECT lca('{1.2.3}'); +SELECT lca('{1}'), lca('{1}') IS NULL; +SELECT lca('{}') IS NULL; SELECT lca('1.la.2.3','1.2.3.4.5.6'); SELECT lca('1.2.3','1.2.3.4.5.6'); SELECT lca('1.2.2.3','1.2.3.4.5.6'); diff -Nru postgresql-9.5-9.5.10/contrib/ltree_plpython/Makefile postgresql-9.5-9.5.14/contrib/ltree_plpython/Makefile --- postgresql-9.5-9.5.10/contrib/ltree_plpython/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/ltree_plpython/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -27,15 +27,17 @@ # dependency. This does preclude pgxs builds. ifeq ($(PORTNAME), aix) rpathdir = $(pkglibdir):$(python_libdir) -SHLIB_LINK += $(python_libspec) $(python_additional_libs) $(sort $(wildcard ../../src/pl/plpython/libplpython*.exp)) +SHLIB_LINK_INTERNAL += $(sort $(wildcard ../../src/pl/plpython/libplpython*.exp)) +SHLIB_LINK += $(python_libspec) $(python_additional_libs) endif ifeq ($(PORTNAME), win32) -SHLIB_LINK += $(sort $(wildcard ../../src/pl/plpython/libpython*.a)) $(sort $(wildcard ../../src/pl/plpython/libplpython*.a)) +SHLIB_LINK_INTERNAL += $(sort $(wildcard ../../src/pl/plpython/libplpython*.a)) $(sort $(wildcard ../../src/pl/plpython/libpython*.a)) endif ifeq ($(PORTNAME), cygwin) -SHLIB_LINK += -L../ltree -lltree -L../../src/pl/plpython \ - -lplpython$(python_majorversion) $(python_libspec) +SHLIB_LINK_INTERNAL += -L../ltree -lltree -L../../src/pl/plpython \ + -lplpython$(python_majorversion) +SHLIB_LINK += $(python_libspec) endif REGRESS_OPTS += --load-extension=ltree diff -Nru postgresql-9.5-9.5.10/contrib/oid2name/Makefile postgresql-9.5-9.5.14/contrib/oid2name/Makefile --- postgresql-9.5-9.5.10/contrib/oid2name/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/oid2name/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -7,7 +7,7 @@ OBJS = oid2name.o $(WIN32RES) PG_CPPFLAGS = -I$(libpq_srcdir) -PG_LIBS = $(libpq_pgport) +PG_LIBS_INTERNAL = $(libpq_pgport) ifdef USE_PGXS PG_CONFIG = pg_config diff -Nru postgresql-9.5-9.5.10/contrib/oid2name/oid2name.c postgresql-9.5-9.5.14/contrib/oid2name/oid2name.c --- postgresql-9.5-9.5.10/contrib/oid2name/oid2name.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/oid2name/oid2name.c 2018-08-06 20:09:28.000000000 +0000 @@ -9,6 +9,7 @@ */ #include "postgres_fe.h" +#include "fe_utils/connect.h" #include "libpq-fe.h" #include "pg_getopt.h" @@ -263,6 +264,7 @@ PGconn *conn; char *password = NULL; bool new_pass; + PGresult *res; /* * Start the connection. Loop until we have a password if requested by @@ -322,6 +324,17 @@ exit(1); } + res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL); + if (PQresultStatus(res) != PGRES_TUPLES_OK) + { + fprintf(stderr, "oid2name: could not clear search_path: %s\n", + PQerrorMessage(conn)); + PQclear(res); + PQfinish(conn); + exit(-1); + } + PQclear(res); + /* return the conn if good */ return conn; } diff -Nru postgresql-9.5-9.5.10/contrib/pgcrypto/expected/rijndael.out postgresql-9.5-9.5.14/contrib/pgcrypto/expected/rijndael.out --- postgresql-9.5-9.5.10/contrib/pgcrypto/expected/rijndael.out 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/pgcrypto/expected/rijndael.out 2018-08-06 20:09:28.000000000 +0000 @@ -1,5 +1,5 @@ -- --- AES / Rijndael-128 cipher +-- AES cipher (aka Rijndael-128, -192, or -256) -- -- ensure consistent test output regardless of the default bytea format SET bytea_output TO escape; diff -Nru postgresql-9.5-9.5.10/contrib/pgcrypto/pgp-armor.c postgresql-9.5-9.5.14/contrib/pgcrypto/pgp-armor.c --- postgresql-9.5-9.5.10/contrib/pgcrypto/pgp-armor.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/pgcrypto/pgp-armor.c 2018-08-06 20:09:28.000000000 +0000 @@ -42,7 +42,7 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static int -b64_encode(const uint8 *src, unsigned len, uint8 *dst) +pg_base64_encode(const uint8 *src, unsigned len, uint8 *dst) { uint8 *p, *lend = dst + 76; @@ -92,7 +92,7 @@ /* probably should use lookup table */ static int -b64_decode(const uint8 *src, unsigned len, uint8 *dst) +pg_base64_decode(const uint8 *src, unsigned len, uint8 *dst) { const uint8 *srcend = src + len, *s = src; @@ -160,7 +160,7 @@ } static unsigned -b64_enc_len(unsigned srclen) +pg_base64_enc_len(unsigned srclen) { /* * 3 bytes will be converted to 4, linefeed after 76 chars @@ -169,7 +169,7 @@ } static unsigned -b64_dec_len(unsigned srclen) +pg_base64_dec_len(unsigned srclen) { return (srclen * 3) >> 2; } @@ -218,11 +218,11 @@ appendStringInfo(dst, "%s: %s\n", keys[n], values[n]); appendStringInfoChar(dst, '\n'); - /* make sure we have enough room to b64_encode() */ - b64len = b64_enc_len(len); + /* make sure we have enough room to pg_base64_encode() */ + b64len = pg_base64_enc_len(len); enlargeStringInfo(dst, (int) b64len); - res = b64_encode(src, len, (uint8 *) dst->data + dst->len); + res = pg_base64_encode(src, len, (uint8 *) dst->data + dst->len); if (res > b64len) elog(FATAL, "overflow - encode estimate too small"); dst->len += res; @@ -358,14 +358,14 @@ goto out; /* decode crc */ - if (b64_decode(p + 1, 4, buf) != 3) + if (pg_base64_decode(p + 1, 4, buf) != 3) goto out; crc = (((long) buf[0]) << 16) + (((long) buf[1]) << 8) + (long) buf[2]; /* decode data */ - blen = (int) b64_dec_len(len); + blen = (int) pg_base64_dec_len(len); enlargeStringInfo(dst, blen); - res = b64_decode(base64_start, base64_end - base64_start, (uint8 *) dst->data); + res = pg_base64_decode(base64_start, base64_end - base64_start, (uint8 *) dst->data); if (res > blen) elog(FATAL, "overflow - decode estimate too small"); if (res >= 0) diff -Nru postgresql-9.5-9.5.10/contrib/pgcrypto/sql/rijndael.sql postgresql-9.5-9.5.14/contrib/pgcrypto/sql/rijndael.sql --- postgresql-9.5-9.5.10/contrib/pgcrypto/sql/rijndael.sql 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/pgcrypto/sql/rijndael.sql 2018-08-06 20:09:28.000000000 +0000 @@ -1,5 +1,5 @@ -- --- AES / Rijndael-128 cipher +-- AES cipher (aka Rijndael-128, -192, or -256) -- -- ensure consistent test output regardless of the default bytea format SET bytea_output TO escape; diff -Nru postgresql-9.5-9.5.10/contrib/postgres_fdw/expected/postgres_fdw.out postgresql-9.5-9.5.14/contrib/postgres_fdw/expected/postgres_fdw.out --- postgresql-9.5-9.5.10/contrib/postgres_fdw/expected/postgres_fdw.out 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/postgres_fdw/expected/postgres_fdw.out 2018-08-06 20:09:28.000000000 +0000 @@ -3592,6 +3592,71 @@ update bar set f2 = null where current of c; ERROR: WHERE CURRENT OF is not supported for this table type rollback; +-- Test that UPDATE/DELETE with inherited target works with row-level triggers +CREATE TRIGGER trig_row_before +BEFORE UPDATE OR DELETE ON bar2 +FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); +CREATE TRIGGER trig_row_after +AFTER UPDATE OR DELETE ON bar2 +FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); +explain (verbose, costs off) +update bar set f2 = f2 + 100; + QUERY PLAN +-------------------------------------------------------------------------------------- + Update on public.bar + Update on public.bar + Foreign Update on public.bar2 + Remote SQL: UPDATE public.loct2 SET f2 = $2 WHERE ctid = $1 RETURNING f1, f2, f3 + -> Seq Scan on public.bar + Output: bar.f1, (bar.f2 + 100), bar.ctid + -> Foreign Scan on public.bar2 + Output: bar2.f1, (bar2.f2 + 100), bar2.f3, bar2.ctid, bar2.* + Remote SQL: SELECT f1, f2, f3, ctid FROM public.loct2 FOR UPDATE +(9 rows) + +update bar set f2 = f2 + 100; +NOTICE: trig_row_before(23, skidoo) BEFORE ROW UPDATE ON bar2 +NOTICE: OLD: (3,233,33),NEW: (3,333,33) +NOTICE: trig_row_before(23, skidoo) BEFORE ROW UPDATE ON bar2 +NOTICE: OLD: (4,244,44),NEW: (4,344,44) +NOTICE: trig_row_before(23, skidoo) BEFORE ROW UPDATE ON bar2 +NOTICE: OLD: (7,177,77),NEW: (7,277,77) +NOTICE: trig_row_after(23, skidoo) AFTER ROW UPDATE ON bar2 +NOTICE: OLD: (3,233,33),NEW: (3,333,33) +NOTICE: trig_row_after(23, skidoo) AFTER ROW UPDATE ON bar2 +NOTICE: OLD: (4,244,44),NEW: (4,344,44) +NOTICE: trig_row_after(23, skidoo) AFTER ROW UPDATE ON bar2 +NOTICE: OLD: (7,177,77),NEW: (7,277,77) +explain (verbose, costs off) +delete from bar where f2 < 400; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Delete on public.bar + Delete on public.bar + Foreign Delete on public.bar2 + Remote SQL: DELETE FROM public.loct2 WHERE ctid = $1 RETURNING f1, f2, f3 + -> Seq Scan on public.bar + Output: bar.ctid + Filter: (bar.f2 < 400) + -> Foreign Scan on public.bar2 + Output: bar2.ctid, bar2.* + Remote SQL: SELECT f1, f2, f3, ctid FROM public.loct2 WHERE ((f2 < 400)) FOR UPDATE +(10 rows) + +delete from bar where f2 < 400; +NOTICE: trig_row_before(23, skidoo) BEFORE ROW DELETE ON bar2 +NOTICE: OLD: (3,333,33) +NOTICE: trig_row_before(23, skidoo) BEFORE ROW DELETE ON bar2 +NOTICE: OLD: (4,344,44) +NOTICE: trig_row_before(23, skidoo) BEFORE ROW DELETE ON bar2 +NOTICE: OLD: (7,277,77) +NOTICE: trig_row_after(23, skidoo) AFTER ROW DELETE ON bar2 +NOTICE: OLD: (3,333,33) +NOTICE: trig_row_after(23, skidoo) AFTER ROW DELETE ON bar2 +NOTICE: OLD: (4,344,44) +NOTICE: trig_row_after(23, skidoo) AFTER ROW DELETE ON bar2 +NOTICE: OLD: (7,277,77) +-- cleanup drop table foo cascade; NOTICE: drop cascades to foreign table foo2 drop table bar cascade; diff -Nru postgresql-9.5-9.5.10/contrib/postgres_fdw/Makefile postgresql-9.5-9.5.14/contrib/postgres_fdw/Makefile --- postgresql-9.5-9.5.10/contrib/postgres_fdw/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/postgres_fdw/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -5,7 +5,7 @@ PGFILEDESC = "postgres_fdw - foreign data wrapper for PostgreSQL" PG_CPPFLAGS = -I$(libpq_srcdir) -SHLIB_LINK = $(libpq) +SHLIB_LINK_INTERNAL = $(libpq) EXTENSION = postgres_fdw DATA = postgres_fdw--1.0.sql diff -Nru postgresql-9.5-9.5.10/contrib/postgres_fdw/sql/postgres_fdw.sql postgresql-9.5-9.5.14/contrib/postgres_fdw/sql/postgres_fdw.sql --- postgresql-9.5-9.5.10/contrib/postgres_fdw/sql/postgres_fdw.sql 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/postgres_fdw/sql/postgres_fdw.sql 2018-08-06 20:09:28.000000000 +0000 @@ -825,6 +825,24 @@ update bar set f2 = null where current of c; rollback; +-- Test that UPDATE/DELETE with inherited target works with row-level triggers +CREATE TRIGGER trig_row_before +BEFORE UPDATE OR DELETE ON bar2 +FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); + +CREATE TRIGGER trig_row_after +AFTER UPDATE OR DELETE ON bar2 +FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); + +explain (verbose, costs off) +update bar set f2 = f2 + 100; +update bar set f2 = f2 + 100; + +explain (verbose, costs off) +delete from bar where f2 < 400; +delete from bar where f2 < 400; + +-- cleanup drop table foo cascade; drop table bar cascade; drop table loct1; diff -Nru postgresql-9.5-9.5.10/contrib/seg/segparse.c postgresql-9.5-9.5.14/contrib/seg/segparse.c --- postgresql-9.5-9.5.10/contrib/seg/segparse.c 2017-11-06 22:34:09.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/seg/segparse.c 2018-08-06 20:32:16.000000000 +0000 @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -146,7 +146,7 @@ /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 41 "segparse.y" /* yacc.c:355 */ @@ -160,6 +160,8 @@ #line 162 "segparse.c" /* yacc.c:355 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -173,7 +175,7 @@ /* Copy the second part of user declarations. */ -#line 177 "segparse.c" /* yacc.c:358 */ +#line 179 "segparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -1255,7 +1257,7 @@ result->l_ext = '\0'; result->u_ext = '\0'; } -#line 1259 "segparse.c" /* yacc.c:1646 */ +#line 1261 "segparse.c" /* yacc.c:1646 */ break; case 3: @@ -1276,7 +1278,7 @@ result->l_ext = ( (yyvsp[-2].bnd).ext ? (yyvsp[-2].bnd).ext : '\0' ); result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' ); } -#line 1280 "segparse.c" /* yacc.c:1646 */ +#line 1282 "segparse.c" /* yacc.c:1646 */ break; case 4: @@ -1289,7 +1291,7 @@ result->l_ext = ( (yyvsp[-1].bnd).ext ? (yyvsp[-1].bnd).ext : '\0' ); result->u_ext = '-'; } -#line 1293 "segparse.c" /* yacc.c:1646 */ +#line 1295 "segparse.c" /* yacc.c:1646 */ break; case 5: @@ -1302,7 +1304,7 @@ result->l_ext = '-'; result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' ); } -#line 1306 "segparse.c" /* yacc.c:1646 */ +#line 1308 "segparse.c" /* yacc.c:1646 */ break; case 6: @@ -1312,7 +1314,7 @@ result->l_sigd = result->u_sigd = (yyvsp[0].bnd).sigd; result->l_ext = result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' ); } -#line 1316 "segparse.c" /* yacc.c:1646 */ +#line 1318 "segparse.c" /* yacc.c:1646 */ break; case 7: @@ -1325,7 +1327,7 @@ (yyval.bnd).sigd = significant_digits((yyvsp[0].text)); (yyval.bnd).val = val; } -#line 1329 "segparse.c" /* yacc.c:1646 */ +#line 1331 "segparse.c" /* yacc.c:1646 */ break; case 8: @@ -1338,7 +1340,7 @@ (yyval.bnd).sigd = significant_digits((yyvsp[0].text)); (yyval.bnd).val = val; } -#line 1342 "segparse.c" /* yacc.c:1646 */ +#line 1344 "segparse.c" /* yacc.c:1646 */ break; case 9: @@ -1351,11 +1353,11 @@ (yyval.bnd).sigd = significant_digits((yyvsp[0].text)); (yyval.bnd).val = val; } -#line 1355 "segparse.c" /* yacc.c:1646 */ +#line 1357 "segparse.c" /* yacc.c:1646 */ break; -#line 1359 "segparse.c" /* yacc.c:1646 */ +#line 1361 "segparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff -Nru postgresql-9.5-9.5.10/contrib/seg/segscan.c postgresql-9.5-9.5.14/contrib/seg/segscan.c --- postgresql-9.5-9.5.10/contrib/seg/segscan.c 2017-11-06 22:34:09.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/seg/segscan.c 2018-08-06 20:32:16.000000000 +0000 @@ -27,8 +27,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -107,25 +107,13 @@ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ @@ -186,7 +174,7 @@ typedef size_t yy_size_t; #endif -extern yy_size_t seg_yyleng; +extern int seg_yyleng; extern FILE *seg_yyin, *seg_yyout; @@ -225,12 +213,12 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -253,7 +241,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -281,7 +269,7 @@ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -300,11 +288,11 @@ /* yy_hold_char holds the character lost when seg_yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t seg_yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int seg_yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -329,7 +317,7 @@ YY_BUFFER_STATE seg_yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE seg_yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE seg_yy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE seg_yy_scan_bytes (yyconst char *bytes,int len ); void *seg_yyalloc (yy_size_t ); void *seg_yyrealloc (void *,yy_size_t ); @@ -361,12 +349,12 @@ /* Begin user sect3 */ -#define seg_yywrap() 1 +#define seg_yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; -FILE *seg_yyin = (FILE *) 0, *seg_yyout = (FILE *) 0; +FILE *seg_yyin = NULL, *seg_yyout = NULL; typedef int yy_state_type; @@ -375,19 +363,22 @@ int seg_yylineno = 1; extern char *seg_yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr seg_yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static void yynoreturn yy_fatal_error (yyconst char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up seg_yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - seg_yyleng = (size_t) (yy_cp - yy_bp); \ + seg_yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -408,7 +399,7 @@ 0, 0, 0, 1, 3, 0, 3, 2, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, @@ -440,13 +431,13 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[15] = +static yyconst YY_CHAR yy_meta[15] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[31] = +static yyconst flex_uint16_t yy_base[31] = { 0, 0, 0, 40, 41, 13, 15, 32, 31, 27, 27, 10, 41, 41, 41, 19, 27, 26, 0, 24, 22, @@ -460,7 +451,7 @@ 30, 29, 29, 29, 29, 29, 29, 29, 0, 29 } ; -static yyconst flex_int16_t yy_nxt[56] = +static yyconst flex_uint16_t yy_nxt[56] = { 0, 4, 5, 6, 7, 8, 4, 9, 9, 10, 11, 12, 13, 4, 14, 15, 15, 15, 15, 20, 18, @@ -518,7 +509,7 @@ static char *scanbuf; static int scanbuflen; #define YY_NO_INPUT 1 -#line 522 "segscan.c" +#line 513 "segscan.c" #define INITIAL 0 @@ -551,19 +542,19 @@ FILE *seg_yyget_in (void ); -void seg_yyset_in (FILE * in_str ); +void seg_yyset_in (FILE * _in_str ); FILE *seg_yyget_out (void ); -void seg_yyset_out (FILE * out_str ); +void seg_yyset_out (FILE * _out_str ); -yy_size_t seg_yyget_leng (void ); + int seg_yyget_leng (void ); char *seg_yyget_text (void ); int seg_yyget_lineno (void ); -void seg_yyset_lineno (int line_number ); +void seg_yyset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -577,6 +568,10 @@ #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -610,7 +605,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( seg_yytext, seg_yyleng, 1, seg_yyout )) {} } while (0) +#define ECHO do { if (fwrite( seg_yytext, (size_t) seg_yyleng, 1, seg_yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -621,7 +616,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( seg_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -634,7 +629,7 @@ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, (yy_size_t) max_size, seg_yyin)) == 0 && ferror(seg_yyin)) \ + while ( (result = (int) fread(buf, 1, max_size, seg_yyin))==0 && ferror(seg_yyin)) \ { \ if( errno != EINTR) \ { \ @@ -689,7 +684,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -699,9 +694,9 @@ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; if ( !(yy_init) ) { @@ -733,9 +728,9 @@ #line 41 "segscan.l" -#line 737 "segscan.c" +#line 732 "segscan.c" - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -751,7 +746,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -763,7 +758,7 @@ if ( yy_current_state >= 30 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; ++yy_cp; } while ( yy_current_state != 29 ); @@ -832,7 +827,7 @@ #line 52 "segscan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 836 "segscan.c" +#line 831 "segscan.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -976,9 +971,9 @@ */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1007,7 +1002,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1034,7 +1029,7 @@ if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1047,7 +1042,7 @@ } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1089,9 +1084,9 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) seg_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1110,14 +1105,14 @@ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1129,7 +1124,7 @@ if ( yy_current_state >= 30 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; } return yy_current_state; @@ -1142,10 +1137,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1157,12 +1152,16 @@ if ( yy_current_state >= 30 ) yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; yy_is_jam = (yy_current_state == 29); return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1187,7 +1186,7 @@ else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1211,7 +1210,7 @@ case EOB_ACT_END_OF_FILE: { if ( seg_yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1312,7 +1311,7 @@ if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in seg_yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -1459,7 +1458,7 @@ */ static void seg_yyensure_buffer_stack (void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -1467,15 +1466,15 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)seg_yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in seg_yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1484,7 +1483,7 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)seg_yyrealloc @@ -1504,7 +1503,7 @@ * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE seg_yy_scan_buffer (char * base, yy_size_t size ) { @@ -1514,7 +1513,7 @@ base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; b = (YY_BUFFER_STATE) seg_yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -1523,7 +1522,7 @@ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -1546,7 +1545,7 @@ YY_BUFFER_STATE seg_yy_scan_string (yyconst char * yystr ) { - return seg_yy_scan_bytes(yystr,strlen(yystr) ); + return seg_yy_scan_bytes(yystr,(int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to seg_yylex() will @@ -1556,15 +1555,15 @@ * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE seg_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE seg_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; + n = (yy_size_t) (_yybytes_len + 2); buf = (char *) seg_yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in seg_yy_scan_bytes()" ); @@ -1590,9 +1589,9 @@ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -1620,7 +1619,7 @@ */ int seg_yyget_lineno (void) { - + return seg_yylineno; } @@ -1643,7 +1642,7 @@ /** Get the length of the current token. * */ -yy_size_t seg_yyget_leng (void) +int seg_yyget_leng (void) { return seg_yyleng; } @@ -1658,29 +1657,29 @@ } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void seg_yyset_lineno (int line_number ) +void seg_yyset_lineno (int _line_number ) { - seg_yylineno = line_number; + seg_yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see seg_yy_switch_to_buffer */ -void seg_yyset_in (FILE * in_str ) +void seg_yyset_in (FILE * _in_str ) { - seg_yyin = in_str ; + seg_yyin = _in_str ; } -void seg_yyset_out (FILE * out_str ) +void seg_yyset_out (FILE * _out_str ) { - seg_yyout = out_str ; + seg_yyout = _out_str ; } int seg_yyget_debug (void) @@ -1688,9 +1687,9 @@ return seg_yy_flex_debug; } -void seg_yyset_debug (int bdebug ) +void seg_yyset_debug (int _bdebug ) { - seg_yy_flex_debug = bdebug ; + seg_yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -1699,10 +1698,10 @@ * This function is called from seg_yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -1711,8 +1710,8 @@ seg_yyin = stdin; seg_yyout = stdout; #else - seg_yyin = (FILE *) 0; - seg_yyout = (FILE *) 0; + seg_yyin = NULL; + seg_yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -1750,7 +1749,8 @@ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -1759,7 +1759,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1769,11 +1769,12 @@ void *seg_yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *seg_yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1781,17 +1782,17 @@ * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void seg_yyfree (void * ptr ) { - free( (char *) ptr ); /* see seg_yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see seg_yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 51 "segscan.l" +#line 52 "segscan.l" diff -Nru postgresql-9.5-9.5.10/contrib/spi/Makefile postgresql-9.5-9.5.14/contrib/spi/Makefile --- postgresql-9.5-9.5.10/contrib/spi/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/spi/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -17,8 +17,6 @@ # comment out if you want a quieter refint package for other uses PG_CPPFLAGS = -DREFINT_VERBOSE -LDFLAGS_SL += -L$(top_builddir)/src/port -lpgport - ifdef USE_PGXS PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff -Nru postgresql-9.5-9.5.10/contrib/start-scripts/macos/org.postgresql.postgres.plist postgresql-9.5-9.5.14/contrib/start-scripts/macos/org.postgresql.postgres.plist --- postgresql-9.5-9.5.10/contrib/start-scripts/macos/org.postgresql.postgres.plist 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/start-scripts/macos/org.postgresql.postgres.plist 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + Label + org.postgresql.postgres + ProgramArguments + + /bin/sh + /usr/local/pgsql/bin/postgres-wrapper.sh + + UserName + postgres + KeepAlive + + + diff -Nru postgresql-9.5-9.5.10/contrib/start-scripts/macos/postgres-wrapper.sh postgresql-9.5-9.5.14/contrib/start-scripts/macos/postgres-wrapper.sh --- postgresql-9.5-9.5.10/contrib/start-scripts/macos/postgres-wrapper.sh 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/start-scripts/macos/postgres-wrapper.sh 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh + +# PostgreSQL server start script (launched by org.postgresql.postgres.plist) + +# edit these as needed: + +# directory containing postgres executable: +PGBINDIR="/usr/local/pgsql/bin" +# data directory: +PGDATA="/usr/local/pgsql/data" +# file to receive postmaster's initial log messages: +PGLOGFILE="${PGDATA}/pgstart.log" + +# (it's recommendable to enable the Postgres logging_collector feature +# so that PGLOGFILE doesn't grow without bound) + + +# set umask to ensure PGLOGFILE is not created world-readable +umask 077 + +# wait for networking to be up (else server may not bind to desired ports) +/usr/sbin/ipconfig waitall + +# and launch the server +exec "$PGBINDIR"/postgres -D "$PGDATA" >>"$PGLOGFILE" 2>&1 diff -Nru postgresql-9.5-9.5.10/contrib/start-scripts/macos/README postgresql-9.5-9.5.14/contrib/start-scripts/macos/README --- postgresql-9.5-9.5.10/contrib/start-scripts/macos/README 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/start-scripts/macos/README 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,24 @@ +To make macOS automatically launch your PostgreSQL server at system start, +do the following: + +1. Edit the postgres-wrapper.sh script and adjust the file path +variables at its start to reflect where you have installed Postgres, +if that's not /usr/local/pgsql. + +2. Copy the modified postgres-wrapper.sh script into some suitable +installation directory. It can be, but doesn't have to be, where +you keep the Postgres executables themselves. + +3. Edit the org.postgresql.postgres.plist file and adjust its path +for postgres-wrapper.sh to match what you did in step 2. Also, +if you plan to run the Postgres server under some user name other +than "postgres", adjust the UserName parameter value for that. + +4. Copy the modified org.postgresql.postgres.plist file into +/Library/LaunchDaemons/. You must do this as root: + sudo cp org.postgresql.postgres.plist /Library/LaunchDaemons +because the file will be ignored if it is not root-owned. + +At this point a reboot should launch the server. But if you want +to test it without rebooting, you can do + sudo launchctl load /Library/LaunchDaemons/org.postgresql.postgres.plist diff -Nru postgresql-9.5-9.5.10/contrib/start-scripts/osx/README postgresql-9.5-9.5.14/contrib/start-scripts/osx/README --- postgresql-9.5-9.5.10/contrib/start-scripts/osx/README 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/start-scripts/osx/README 2018-08-06 20:09:28.000000000 +0000 @@ -1,3 +1,8 @@ +The scripts in this directory are for use with Apple's SystemStarter +infrastructure, which is deprecated since macOS 10.4 and is gone entirely +as of 10.10. You should use the scripts in ../macos instead, unless +you are using a macOS release too old to have launchd. + To install execute the following: sudo /bin/sh ./install.sh diff -Nru postgresql-9.5-9.5.10/contrib/test_decoding/expected/oldest_xmin.out postgresql-9.5-9.5.14/contrib/test_decoding/expected/oldest_xmin.out --- postgresql-9.5-9.5.10/contrib/test_decoding/expected/oldest_xmin.out 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/test_decoding/expected/oldest_xmin.out 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,30 @@ +Parsed test spec with 2 sessions + +starting permutation: s0_begin s0_getxid s1_begin s1_insert s0_alter s0_commit s0_checkpoint s0_get_changes s0_get_changes s1_commit s0_vacuum s0_get_changes +step s0_begin: BEGIN; +step s0_getxid: SELECT txid_current() IS NULL; +?column? + +f +step s1_begin: BEGIN; +step s1_insert: INSERT INTO harvest VALUES ((1, 2, 3)); +step s0_alter: ALTER TYPE basket DROP ATTRIBUTE mangos; +step s0_commit: COMMIT; +step s0_checkpoint: CHECKPOINT; +step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); +data + +step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); +data + +step s1_commit: COMMIT; +step s0_vacuum: VACUUM pg_attribute; +step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); +data + +BEGIN +table public.harvest: INSERT: fruits[basket]:'(1,2,3)' +COMMIT +?column? + +stop diff -Nru postgresql-9.5-9.5.10/contrib/test_decoding/expected/snapshot_transfer.out postgresql-9.5-9.5.14/contrib/test_decoding/expected/snapshot_transfer.out --- postgresql-9.5-9.5.10/contrib/test_decoding/expected/snapshot_transfer.out 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/test_decoding/expected/snapshot_transfer.out 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,49 @@ +Parsed test spec with 2 sessions + +starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_sub_get_base_snap s1_produce_new_snap s0_insert s0_end_sub0 s0_commit s0_get_changes +step s0_begin: BEGIN; +step s0_begin_sub0: SAVEPOINT s0; +step s0_log_assignment: SELECT txid_current() IS NULL; +?column? + +f +step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0); +step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int; +step s0_insert: INSERT INTO harvest VALUES (1, 2, 3); +step s0_end_sub0: RELEASE SAVEPOINT s0; +step s0_commit: COMMIT; +step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); +data + +BEGIN +table public.dummy: INSERT: i[integer]:0 +table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3 +COMMIT +?column? + +stop + +starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_begin_sub1 s0_sub_get_base_snap s1_produce_new_snap s0_insert s0_end_sub1 s0_end_sub0 s0_commit s0_get_changes +step s0_begin: BEGIN; +step s0_begin_sub0: SAVEPOINT s0; +step s0_log_assignment: SELECT txid_current() IS NULL; +?column? + +f +step s0_begin_sub1: SAVEPOINT s1; +step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0); +step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int; +step s0_insert: INSERT INTO harvest VALUES (1, 2, 3); +step s0_end_sub1: RELEASE SAVEPOINT s1; +step s0_end_sub0: RELEASE SAVEPOINT s0; +step s0_commit: COMMIT; +step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); +data + +BEGIN +table public.dummy: INSERT: i[integer]:0 +table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3 +COMMIT +?column? + +stop diff -Nru postgresql-9.5-9.5.10/contrib/test_decoding/Makefile postgresql-9.5-9.5.14/contrib/test_decoding/Makefile --- postgresql-9.5-9.5.10/contrib/test_decoding/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/test_decoding/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -52,7 +52,8 @@ $(pg_regress_installcheck) \ $(REGRESSCHECKS) -ISOLATIONCHECKS=mxact delayed_startup ondisk_startup concurrent_ddl_dml +ISOLATIONCHECKS=mxact delayed_startup ondisk_startup concurrent_ddl_dml \ + oldest_xmin snapshot_transfer isolationcheck: | submake-isolation submake-test_decoding temp-install $(MKDIR_P) isolation_output diff -Nru postgresql-9.5-9.5.10/contrib/test_decoding/specs/oldest_xmin.spec postgresql-9.5-9.5.14/contrib/test_decoding/specs/oldest_xmin.spec --- postgresql-9.5-9.5.10/contrib/test_decoding/specs/oldest_xmin.spec 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/test_decoding/specs/oldest_xmin.spec 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,40 @@ +# Test advancement of the slot's oldest xmin + +setup +{ + SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); -- must be first write in xact + DROP TYPE IF EXISTS basket; + CREATE TYPE basket AS (apples integer, pears integer, mangos integer); + DROP TABLE IF EXISTS harvest; + CREATE TABLE harvest(fruits basket); +} + +teardown +{ + DROP TABLE IF EXISTS harvest; + DROP TYPE IF EXISTS basket; + SELECT 'stop' FROM pg_drop_replication_slot('isolation_slot'); +} + +session "s0" +step "s0_begin" { BEGIN; } +step "s0_getxid" { SELECT txid_current() IS NULL; } +step "s0_alter" { ALTER TYPE basket DROP ATTRIBUTE mangos; } +step "s0_commit" { COMMIT; } +step "s0_checkpoint" { CHECKPOINT; } +step "s0_vacuum" { VACUUM pg_attribute; } +step "s0_get_changes" { SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); } + +session "s1" +step "s1_begin" { BEGIN; } +step "s1_insert" { INSERT INTO harvest VALUES ((1, 2, 3)); } +step "s1_commit" { COMMIT; } + +# Checkpoint with following get_changes forces xmin advancement. We do +# get_changes twice because if one more xl_running_xacts record had slipped +# before our CHECKPOINT, xmin will be advanced only on this record, thus not +# reaching value needed for vacuuming corresponding pg_attribute entry. ALTER of +# composite type is a rare form of DDL which allows T1 to see the tuple which +# will be removed (xmax set) before T1 commits. That is, interlocking doesn't +# forbid modifying catalog after someone read it (and didn't commit yet). +permutation "s0_begin" "s0_getxid" "s1_begin" "s1_insert" "s0_alter" "s0_commit" "s0_checkpoint" "s0_get_changes" "s0_get_changes" "s1_commit" "s0_vacuum" "s0_get_changes" diff -Nru postgresql-9.5-9.5.10/contrib/test_decoding/specs/snapshot_transfer.spec postgresql-9.5-9.5.14/contrib/test_decoding/specs/snapshot_transfer.spec --- postgresql-9.5-9.5.10/contrib/test_decoding/specs/snapshot_transfer.spec 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/test_decoding/specs/snapshot_transfer.spec 2018-08-06 20:09:28.000000000 +0000 @@ -0,0 +1,42 @@ +# Test snapshot transfer from subxact to top-level and receival of later snaps. + +setup +{ + SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); -- must be first write in xact + DROP TABLE IF EXISTS dummy; + CREATE TABLE dummy(i int); + DROP TABLE IF EXISTS harvest; + CREATE TABLE harvest(apples int, pears int); +} + +teardown +{ + DROP TABLE IF EXISTS harvest; + DROP TABLE IF EXISTS dummy; + SELECT 'stop' FROM pg_drop_replication_slot('isolation_slot'); +} + +session "s0" +step "s0_begin" { BEGIN; } +step "s0_begin_sub0" { SAVEPOINT s0; } +step "s0_log_assignment" { SELECT txid_current() IS NULL; } +step "s0_begin_sub1" { SAVEPOINT s1; } +step "s0_sub_get_base_snap" { INSERT INTO dummy VALUES (0); } +step "s0_insert" { INSERT INTO harvest VALUES (1, 2, 3); } +step "s0_end_sub0" { RELEASE SAVEPOINT s0; } +step "s0_end_sub1" { RELEASE SAVEPOINT s1; } +step "s0_insert2" { INSERT INTO harvest VALUES (1, 2, 3, 4); } +step "s0_commit" { COMMIT; } +step "s0_get_changes" { SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); } + +session "s1" +step "s1_produce_new_snap" { ALTER TABLE harvest ADD COLUMN mangos int; } + +# start top-level without base snap, get base snap in subxact, then create new +# snap and make sure it is queued. +permutation "s0_begin" "s0_begin_sub0" "s0_log_assignment" "s0_sub_get_base_snap" "s1_produce_new_snap" "s0_insert" "s0_end_sub0" "s0_commit" "s0_get_changes" + +# In previous test, we firstly associated subxact with xact and only then got +# base snap; now nest one more subxact to get snap first and only then (at +# commit) associate it with toplevel. +permutation "s0_begin" "s0_begin_sub0" "s0_log_assignment" "s0_begin_sub1" "s0_sub_get_base_snap" "s1_produce_new_snap" "s0_insert" "s0_end_sub1" "s0_end_sub0" "s0_commit" "s0_get_changes" diff -Nru postgresql-9.5-9.5.10/contrib/vacuumlo/Makefile postgresql-9.5-9.5.14/contrib/vacuumlo/Makefile --- postgresql-9.5-9.5.10/contrib/vacuumlo/Makefile 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/vacuumlo/Makefile 2018-08-06 20:09:28.000000000 +0000 @@ -7,7 +7,7 @@ OBJS = vacuumlo.o $(WIN32RES) PG_CPPFLAGS = -I$(libpq_srcdir) -PG_LIBS = $(libpq_pgport) +PG_LIBS_INTERNAL = $(libpq_pgport) ifdef USE_PGXS PG_CONFIG = pg_config diff -Nru postgresql-9.5-9.5.10/contrib/vacuumlo/vacuumlo.c postgresql-9.5-9.5.14/contrib/vacuumlo/vacuumlo.c --- postgresql-9.5-9.5.10/contrib/vacuumlo/vacuumlo.c 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/contrib/vacuumlo/vacuumlo.c 2018-08-06 20:09:28.000000000 +0000 @@ -21,6 +21,7 @@ #include #endif +#include "fe_utils/connect.h" #include "libpq-fe.h" #include "pg_getopt.h" @@ -135,11 +136,8 @@ fprintf(stdout, "Test run: no large objects will be removed!\n"); } - /* - * Don't get fooled by any non-system catalogs - */ - res = PQexec(conn, "SET search_path = pg_catalog"); - if (PQresultStatus(res) != PGRES_COMMAND_OK) + res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL); + if (PQresultStatus(res) != PGRES_TUPLES_OK) { fprintf(stderr, "Failed to set search_path:\n"); fprintf(stderr, "%s", PQerrorMessage(conn)); diff -Nru postgresql-9.5-9.5.10/COPYRIGHT postgresql-9.5-9.5.14/COPYRIGHT --- postgresql-9.5-9.5.10/COPYRIGHT 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/COPYRIGHT 2018-08-06 20:09:28.000000000 +0000 @@ -1,7 +1,7 @@ PostgreSQL Database Management System (formerly known as Postgres, then as Postgres95) -Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group +Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California diff -Nru postgresql-9.5-9.5.10/debian/changelog postgresql-9.5-9.5.14/debian/changelog --- postgresql-9.5-9.5.10/debian/changelog 2017-11-13 15:00:31.000000000 +0000 +++ postgresql-9.5-9.5.14/debian/changelog 2018-08-15 18:36:47.000000000 +0000 @@ -1,3 +1,112 @@ +postgresql-9.5 (9.5.14-0ubuntu0.16.04) xenial-security; urgency=medium + + * New upstream release (LP: #1786938) + - Fix failure to reset libpq's state fully between connection attempts + . + An unprivileged user of dblink or postgres_fdw could bypass the checks + intended to prevent use of server-side credentials, such as a ~/.pgpass + file owned by the operating-system user running the server. Servers + allowing peer authentication on local connections are particularly + vulnerable. Other attacks such as SQL injection into a postgres_fdw + session are also possible. Attacking postgres_fdw in this way requires + the ability to create a foreign server object with selected connection + parameters, but any user with access to dblink could exploit the + problem. In general, an attacker with the ability to select the + connection parameters for a libpq-using application could cause + mischief, though other plausible attack scenarios are harder to think + of. Our thanks to Andrew Krasichkov for reporting this issue. + (CVE-2018-10915) + - Fix INSERT ... ON CONFLICT UPDATE through a view that isn't just SELECT + FROM ... + . + Erroneous expansion of an updatable view could lead to crashes or + attribute ... has the wrong type errors, if the view's SELECT list + doesn't match one-to-one with the underlying table's columns. + Furthermore, this bug could be leveraged to allow updates of columns + that an attacking user lacks UPDATE privilege for, if that user has + INSERT and UPDATE privileges for some other column(s) of the table. Any + user could also use it for disclosure of server memory. + (CVE-2018-10925) + - d/libecpg-dev.install: Add new pgtypes header. + - d/libpgtypes3.symbols: Add new pgtypes symbol. + - Details about these and changes can be found at + https://www.postgresql.org/docs/9.5/static/release-9-5-14.html + + -- Christian Ehrhardt Tue, 14 Aug 2018 14:49:16 +0200 + +postgresql-9.5 (9.5.13-0ubuntu0.16.04) xenial; urgency=medium + + * New upstream release (LP: #1769888) + - A dump/restore is not required for those running 9.5.X. + However, if the function marking mistakes mentioned in the first + changelog entry affect you, you will want to take steps to + correct your database catalogs. + - Details about changes can be found at + https://www.postgresql.org/docs/9.5/static/release-9-5-13.html + + -- Christian Ehrhardt Tue, 08 May 2018 15:17:49 +0200 + +postgresql-9.5 (9.5.12-0ubuntu0.16.04) xenial-security; urgency=medium + + * New upstream release (LP: #1752271) + If you run an installation in which not all users are mutually + trusting, or if you maintain an application or extension that is + intended for use in arbitrary situations, it is strongly recommended + that you read the documentation changes described in the first changelog + entry below, and take suitable steps to ensure that your installation or + code is secure. + + Also, the changes described in the second changelog entry below may + cause functions used in index expressions or materialized views to fail + during auto-analyze, or when reloading from a dump. After upgrading, + monitor the server logs for such problems, and fix affected functions. + + - Document how to configure installations and applications to guard + against search-path-dependent trojan-horse attacks from other users + + Using a search_path setting that includes any schemas writable by a + hostile user enables that user to capture control of queries and then + run arbitrary SQL code with the permissions of the attacked user. While + it is possible to write queries that are proof against such hijacking, + it is notationally tedious, and it's very easy to overlook holes. + Therefore, we now recommend configurations in which no untrusted schemas + appear in one's search path. + (CVE-2018-1058) + + - Avoid use of insecure search_path settings in pg_dump and other client + programs + + pg_dump, pg_upgrade, vacuumdb and other PostgreSQL-provided applications + were themselves vulnerable to the type of hijacking described in the + previous changelog entry; since these applications are commonly run by + superusers, they present particularly attractive targets. To make them + secure whether or not the installation as a whole has been secured, + modify them to include only the pg_catalog schema in their search_path + settings. Autovacuum worker processes now do the same, as well. + + In cases where user-provided functions are indirectly executed by these + programs -- for example, user-provided functions in index expressions -- + the tighter search_path may result in errors, which will need to be + corrected by adjusting those user-provided functions to not assume + anything about what search path they are invoked under. That has always + been good practice, but now it will be necessary for correct behavior. + (CVE-2018-1058) + + - Details about other changes can be found at + https://www.postgresql.org/docs/9.5/static/release-9-5-12.html + + -- Christian Ehrhardt Wed, 28 Feb 2018 09:59:08 +0100 + +postgresql-9.5 (9.5.11-0ubuntu0.16.04) xenial-security; urgency=medium + + * New upstream release (LP: #1747676) + - Ensure that all temporary files made by pg_upgrade are non-world-readable + (CVE-2018-1053) + - Details about other changes at full changelog: + https://www.postgresql.org/docs/9.5/static/release-9-5-11.html + + -- Christian Ehrhardt Tue, 06 Feb 2018 15:20:02 +0100 + postgresql-9.5 (9.5.10-0ubuntu0.16.04) xenial-security; urgency=medium * New upstream release (LP: #1730661) diff -Nru postgresql-9.5-9.5.10/debian/libecpg-dev.install postgresql-9.5-9.5.14/debian/libecpg-dev.install --- postgresql-9.5-9.5.10/debian/libecpg-dev.install 2016-03-29 19:01:56.000000000 +0000 +++ postgresql-9.5-9.5.14/debian/libecpg-dev.install 2018-08-14 12:49:16.000000000 +0000 @@ -1,6 +1,6 @@ usr/include/postgresql/ecpg*.h usr/include/postgresql/informix/* -usr/include/postgresql/pgtypes_*.h +usr/include/postgresql/pgtypes*.h usr/include/postgresql/sql3types.h usr/include/postgresql/sqlca.h usr/include/postgresql/sqlda*.h diff -Nru postgresql-9.5-9.5.10/debian/libpgtypes3.symbols postgresql-9.5-9.5.14/debian/libpgtypes3.symbols --- postgresql-9.5-9.5.10/debian/libpgtypes3.symbols 2015-05-19 19:10:11.000000000 +0000 +++ postgresql-9.5-9.5.14/debian/libpgtypes3.symbols 2018-08-14 12:49:16.000000000 +0000 @@ -1,4 +1,5 @@ libpgtypes.so.3 libpgtypes3 #MINVER# + PGTYPESchar_free@Base 9.5.14 PGTYPESdate_dayofweek@Base 0 PGTYPESdate_defmt_asc@Base 0 PGTYPESdate_fmt_asc@Base 0 diff -Nru postgresql-9.5-9.5.10/doc/bug.template postgresql-9.5-9.5.14/doc/bug.template --- postgresql-9.5-9.5.10/doc/bug.template 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/bug.template 2018-08-06 20:09:28.000000000 +0000 @@ -27,7 +27,7 @@ Operating System (example: Linux 2.4.18) : - PostgreSQL version (example: PostgreSQL 9.5.10): PostgreSQL 9.5.10 + PostgreSQL version (example: PostgreSQL 9.5.14): PostgreSQL 9.5.14 Compiler used (example: gcc 3.3.5) : diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/acronyms.sgml postgresql-9.5-9.5.14/doc/src/sgml/acronyms.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/acronyms.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/acronyms.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -71,7 +71,7 @@ CPAN - Comprehensive Perl Archive Network + Comprehensive Perl Archive Network diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/backup.sgml postgresql-9.5-9.5.14/doc/src/sgml/backup.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/backup.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/backup.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -35,7 +35,7 @@ for this purpose. The basic usage of this command is: -pg_dump dbname > outfile +pg_dump dbname > dumpfile As you see, pg_dump writes its result to the standard output. We will see below how this can be useful. @@ -109,9 +109,9 @@ be read in by the psql program. The general command form to restore a dump is -psql dbname < infile +psql dbname < dumpfile - where infile is the + where dumpfile is the file output by the pg_dump command. The database dbname will not be created by this command, so you must create it yourself from template0 @@ -141,7 +141,7 @@ behavior and have psql exit with an exit status of 3 if an SQL error occurs: -psql --set ON_ERROR_STOP=on dbname < infile +psql --set ON_ERROR_STOP=on dbname < dumpfile Either way, you will only have a partially restored database. Alternatively, you can specify that the whole dump should be @@ -201,11 +201,11 @@ cluster, and also preserves cluster-wide data such as role and tablespace definitions. The basic usage of this command is: -pg_dumpall > outfile +pg_dumpall > dumpfile The resulting dump can be restored with psql: -psql -f infile postgres +psql -f dumpfile postgres (Actually, you can specify any existing database name to start from, but if you are loading into an empty cluster then postgres @@ -1122,7 +1122,7 @@ Not all of the requested files will be WAL segment files; you should also expect requests for files with a suffix of - .backup or .history. Also be aware that + .history. Also be aware that the base name of the %p path will be different from %f; do not expect them to be interchangeable. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/config.sgml postgresql-9.5-9.5.14/doc/src/sgml/config.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/config.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/config.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -2792,7 +2792,7 @@ The synchronous standby will be the first standby named in this list that is both currently connected and streaming data in real-time (as shown by a state of streaming in the - + pg_stat_replication view). Other standby servers appearing later in this list represent potential synchronous standbys. @@ -2962,7 +2962,7 @@ Specifies the minimum frequency for the WAL receiver process on the standby to send information about replication progress to the primary or upstream standby, where it can be seen using the - + pg_stat_replication view. The standby will report the last transaction log position it has written, the last position it has flushed to disk, and the last position it has applied. @@ -5545,6 +5545,13 @@ + For more information on schema handling, see + . In particular, the default + configuration is suitable only when the database has a single user or + a few mutually-trusting users. + + + The current effective value of the search path can be examined via the SQL function current_schemas @@ -5554,10 +5561,6 @@ current_schemas shows how the items appearing in search_path were resolved. - - - For more information on schema handling, see . - diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/contrib.sgml postgresql-9.5-9.5.14/doc/src/sgml/contrib.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/contrib.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/contrib.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -75,7 +75,7 @@ choice. To do that, add SCHEMA schema_name to the CREATE EXTENSION command. By default, the objects will be placed in your current creation - target schema, typically public. + target schema, which in turn defaults to public. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/contrib-spi.sgml postgresql-9.5-9.5.14/doc/src/sgml/contrib-spi.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/contrib-spi.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/contrib-spi.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -10,7 +10,9 @@ The spi module provides several workable examples - of using SPI and triggers. While these functions are of some value in + of using the Server Programming Interface + (SPI) and triggers. While these functions are of + some value in their own right, they are even more useful as examples to modify for your own purposes. The functions are general enough to be used with any table, but you have to specify table and field names (as described diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/datatype.sgml postgresql-9.5-9.5.14/doc/src/sgml/datatype.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/datatype.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/datatype.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -60,7 +60,7 @@ bit varying [ (n) ] - varbit + varbit [ (n) ] variable-length bit string @@ -508,15 +508,14 @@ - We use the following terms below: The - scale of a numeric is the - count of decimal digits in the fractional part, to the right of - the decimal point. The precision of a - numeric is the total count of significant digits in - the whole number, that is, the number of digits to both sides of - the decimal point. So the number 23.5141 has a precision of 6 - and a scale of 4. Integers can be considered to have a scale of - zero. + We use the following terms below: the + precision of a numeric + is the total count of significant digits in the whole number, + that is, the number of digits to both sides of the decimal point. + The scale of a numeric is the + count of decimal digits in the fractional part, to the right of the + decimal point. So the number 23.5141 has a precision of 6 and a + scale of 4. Integers can be considered to have a scale of zero. @@ -2665,19 +2664,6 @@ - Internally interval values are stored as months, days, - and seconds. This is done because the number of days in a month - varies, and a day can have 23 or 25 hours if a daylight savings - time adjustment is involved. The months and days fields are integers - while the seconds field can store fractions. Because intervals are - usually created from constant strings or timestamp subtraction, - this storage method works well in most cases. Functions - justify_days and justify_hours are - available for adjusting days and hours that overflow their normal - ranges. - - - In the verbose input format, and in some fields of the more compact input formats, field values can have fractional parts; for example '1.5 week' or '01:02:03.45'. Such input is @@ -2728,6 +2714,33 @@ + + Internally interval values are stored as months, days, + and seconds. This is done because the number of days in a month + varies, and a day can have 23 or 25 hours if a daylight savings + time adjustment is involved. The months and days fields are integers + while the seconds field can store fractions. Because intervals are + usually created from constant strings or timestamp subtraction, + this storage method works well in most cases, but can cause unexpected + results: + + +SELECT EXTRACT(hours from '80 minutes'::interval); + date_part +----------- + 1 + +SELECT EXTRACT(days from '80 hours'::interval); + date_part +----------- + 0 + + + Functions justify_days and + justify_hours are available for adjusting days + and hours that overflow their normal ranges. + + @@ -3054,6 +3067,20 @@ Implementation Details + Enum labels are case sensitive, so + 'happy' is not the same as 'HAPPY'. + White space in the labels is significant too. + + + + Although enum types are primarily intended for static sets of values, + there is support for adding new values to an existing enum type, and for + renaming values (see ). Existing values + cannot be removed from an enum type, nor can the sort ordering of such + values be changed, short of dropping and re-creating the enum type. + + + An enum value occupies four bytes on disk. The length of an enum value's textual label is limited by the NAMEDATALEN setting compiled into PostgreSQL; in standard @@ -3061,12 +3088,6 @@ - Enum labels are case sensitive, so - 'happy' is not the same as 'HAPPY'. - White space in the labels is significant too. - - - The translations from internal enum values to textual labels are kept in the system catalog pg_enum. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/dblink.sgml postgresql-9.5-9.5.14/doc/src/sgml/dblink.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/dblink.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/dblink.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -83,7 +83,7 @@ libpq-style connection info string, for example hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres - password=mypasswd. + password=mypasswd options=-csearch_path=. For details see . Alternatively, the name of a foreign server. @@ -105,6 +105,17 @@ Notes + If untrusted users have access to a database that has not adopted a + secure schema usage pattern, + begin each session by removing publicly-writable schemas from + search_path. One could, for example, + add options=-csearch_path= to + connstr. This consideration is not specific + to dblink; it applies to every interface for + executing arbitrary SQL commands. + + + Only superusers may use dblink_connect to create non-password-authenticated connections. If non-superusers need this capability, use dblink_connect_u instead. @@ -121,13 +132,13 @@ Examples -SELECT dblink_connect('dbname=postgres'); +SELECT dblink_connect('dbname=postgres options=-csearch_path='); dblink_connect ---------------- OK (1 row) -SELECT dblink_connect('myconn', 'dbname=postgres'); +SELECT dblink_connect('myconn', 'dbname=postgres options=-csearch_path='); dblink_connect ---------------- OK @@ -416,7 +427,8 @@ SELECT * - FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc') + FROM dblink('dbname=mydb options=-csearch_path=', + 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%'; @@ -450,7 +462,8 @@ CREATE VIEW myremote_pg_proc AS SELECT * - FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc') + FROM dblink('dbname=postgres options=-csearch_path=', + 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text); SELECT * FROM myremote_pg_proc WHERE proname LIKE 'bytea%'; @@ -461,7 +474,8 @@ Examples -SELECT * FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc') +SELECT * FROM dblink('dbname=postgres options=-csearch_path=', + 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%'; proname | prosrc ------------+------------ @@ -479,7 +493,7 @@ byteaout | byteaout (12 rows) -SELECT dblink_connect('dbname=postgres'); +SELECT dblink_connect('dbname=postgres options=-csearch_path='); dblink_connect ---------------- OK @@ -503,7 +517,7 @@ byteaout | byteaout (12 rows) -SELECT dblink_connect('myconn', 'dbname=regression'); +SELECT dblink_connect('myconn', 'dbname=regression options=-csearch_path='); dblink_connect ---------------- OK @@ -778,7 +792,7 @@ Examples -SELECT dblink_connect('dbname=postgres'); +SELECT dblink_connect('dbname=postgres options=-csearch_path='); dblink_connect ---------------- OK @@ -899,7 +913,7 @@ Examples -SELECT dblink_connect('dbname=postgres'); +SELECT dblink_connect('dbname=postgres options=-csearch_path='); dblink_connect ---------------- OK @@ -1036,7 +1050,7 @@ Examples -SELECT dblink_connect('dbname=postgres'); +SELECT dblink_connect('dbname=postgres options=-csearch_path='); dblink_connect ---------------- OK diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/ddl.sgml postgresql-9.5-9.5.14/doc/src/sgml/ddl.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/ddl.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/ddl.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -1621,10 +1621,21 @@ + The policy above implicitly provides a WITH CHECK + clause identical to its USING clause, so that the + constraint applies both to rows selected by a command (so a manager + cannot SELECT, UPDATE, + or DELETE existing rows belonging to a different + manager) and to rows modified by a command (so rows belonging to a + different manager cannot be created via INSERT + or UPDATE). + + + If no role is specified, or the special user name PUBLIC is used, then the policy applies to all - users on the system. To allow all users to access their own row in - a users table, a simple policy can be used: + users on the system. To allow all users to access only their own row in + a users table, a simple policy can be used: @@ -1633,20 +1644,33 @@ + This works similarly to the previous example. + + + To use a different policy for rows that are being added to the table - compared to those rows that are visible, the WITH CHECK - clause can be used. This policy would allow all users to view all rows - in the users table, but only modify their own: + compared to those rows that are visible, multiple policies can be + combined. This pair of policies would allow all users to view all rows + in the users table, but only modify their own: -CREATE POLICY user_policy ON users - USING (true) - WITH CHECK (user_name = current_user); +CREATE POLICY user_sel_policy ON users + FOR SELECT + USING (true); +CREATE POLICY user_mod_policy ON users + USING (user_name = current_user); - Row security can also be disabled with the ALTER TABLE + In a SELECT command, these two policies are combined + using OR, with the net effect being that all rows + can be selected. In other command types, only the second policy applies, + so that the effects are the same as before. + + + + Row security can also be disabled with the ALTER TABLE command. Disabling row security does not remove any policies that are defined on the table; they are simply ignored. Then all rows in the table are visible and modifiable, subject to the standard SQL privileges @@ -2119,6 +2143,20 @@ in other schemas in the database. + + The ability to create like-named objects in different schemas complicates + writing a query that references precisely the same objects every time. It + also opens up the potential for users to change the behavior of other + users' queries, maliciously or accidentally. Due to the prevalence of + unqualified names in queries and their use + in PostgreSQL internals, adding a schema + to search_path effectively trusts all users having + CREATE privilege on that schema. When you run an + ordinary query, a malicious user able to create objects in a schema of + your search path can take control and execute arbitrary SQL functions as + though you executed them. + + schema current @@ -2235,8 +2273,9 @@ the schema public. This allows all users that are able to connect to a given database to create objects in its - public schema. If you do - not want to allow that, you can revoke that privilege: + public schema. + Some usage patterns call for + revoking that privilege: REVOKE CREATE ON SCHEMA public FROM PUBLIC; @@ -2286,50 +2325,80 @@ Usage Patterns - Schemas can be used to organize your data in many ways. There are - a few usage patterns that are recommended and are easily supported by - the default configuration: + Schemas can be used to organize your data in many ways. There are a few + usage patterns easily supported by the default configuration, only one of + which suffices when database users mistrust other database users: + - If you do not create any schemas then all users access the - public schema implicitly. This simulates the situation where - schemas are not available at all. This setup is mainly - recommended when there is only a single user or a few cooperating - users in a database. This setup also allows smooth transition - from the non-schema-aware world. + Constrain ordinary users to user-private schemas. To implement this, + issue REVOKE CREATE ON SCHEMA public FROM PUBLIC, + and create a schema for each user with the same name as that user. If + affected users had logged in before this, consider auditing the public + schema for objects named like objects in + schema pg_catalog. Recall that the default search + path starts with $user, which resolves to the user + name. Therefore, if each user has a separate schema, they access their + own schemas by default. - You can create a schema for each user with the same name as - that user. Recall that the default search path starts with - $user, which resolves to the user name. - Therefore, if each user has a separate schema, they access their - own schemas by default. + Remove the public schema from each user's default search path + using ALTER ROLE user SET + search_path = "$user". Everyone retains the ability to + create objects in the public schema, but only qualified names will + choose those objects. While qualified table references are fine, calls + to functions in the public schema will be + unsafe or unreliable. Also, a user holding + the CREATEROLE privilege can undo this setting and + issue arbitrary queries under the identity of users relying on the + setting. If you create functions or extensions in the public schema or + grant CREATEROLE to users not warranting this + almost-superuser ability, use the first pattern instead. + + - If you use this setup then you might also want to revoke access - to the public schema (or drop it altogether), so users are - truly constrained to their own schemas. + Remove the public schema from search_path in + postgresql.conf. + The ensuing user experience matches the previous pattern. In addition + to that pattern's implications for functions + and CREATEROLE, this trusts database owners + like CREATEROLE. If you create functions or + extensions in the public schema or assign + the CREATEROLE + privilege, CREATEDB privilege or individual database + ownership to users not warranting almost-superuser access, use the + first pattern instead. - To install shared applications (tables to be used by everyone, - additional functions provided by third parties, etc.), put them - into separate schemas. Remember to grant appropriate - privileges to allow the other users to access them. Users can - then refer to these additional objects by qualifying the names - with a schema name, or they can put the additional schemas into - their search path, as they choose. + Keep the default. All users access the public schema implicitly. This + simulates the situation where schemas are not available at all, giving + a smooth transition from the non-schema-aware world. However, any user + can issue arbitrary queries under the identity of any user not electing + to protect itself individually. This pattern is acceptable only when + the database has a single user or a few mutually-trusting users. + + + For any pattern, to install shared applications (tables to be used by + everyone, additional functions provided by third parties, etc.), put them + into separate schemas. Remember to grant appropriate privileges to allow + the other users to access them. Users can then refer to these additional + objects by qualifying the names with a schema name, or they can put the + additional schemas into their search path, as they choose. + @@ -2352,7 +2421,7 @@ Also, there is no concept of a public schema in the SQL standard. For maximum conformance to the standard, you should - not use (perhaps even remove) the public schema. + not use the public schema. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/dml.sgml postgresql-9.5-9.5.14/doc/src/sgml/dml.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/dml.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/dml.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -116,7 +116,7 @@ - When inserting a lot of data at the same time, considering using + When inserting a lot of data at the same time, consider using the command. It is not as flexible as the command, but is more efficient. Refer diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/ecpg.sgml postgresql-9.5-9.5.14/doc/src/sgml/ecpg.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/ecpg.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/ecpg.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -187,6 +187,18 @@ + If untrusted users have access to a database that has not adopted a + secure schema usage pattern, + begin each session by removing publicly-writable schemas + from search_path. For example, + add options=-csearch_path= + to options, or + issue EXEC SQL SELECT pg_catalog.set_config('search_path', '', + false); after connecting. This consideration is not specific to + ECPG; it applies to every interface for executing arbitrary SQL commands. + + + Here are some examples of CONNECT statements: EXEC SQL CONNECT TO mydb@sql.mydomain.com; @@ -266,8 +278,11 @@ main() { EXEC SQL CONNECT TO testdb1 AS con1 USER testuser; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL CONNECT TO testdb2 AS con2 USER testuser; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL CONNECT TO testdb3 AS con3 USER testuser; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; /* This query would be executed in the last opened database "testdb3". */ EXEC SQL SELECT current_database() INTO :dbname; @@ -1061,6 +1076,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO testdb; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; in = PGTYPESinterval_new(); EXEC SQL SELECT '1 min'::interval INTO :in; @@ -1115,6 +1131,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO testdb; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; num = PGTYPESnumeric_new(); dec = PGTYPESdecimal_new(); @@ -1189,6 +1206,7 @@ memset(dbid, 0, sizeof(int) * 8); EXEC SQL CONNECT TO testdb; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; /* Retrieve multiple rows into arrays at once. */ EXEC SQL SELECT oid,datname INTO :dbid, :dbname FROM pg_database; @@ -1628,7 +1646,7 @@ Here is an example using the data type complex from the example in . The external string - representation of that type is (%lf,%lf), + representation of that type is (%f,%f), which is defined in the functions complex_in() and complex_out() functions @@ -1855,6 +1873,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO testdb AS con1 USER testuser; +EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL PREPARE stmt1 FROM :stmt; @@ -1900,11 +1919,23 @@ PGTYPEStimestamp_add_interval(&ts1, &iv1, &tsout); out = PGTYPEStimestamp_to_asc(&tsout); printf("Started + duration: %s\n", out); -free(out); +PGTYPESchar_free(out); ]]> + + Character Strings + + Some functions such as PGTYPESnumeric_to_asc return + a pointer to a freshly allocated character string. These results should be + freed with PGTYPESchar_free instead of + free. (This is important only on Windows, where + memory allocation and release sometimes need to be done by the same + library.) + + + The numeric Type @@ -1978,6 +2009,7 @@ The numeric value will be printed with dscale decimal digits, with rounding applied if necessary. + The result must be freed with PGTYPESchar_free(). @@ -2365,9 +2397,10 @@ char *PGTYPESdate_to_asc(date dDate); - The function receives the date dDate as its only parameter. - It will output the date in the form 1999-01-18, i.e., in the - YYYY-MM-DD format. + The function receives the date dDate as its only parameter. + It will output the date in the form 1999-01-18, i.e., in the + YYYY-MM-DD format. + The result must be freed with PGTYPESchar_free(). @@ -2790,6 +2823,7 @@ The function receives the timestamp tstamp as its only argument and returns an allocated string that contains the textual representation of the timestamp. + The result must be freed with PGTYPESchar_free(). @@ -3298,6 +3332,7 @@ The function converts the interval variable that span points to into a C char*. The output looks like this example: @ 1 day 12 hours 59 mins 10 secs. + The result must be freed with PGTYPESchar_free(). @@ -4285,6 +4320,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO testdb AS con1 USER testuser; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL PREPARE stmt1 FROM :query; EXEC SQL DECLARE cur1 CURSOR FOR stmt1; @@ -4446,6 +4482,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO uptimedb AS con1 USER uptime; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL PREPARE stmt1 FROM :query; EXEC SQL DECLARE cur1 CURSOR FOR stmt1; @@ -5867,6 +5904,7 @@ memset(buf, 1, buflen); EXEC SQL CONNECT TO testdb AS con1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; conn = ECPGget_PGconn("con1"); printf("conn = %p\n", conn); @@ -5996,6 +6034,7 @@ TestCpp::TestCpp() { EXEC SQL CONNECT TO testdb1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; } void Test::test() @@ -6075,6 +6114,7 @@ db_connect() { EXEC SQL CONNECT TO testdb1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; } void @@ -6468,12 +6508,14 @@ ECPGdebug(1, stderr); EXEC SQL CONNECT TO :dbname USER :user; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL SELECT version() INTO :ver; EXEC SQL DISCONNECT; printf("version: %s\n", ver); EXEC SQL CONNECT TO :connection USER :user; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL SELECT version() INTO :ver; EXEC SQL DISCONNECT; @@ -7074,6 +7116,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO testdb AS con1 USER testuser; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL ALLOCATE DESCRIPTOR d; /* Declare, open a cursor, and assign a descriptor to the cursor */ @@ -7631,6 +7674,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO testdb AS con1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL SELECT current_database(), 256 INTO :t:t_ind LIMIT 1; @@ -7786,6 +7830,7 @@ main(void) { EXEC SQL CONNECT TO testdb AS con1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; EXEC SQL ALLOCATE DESCRIPTOR d; EXEC SQL DECLARE cur CURSOR FOR SELECT current_database(), 'hoge', 256; EXEC SQL OPEN cur; diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/extend.sgml postgresql-9.5-9.5.14/doc/src/sgml/extend.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/extend.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/extend.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -367,6 +367,32 @@ schema(s) its member objects are within. + + Defining Extension Objects + + + + Widely-distributed extensions should assume little about the database + they occupy. In particular, unless you issued SET search_path = + pg_temp, assume each unqualified name could resolve to an + object that a malicious user has defined. Beware of constructs that + depend on search_path implicitly: IN + and CASE expression WHEN + always select an operator using the search path. In their place, use + OPERATOR(schema.=) ANY + and CASE WHEN expression. + + + + Extension Files @@ -860,22 +886,21 @@ CREATE TYPE pair AS ( k text, v text ); -CREATE OR REPLACE FUNCTION pair(anyelement, text) -RETURNS pair LANGUAGE SQL AS 'SELECT ROW($1, $2)::pair'; - -CREATE OR REPLACE FUNCTION pair(text, anyelement) -RETURNS pair LANGUAGE SQL AS 'SELECT ROW($1, $2)::pair'; - -CREATE OR REPLACE FUNCTION pair(anyelement, anyelement) -RETURNS pair LANGUAGE SQL AS 'SELECT ROW($1, $2)::pair'; - CREATE OR REPLACE FUNCTION pair(text, text) -RETURNS pair LANGUAGE SQL AS 'SELECT ROW($1, $2)::pair;'; +RETURNS pair LANGUAGE SQL AS 'SELECT ROW($1, $2)::@extschema@.pair;'; -CREATE OPERATOR ~> (LEFTARG = text, RIGHTARG = anyelement, PROCEDURE = pair); -CREATE OPERATOR ~> (LEFTARG = anyelement, RIGHTARG = text, PROCEDURE = pair); -CREATE OPERATOR ~> (LEFTARG = anyelement, RIGHTARG = anyelement, PROCEDURE = pair); CREATE OPERATOR ~> (LEFTARG = text, RIGHTARG = text, PROCEDURE = pair); + +-- "SET search_path" is easy to get right, but qualified names perform better. +CREATE OR REPLACE FUNCTION lower(pair) +RETURNS pair LANGUAGE SQL +AS 'SELECT ROW(lower($1.k), lower($1.v))::@extschema@.pair;' +SET search_path = pg_temp; + +CREATE OR REPLACE FUNCTION pair_concat(pair, pair) +RETURNS pair LANGUAGE SQL +AS 'SELECT ROW($1.k OPERATOR(pg_catalog.||) $2.k, + $1.v OPERATOR(pg_catalog.||) $2.v)::@extschema@.pair;'; ]]> @@ -887,7 +912,7 @@ # pair extension comment = 'A key/value pair data type' default_version = '1.0' -relocatable = true +relocatable = false diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/external-projects.sgml postgresql-9.5-9.5.14/doc/src/sgml/external-projects.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/external-projects.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/external-projects.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -65,7 +65,7 @@ DBD::Pg Perl Perl DBI driver - + @@ -78,7 +78,7 @@ libpqxx C++ - New-style C++ interface + C++ interface @@ -146,7 +146,7 @@ There are several administration tools available for PostgreSQL. The most popular is - pgAdmin III, + pgAdmin, and there are several commercially available ones as well. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/fdwhandler.sgml postgresql-9.5-9.5.14/doc/src/sgml/fdwhandler.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/fdwhandler.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/fdwhandler.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -382,11 +382,14 @@ wholerow, or wholerowN, as the core system can generate junk columns of these names. + If the extra expressions are more complex than simple Vars, they + must be run through eval_const_expressions + before adding them to the targetlist. - This function is called in the rewriter, not the planner, so the - information available is a bit different from that available to the + Although this function is called during planning, the + information provided is a bit different from that available to other planning routines. parsetree is the parse tree for the UPDATE or DELETE command, while target_rte and diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/func.sgml postgresql-9.5-9.5.14/doc/src/sgml/func.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/func.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/func.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -9756,6 +9756,24 @@ + + <literal>IS NOT DOCUMENT</literal> + + + IS NOT DOCUMENT + + + +xml IS NOT DOCUMENT + + + + The expression IS NOT DOCUMENT returns false if the + argument XML value is a proper XML document, true if it is not (that is, + it is a content fragment), or null if the argument is null. + + + <literal>XMLEXISTS</literal> @@ -11000,14 +11018,28 @@ - In json_populate_record, json_populate_recordset, - json_to_record and json_to_recordset, - type coercion from the JSON is best effort and may not result - in desired values for some types. JSON keys are matched to - identical column names in the target row type. JSON fields that do not - appear in the target row type will be omitted from the output, and - target columns that do not match any JSON field will simply be NULL. + While the examples for the functions + json_populate_record, + json_populate_recordset, + json_to_record and + json_to_recordset use constants, the typical use + would be to reference a table in the FROM clause + and use one of its json or jsonb columns + as an argument to the function. Extracted key values can then be + referenced in other parts of the query, like WHERE + clauses and target lists. Extracting multiple values in this + way can improve performance over extracting them separately with + per-key operators. + + + JSON keys are matched to identical column names in the target + row type. JSON type coercion for these functions is best + effort and may not result in desired values for some types. + JSON fields that do not appear in the target row type will be + omitted from the output, and target columns that do not match any + JSON field will simply be NULL. + @@ -11815,7 +11847,7 @@ - array_fill(anyelement, int[], + array_fill(anyelement, int[] , int[]) diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/high-availability.sgml postgresql-9.5-9.5.14/doc/src/sgml/high-availability.sgml --- postgresql-9.5-9.5.10/doc/src/sgml/high-availability.sgml 2017-11-06 22:11:00.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/high-availability.sgml 2018-08-06 20:09:28.000000000 +0000 @@ -861,7 +861,7 @@ You can retrieve a list of WAL sender processes via the - + pg_stat_replication view. Large differences between pg_current_xlog_location and sent_location field might indicate that the master server is under heavy load, while @@ -931,10 +931,10 @@ -------------+--------------- node_a_slot | -postgres=# SELECT * FROM pg_replication_slots; - slot_name | slot_type | datoid | database | active | xmin | restart_lsn --------------+-----------+--------+----------+--------+------+------------- - node_a_slot | physical | | | f | | +postgres=# SELECT slot_name, slot_type, active FROM pg_replication_slots; + slot_name | slot_type | active +-------------+-----------+-------- + node_a_slot | physical | f (1 row) To configure the standby to use this slot, primary_slot_name @@ -1383,7 +1383,7 @@ processing would request a file from the WAL archive, reporting failure if the file was unavailable. For standby processing it is normal for the next WAL file to be unavailable, so the standby must wait for - it to appear. For files ending in .backup or + it to appear. For files ending in .history there is no need to wait, and a non-zero return code must be returned. A waiting restore_command can be written as a custom script that loops after polling for the existence of diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/acronyms.html postgresql-9.5-9.5.14/doc/src/sgml/html/acronyms.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/acronyms.html 2017-11-06 22:32:44.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/acronyms.html 2018-08-06 20:30:51.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Comprehensive Perl Archive Network diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/admin.html postgresql-9.5-9.5.14/doc/src/sgml/html/admin.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/admin.html 2017-11-06 22:31:33.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/admin.html 2018-08-06 20:29:37.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

This part covers topics that are of interest to a @@ -475,7 +475,7 @@ >

20.5. Function and Trigger SecurityFunction Security
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Options

Notes

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
E.1. Release 9.5.14
E.2. Release 9.5.13
E.3. Release 9.5.12
E.4. Release 9.5.11
E.5. Release 9.5.10
E.2. E.6. Release 9.5.9
E.3. E.7. Release 9.5.8
E.4. E.8. Release 9.5.7
E.5. E.9. Release 9.5.6
E.6. E.10. Release 9.5.5
E.7. E.11. Release 9.5.4
E.8. E.12. Release 9.5.3
E.9. E.13. Release 9.5.2
E.10. E.14. Release 9.5.1
E.11. E.15. Release 9.5
E.12. E.16. Release 9.4.19
E.17. Release 9.4.18
E.18. Release 9.4.17
E.19. Release 9.4.16
E.20. Release 9.4.15
E.13. E.21. Release 9.4.14
E.14. E.22. Release 9.4.13
E.15. E.23. Release 9.4.12
E.16. E.24. Release 9.4.11
E.17. E.25. Release 9.4.10
E.18. E.26. Release 9.4.9
E.19. E.27. Release 9.4.8
E.20. E.28. Release 9.4.7
E.21. E.29. Release 9.4.6
E.22. E.30. Release 9.4.5
E.23. E.31. Release 9.4.4
E.24. E.32. Release 9.4.3
E.25. E.33. Release 9.4.2
E.26. E.34. Release 9.4.1
E.27. E.35. Release 9.4
E.28. E.36. Release 9.3.24
E.37. Release 9.3.23
E.38. Release 9.3.22
E.39. Release 9.3.21
E.40. Release 9.3.20
E.29. E.41. Release 9.3.19
E.30. E.42. Release 9.3.18
E.31. E.43. Release 9.3.17
E.32. E.44. Release 9.3.16
E.33. E.45. Release 9.3.15
E.34. E.46. Release 9.3.14
E.35. E.47. Release 9.3.13
E.36. E.48. Release 9.3.12
E.37. E.49. Release 9.3.11
E.38. E.50. Release 9.3.10
E.39. E.51. Release 9.3.9
E.40. E.52. Release 9.3.8
E.41. E.53. Release 9.3.7
E.42. E.54. Release 9.3.6
E.43. E.55. Release 9.3.5
E.44. E.56. Release 9.3.4
E.45. E.57. Release 9.3.3
E.46. E.58. Release 9.3.2
E.47. E.59. Release 9.3.1
E.48. E.60. Release 9.3
E.49. E.61. Release 9.2.24
E.50. E.62. Release 9.2.23
E.51. E.63. Release 9.2.22
E.52. E.64. Release 9.2.21
E.53. E.65. Release 9.2.20
E.54. E.66. Release 9.2.19
E.55. E.67. Release 9.2.18
E.56. E.68. Release 9.2.17
E.57. E.69. Release 9.2.16
E.58. E.70. Release 9.2.15
E.59. E.71. Release 9.2.14
E.60. E.72. Release 9.2.13
E.61. E.73. Release 9.2.12
E.62. E.74. Release 9.2.11
E.63. E.75. Release 9.2.10
E.64. E.76. Release 9.2.9
E.65. E.77. Release 9.2.8
E.66. E.78. Release 9.2.7
E.67. E.79. Release 9.2.6
E.68. E.80. Release 9.2.5
E.69. E.81. Release 9.2.4
E.70. E.82. Release 9.2.3
E.71. E.83. Release 9.2.2
E.72. E.84. Release 9.2.1
E.73. E.85. Release 9.2
E.74. E.86. Release 9.1.24
E.75. E.87. Release 9.1.23
E.76. E.88. Release 9.1.22
E.77. E.89. Release 9.1.21
E.78. E.90. Release 9.1.20
E.79. E.91. Release 9.1.19
E.80. E.92. Release 9.1.18
E.81. E.93. Release 9.1.17
E.82. E.94. Release 9.1.16
E.83. E.95. Release 9.1.15
E.84. E.96. Release 9.1.14
E.85. E.97. Release 9.1.13
E.86. E.98. Release 9.1.12
E.87. E.99. Release 9.1.11
E.88. E.100. Release 9.1.10
E.89. E.101. Release 9.1.9
E.90. E.102. Release 9.1.8
E.91. E.103. Release 9.1.7
E.92. E.104. Release 9.1.6
E.93. E.105. Release 9.1.5
E.94. E.106. Release 9.1.4
E.95. E.107. Release 9.1.3
E.96. E.108. Release 9.1.2
E.97. E.109. Release 9.1.1
E.98. E.110. Release 9.1
E.99. E.111. Release 9.0.23
E.100. E.112. Release 9.0.22
E.101. E.113. Release 9.0.21
E.102. E.114. Release 9.0.20
E.103. E.115. Release 9.0.19
E.104. E.116. Release 9.0.18
E.105. E.117. Release 9.0.17
E.106. E.118. Release 9.0.16
E.107. E.119. Release 9.0.15
E.108. E.120. Release 9.0.14
E.109. E.121. Release 9.0.13
E.110. E.122. Release 9.0.12
E.111. E.123. Release 9.0.11
E.112. E.124. Release 9.0.10
E.113. E.125. Release 9.0.9
E.114. E.126. Release 9.0.8
E.115. E.127. Release 9.0.7
E.116. E.128. Release 9.0.6
E.117. E.129. Release 9.0.5
E.118. E.130. Release 9.0.4
E.119. E.131. Release 9.0.3
E.120. E.132. Release 9.0.2
E.121. E.133. Release 9.0.1
E.122. E.134. Release 9.0
E.123. E.135. Release 8.4.22
E.124. E.136. Release 8.4.21
E.125. E.137. Release 8.4.20
E.126. E.138. Release 8.4.19
E.127. E.139. Release 8.4.18
E.128. E.140. Release 8.4.17
E.129. E.141. Release 8.4.16
E.130. E.142. Release 8.4.15
E.131. E.143. Release 8.4.14
E.132. E.144. Release 8.4.13
E.133. E.145. Release 8.4.12
E.134. E.146. Release 8.4.11
E.135. E.147. Release 8.4.10
E.136. E.148. Release 8.4.9
E.137. E.149. Release 8.4.8
E.138. E.150. Release 8.4.7
E.139. E.151. Release 8.4.6
E.140. E.152. Release 8.4.5
E.141. E.153. Release 8.4.4
E.142. E.154. Release 8.4.3
E.143. E.155. Release 8.4.2
E.144. E.156. Release 8.4.1
E.145. E.157. Release 8.4
E.146. E.158. Release 8.3.23
E.147. E.159. Release 8.3.22
E.148. E.160. Release 8.3.21
E.149. E.161. Release 8.3.20
E.150. E.162. Release 8.3.19
E.151. E.163. Release 8.3.18
E.152. E.164. Release 8.3.17
E.153. E.165. Release 8.3.16
E.154. E.166. Release 8.3.15
E.155. E.167. Release 8.3.14
E.156. E.168. Release 8.3.13
E.157. E.169. Release 8.3.12
E.158. E.170. Release 8.3.11
E.159. E.171. Release 8.3.10
E.160. E.172. Release 8.3.9
E.161. E.173. Release 8.3.8
E.162. E.174. Release 8.3.7
E.163. E.175. Release 8.3.6
E.164. E.176. Release 8.3.5
E.165. E.177. Release 8.3.4
E.166. E.178. Release 8.3.3
E.167. E.179. Release 8.3.2
E.168. E.180. Release 8.3.1
E.169. E.181. Release 8.3
E.170. E.182. Release 8.2.23
E.171. E.183. Release 8.2.22
E.172. E.184. Release 8.2.21
E.173. E.185. Release 8.2.20
E.174. E.186. Release 8.2.19
E.175. E.187. Release 8.2.18
E.176. E.188. Release 8.2.17
E.177. E.189. Release 8.2.16
E.178. E.190. Release 8.2.15
E.179. E.191. Release 8.2.14
E.180. E.192. Release 8.2.13
E.181. E.193. Release 8.2.12
E.182. E.194. Release 8.2.11
E.183. E.195. Release 8.2.10
E.184. E.196. Release 8.2.9
E.185. E.197. Release 8.2.8
E.186. E.198. Release 8.2.7
E.187. E.199. Release 8.2.6
E.188. E.200. Release 8.2.5
E.189. E.201. Release 8.2.4
E.190. E.202. Release 8.2.3
E.191. E.203. Release 8.2.2
E.192. E.204. Release 8.2.1
E.193. E.205. Release 8.2
E.194. E.206. Release 8.1.23
E.195. E.207. Release 8.1.22
E.196. E.208. Release 8.1.21
E.197. E.209. Release 8.1.20
E.198. E.210. Release 8.1.19
E.199. E.211. Release 8.1.18
E.200. E.212. Release 8.1.17
E.201. E.213. Release 8.1.16
E.202. E.214. Release 8.1.15
E.203. E.215. Release 8.1.14
E.204. E.216. Release 8.1.13
E.205. E.217. Release 8.1.12
E.206. E.218. Release 8.1.11
E.207. E.219. Release 8.1.10
E.208. E.220. Release 8.1.9
E.209. E.221. Release 8.1.8
E.210. E.222. Release 8.1.7
E.211. E.223. Release 8.1.6
E.212. E.224. Release 8.1.5
E.213. E.225. Release 8.1.4
E.214. E.226. Release 8.1.3
E.215. E.227. Release 8.1.2
E.216. E.228. Release 8.1.1
E.217. E.229. Release 8.1
E.218. E.230. Release 8.0.26
E.219. E.231. Release 8.0.25
E.220. E.232. Release 8.0.24
E.221. E.233. Release 8.0.23
E.222. E.234. Release 8.0.22
E.223. E.235. Release 8.0.21
E.224. E.236. Release 8.0.20
E.225. E.237. Release 8.0.19
E.226. E.238. Release 8.0.18
E.227. E.239. Release 8.0.17
E.228. E.240. Release 8.0.16
E.229. E.241. Release 8.0.15
E.230. E.242. Release 8.0.14
E.231. E.243. Release 8.0.13
E.232. E.244. Release 8.0.12
E.233. E.245. Release 8.0.11
E.234. E.246. Release 8.0.10
E.235. E.247. Release 8.0.9
E.236. E.248. Release 8.0.8
E.237. E.249. Release 8.0.7
E.238. E.250. Release 8.0.6
E.239. E.251. Release 8.0.5
E.240. E.252. Release 8.0.4
E.241. E.253. Release 8.0.3
E.242. E.254. Release 8.0.2
E.243. E.255. Release 8.0.1
E.244. E.256. Release 8.0
E.245. E.257. Release 7.4.30
E.246. E.258. Release 7.4.29
E.247. E.259. Release 7.4.28
E.248. E.260. Release 7.4.27
E.249. E.261. Release 7.4.26
E.250. E.262. Release 7.4.25
E.251. E.263. Release 7.4.24
E.252. E.264. Release 7.4.23
E.253. E.265. Release 7.4.22
E.254. E.266. Release 7.4.21
E.255. E.267. Release 7.4.20
E.256. E.268. Release 7.4.19
E.257. E.269. Release 7.4.18
E.258. E.270. Release 7.4.17
E.259. E.271. Release 7.4.16
E.260. E.272. Release 7.4.15
E.261. E.273. Release 7.4.14
E.262. E.274. Release 7.4.13
E.263. E.275. Release 7.4.12
E.264. E.276. Release 7.4.11
E.265. E.277. Release 7.4.10
E.266. E.278. Release 7.4.9
E.267. E.279. Release 7.4.8
E.268. E.280. Release 7.4.7
E.269. E.281. Release 7.4.6
E.270. E.282. Release 7.4.5
E.271. E.283. Release 7.4.4
E.272. E.284. Release 7.4.3
E.273. E.285. Release 7.4.2
E.274. E.286. Release 7.4.1
E.275. E.287. Release 7.4
E.276. E.288. Release 7.3.21
E.277. E.289. Release 7.3.20
E.278. E.290. Release 7.3.19
E.279. E.291. Release 7.3.18
E.280. E.292. Release 7.3.17
E.281. E.293. Release 7.3.16
E.282. E.294. Release 7.3.15
E.283. E.295. Release 7.3.14
E.284. E.296. Release 7.3.13
E.285. E.297. Release 7.3.12
E.286. E.298. Release 7.3.11
E.287. E.299. Release 7.3.10
E.288. E.300. Release 7.3.9
E.289. E.301. Release 7.3.8
E.290. E.302. Release 7.3.7
E.291. E.303. Release 7.3.6
E.292. E.304. Release 7.3.5
E.293. E.305. Release 7.3.4
E.294. E.306. Release 7.3.3
E.295. E.307. Release 7.3.2
E.296. E.308. Release 7.3.1
E.297. E.309. Release 7.3
E.298. E.310. Release 7.2.8
E.299. E.311. Release 7.2.7
E.300. E.312. Release 7.2.6
E.301. E.313. Release 7.2.5
E.302. E.314. Release 7.2.4
E.303. E.315. Release 7.2.3
E.304. E.316. Release 7.2.2
E.305. E.317. Release 7.2.1
E.306. E.318. Release 7.2
E.307. E.319. Release 7.1.3
E.308. E.320. Release 7.1.2
E.309. E.321. Release 7.1.1
E.310. E.322. Release 7.1
E.311. E.323. Release 7.0.3
E.312. E.324. Release 7.0.2
E.313. E.325. Release 7.0.1
E.314. E.326. Release 7.0
E.315. E.327. Release 6.5.3
E.316. E.328. Release 6.5.2
E.317. E.329. Release 6.5.1
E.318. E.330. Release 6.5
E.319. E.331. Release 6.4.2
E.320. E.332. Release 6.4.1
E.321. E.333. Release 6.4
E.322. E.334. Release 6.3.2
E.323. E.335. Release 6.3.1
E.324. E.336. Release 6.3
E.325. E.337. Release 6.2.1
E.326. E.338. Release 6.2
E.327. E.339. Release 6.1.1
E.328. E.340. Release 6.1
E.329. E.341. Release 6.0
E.330. E.342. Release 1.09
E.331. E.343. Release 1.02
E.332. E.344. Release 1.01
E.333. E.345. Release 1.0
E.334. E.346. Release 0.03
E.335. E.347. Release 0.02
E.336. E.348.
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Options

Environment

Notes

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description @@ -270,7 +270,7 @@ >

Options

Environment

Notes

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Notes

Example

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Environment

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Environment

Files

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Options

Environment

Notes

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Environment

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Exit Status

Environment

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description @@ -220,7 +220,7 @@ >

Options

Environment

Notes

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Notes

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Environment

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

must also be enabled. That is the default.

Warning

If pg_rewind fails while processing, then + the data folder of the target is likely not in a state that can be + recovered. In such a case, taking a new fresh backup is recommended. +

pg_rewind will fail immediately if it finds + files it cannot write directly to. This can happen for example when + the source and the target server use the same file mapping for read-only + SSL keys and certificates. If such files are present on the target server + it is recommended to remove them before running + pg_rewind. After doing the rewind, some of + those files may have been copied from the source, in which case it may + be necessary to remove the data copied and restore back the set of links + used before the rewind. +

Options

Environment

Notes

How it works

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

General Purpose

Semi-internal Options

Options for Single-User Mode

Environment

Diagnostics

Notes

Usage

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Exit Status

Usage

psql testdb -psql (9.5.10) +psql (9.5.14) Type "help" for help. testdb=>

If untrusted users have access to a database that has not adopted a + secure schema usage pattern, + begin your session by removing publicly-writable schemas + from search_path. One can + add options=-csearch_path= to the connection string or + issue SELECT pg_catalog.set_config('search_path', '', + false) before other SQL commands. This consideration is not + specific to psql; it applies to every interface + for executing arbitrary SQL commands. +

Whenever a command is executed, psql\C, \H\f, \H, \t, \T, and , + and \x. @@ -6054,7 +6084,7 @@ >

Advanced Features

Command-Line Editing

Files

Notes

Notes for Windows Users

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.2.1. Configuration Parameters

F.2.2. Author

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Users sometimes wonder why host names are handled diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/auth-username-maps.html postgresql-9.5-9.5.14/doc/src/sgml/html/auth-username-maps.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/auth-username-maps.html 2017-11-06 22:31:31.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/auth-username-maps.html 2018-08-06 20:29:34.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.3.1. Configuration Parameters

F.3.2. Example

F.3.3. Author

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
> outfiledumpfile

@@ -308,14 +308,14 @@ > < infiledumpfile

where infiledumpfile is the file output by the

psql --set ON_ERROR_STOP=on dbname < infile
psql --set ON_ERROR_STOP=on dbname < dumpfile

Either way, you will only have a partially restored database. Alternatively, you can specify that the whole dump should be @@ -545,7 +555,7 @@ >pg_dumpall > outfiledumpfile

@@ -558,7 +568,7 @@ >psql -f infiledumpfile postgres

diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/backup-file.html postgresql-9.5-9.5.14/doc/src/sgml/html/backup-file.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/backup-file.html 2017-11-06 22:31:31.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/backup-file.html 2018-08-06 20:29:35.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

SQL

PostgreSQL-specific Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Symbols

A

akeys, hstore Operators and Functions
armor, armor(), dearmor()
Aggregate Functions, Functions
auth_delay.milliseconds configuration parameter, Configuration Parameters
auto_explain.log_analyze configuration parameter, Configuration Parameters
auto_explain.log_buffers configuration parameter, Configuration Parameters
auto_explain.log_format configuration parameter, Configuration Parameters
auto_explain.log_min_duration configuration parameter, Configuration Parameters
auto_explain.log_nested_statements configuration parameter, Configuration Parameters
auto_explain.log_timing configuration parameter, Configuration Parameters
auto_explain.log_triggers configuration parameter, Configuration Parameters
auto_explain.log_verbose configuration parameter, Configuration Parameters
avals, hstore Operators and Functions

B

box (data type), Boxes
brin_metapage_info, Functions
brin_page_items, Functions
brin_page_type, Functions
brin_revmap_data, Functions
bt_metap, Functions
bt_page_items, Functions
bt_page_stats, Functions

C

cluster_name configuration parameter, Process Title
in SQL functions, SQL Functions with Collations
renaming, Renaming a Column
changing, Changing a Column's Data Type
constant, Constructing Composite Values
connectby, Functions Provided, connectby
NOT NULL, Not-Null Constraints
in PL/pgSQL, CONTINUE
control file, Extension Files
crosstab, crosstab(text), crosstabN(text), crosstab(text, text)
crypt, crypt()
System Columns, View Rules in Non-SELECT Statements

D

Date/Time Types, Dates
constants, Special Values
dearmor, armor(), dearmor()
decrypt, Raw Encryption Functions
decrypt_iv, Raw Encryption Functions
changing, Changing a Column's Default Value
defined, hstore Operators and Functions
DELETE, hstore Operators and Functions
difference, Soundex
digest, digest()
dmetaphone, Double Metaphone
dmetaphone_alt, Double Metaphone
DTD, Creating XML Values

E

each, hstore Operators and Functions
earth, Cube-based Earth Distances
earth_box, Cube-based Earth Distances
earth_distance, Cube-based Earth Distances
encrypt, Raw Encryption Functions
encrypt_iv, Raw Encryption Functions
exist, hstore Operators and Functions
in PL/pgSQL, EXIT

F

fsm_page_contents, Functions

G

gc_to_sec, Cube-based Earth Distances
gen_random_bytes, Random-Data Functions
gen_random_uuid, Random-Data Functions
gen_salt, gen_salt()
get_raw_page, Functions
gin_leafpage_items, Functions
gin_metapage_info, Functions
gin_page_opaque_info, Functions

H

heap_page_items, Functions
hmac, hmac()
hstore, hstore Operators and Functions
hstore_to_array, hstore Operators and Functions
hstore_to_json, hstore Operators and Functions
hstore_to_jsonb, hstore Operators and Functions
hstore_to_jsonb_loose, hstore Operators and Functions
hstore_to_json_loose, hstore Operators and Functions
hstore_to_matrix, hstore Operators and Functions

I

icount, intarray Functions and Operators
idx, intarray Functions and Operators
Indexes, Operators and Functions
intset, intarray Functions and Operators
int_array_aggregate, Functions
int_array_enum, Functions
IS DOCUMENT, IS DOCUMENT
IS NOT DOCUMENT, + IS NOT DOCUMENT +
IS NOT FALSE,
isn_weak, Functions and Operators
is_valid, Functions and Operators

J

K

L

latitude, Cube-based Earth Distances
lca, Operators and Functions
ldconfig, Shared Libraries
levenshtein, Levenshtein
levenshtein_less_equal, Levenshtein
and locales, Behavior
ll_to_earth, Cube-based Earth Distances
Logical Decoding, Logical Decoding
longitude, Cube-based Earth Distances
and locales, Behavior
ltree2text, Operators and Functions

M

make_valid, Functions and Operators
MANPATH, Environment Variables
metaphone, Metaphone

N

nlevel, Operators and Functions
normal_rand, normal_rand
not-null constraint, Not-Null Constraints
in PL/Python, Null, None

O

and locales, Behavior

P

page_header, Functions
palloc, Writing Code
Geometric Functions and Operators, Environment Variables
path (data type), Paths
pfree, Writing Code
pgp_armor_headers, pgp_armor_headers
pgp_key_id, pgp_key_id()
pgp_pub_decrypt, pgp_pub_decrypt()
pgp_pub_decrypt_bytea, pgp_pub_decrypt()
pgp_pub_encrypt, pgp_pub_encrypt()
pgp_pub_encrypt_bytea, pgp_pub_encrypt()
pgp_sym_decrypt, pgp_sym_decrypt()
pgp_sym_decrypt_bytea, pgp_sym_decrypt()
pgp_sym_encrypt, pgp_sym_encrypt()
pgp_sym_encrypt_bytea, pgp_sym_encrypt()
pgrowlocks, Overview
pgstatginindex, Functions
pgstatindex, Functions
pgstattuple, Functions
pgstattuple_approx, Functions
with user-defined C functions, Writing Code
pg_extension_config_dump, Extension Configuration Tables
pg_freespace, Functions
pg_notify, pg_notify
pg_relpages, Functions
function, Functions
pg_stat_statements_reset, Functions
point, Points,
populate_record, hstore Operators and Functions
in PL/Python, Database Access Functions

Q

R

rectangle, Boxes
and locales, Behavior
in PL/pgSQL, RETURN NEXT and RETURN QUERY
in PL/pgSQL, RETURN NEXT and RETURN QUERY

S

sec_to_gc, Cube-based Earth Distances
set_limit, Functions and Operators
shared library, Shared Libraries,
shared_preload_libraries, Shared Memory and LWLocks
show_limit, Functions and Operators
show_trgm, Functions and Operators
similarity, Functions and Operators
single-user mode, Options for Single-User Mode
skeys, hstore Operators and Functions
slice, hstore Operators and Functions
sort, intarray Functions and Operators
sort_asc, intarray Functions and Operators
sort_desc, intarray Functions and Operators
soundex, Soundex
ssl_cipher, Functions Provided
ssl_client_cert_present, Functions Provided
ssl_client_dn, Functions Provided
ssl_client_dn_field, Functions Provided
ssl_client_serial, Functions Provided
ssl_issuer_dn, Functions Provided
ssl_issuer_field, Functions Provided
ssl_is_used, Functions Provided
ssl_version, Functions Provided
subarray, intarray Functions and Operators
subltree, Operators and Functions
subpath, Operators and Functions
svals, hstore Operators and Functions
systemd +
RemoveIPC, + systemd RemoveIPC +

T

renaming, Renaming a Table
text2ltree, Operators and Functions
Date/Time Types, Times
constants, Special Values
Date/Time Types, Times Date/Time Types, Times Date/Time Types, Time Stamps Date/Time Types, Time Stamps Date/Time Types, Time Stamps
per-column storage settings, Description
and locales, Behavior

U

unaccent, Functions
uniq, intarray Functions and Operators
update_process_title configuration parameter, Process Title
and locales, Behavior
uuid_generate_v1, uuid-ossp Functions
uuid_generate_v1mc, uuid-ossp Functions
uuid_generate_v3, uuid-ossp Functions

V

W

in PL/pgSQL, WHILE

X

XML option, Creating XML Values,
xmlcomment, xmlcomment
xmlconcat, xmlconcat
xmlelement, xmlelement
xmlforest, xmlforest
xmlparse, Creating XML Values
xmlpi, xmlpi
xmlroot, xmlroot
xmlserialize, Creating XML Values
xpath_table, xpath_table
xslt_process, xslt_process

Y

Z

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.4.1. Example Usage

F.4.2. Authors

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.5.1. Example Usage

F.5.2. Authors

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

If your version is older than 9.5.10 we will almost certainly +> If your version is older than 9.5.14 we will almost certainly tell you to upgrade. There are many bug fixes and improvements in each new release, so it is quite possible that a bug you have encountered in an older release of

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
22.1.1. Overview
22.1.2. Behavior
22.1.3. Problems
22.2.1. Concepts
22.2.2. Managing Collations
22.3.2. Setting the Character Set
22.3.3. Automatic Character Set Conversion Between Server and Client
22.3.4. Further Reading
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.6.1. Author

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.7.1. Rationale

F.7.2. How to Use It

F.7.3. String Comparison Behavior

F.7.4. Limitations

F.7.5. Author

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

This part describes the client programming interfaces distributed diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/collation.html postgresql-9.5-9.5.14/doc/src/sgml/html/collation.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/collation.html 2017-11-06 22:31:31.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/collation.html 2018-08-06 20:29:35.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

22.2.1. Concepts

22.2.2. Managing Collations

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

18.1.4. Parameter Interaction via the Shell

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
.backup or .history. Also be aware that the base name of the
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

SELECT dblink_connect('dbname=postgres');
+>SELECT dblink_connect('dbname=postgres options=-csearch_path=');
  dblink_connect
 ----------------
  OK
diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-connect.html postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-connect.html
--- postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-connect.html	2017-11-06 22:32:39.000000000 +0000
+++ postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-connect.html	2018-08-06 20:30:47.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres - password=mypasswd
. For details see

Return Value

Notes

If untrusted users have access to a database that has not adopted a + secure schema usage pattern, + begin each session by removing publicly-writable schemas from + search_path. One could, for example, + add options=-csearch_path= to + connstr. This consideration is not specific + to dblink; it applies to every interface for + executing arbitrary SQL commands. +

Only superusers may use dblink_connect

Examples

SELECT dblink_connect('dbname=postgres');
+>SELECT dblink_connect('dbname=postgres options=-csearch_path=');
  dblink_connect
 ----------------
  OK
 (1 row)
 
-SELECT dblink_connect('myconn', 'dbname=postgres');
+SELECT dblink_connect('myconn', 'dbname=postgres options=-csearch_path=');
  dblink_connect
 ----------------
  OK
diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-connect-u.html postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-connect-u.html
--- postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-connect-u.html	2017-11-06 22:32:39.000000000 +0000
+++ postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-connect-u.html	2018-08-06 20:30:47.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

SELECT dblink_connect('dbname=postgres');
+>SELECT dblink_connect('dbname=postgres options=-csearch_path=');
  dblink_connect
 ----------------
  OK
diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-function.html postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-function.html
--- postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-function.html	2017-11-06 22:32:39.000000000 +0000
+++ postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-function.html	2018-08-06 20:30:47.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

SELECT *
-    FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc')
+    FROM dblink('dbname=mydb options=-csearch_path=',
+                'select proname, prosrc from pg_proc')
       AS t1(proname name, prosrc text)
     WHERE proname LIKE 'bytea%';

@@ -290,7 +291,7 @@ >

Notes

CREATE VIEW myremote_pg_proc AS SELECT * - FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc') + FROM dblink('dbname=postgres options=-csearch_path=', + 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text); SELECT * FROM myremote_pg_proc WHERE proname LIKE 'bytea%';

Examples

SELECT * FROM dblink('dbname=postgres', 'select proname, prosrc from pg_proc')
+>SELECT * FROM dblink('dbname=postgres options=-csearch_path=',
+                     'select proname, prosrc from pg_proc')
   AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%';
   proname   |   prosrc
 ------------+------------
@@ -340,7 +343,7 @@
  byteaout   | byteaout
 (12 rows)
 
-SELECT dblink_connect('dbname=postgres');
+SELECT dblink_connect('dbname=postgres options=-csearch_path=');
  dblink_connect
 ----------------
  OK
@@ -364,7 +367,7 @@
  byteaout   | byteaout
 (12 rows)
 
-SELECT dblink_connect('myconn', 'dbname=regression');
+SELECT dblink_connect('myconn', 'dbname=regression options=-csearch_path=');
  dblink_connect
 ----------------
  OK
diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-get-connections.html postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-get-connections.html
--- postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-get-connections.html	2017-11-06 22:32:39.000000000 +0000
+++ postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-get-connections.html	2018-08-06 20:30:47.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

SELECT dblink_connect('dbname=postgres');
+>SELECT dblink_connect('dbname=postgres options=-csearch_path=');
  dblink_connect
 ----------------
  OK
diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-send-query.html postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-send-query.html
--- postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-dblink-send-query.html	2017-11-06 22:32:39.000000000 +0000
+++ postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-dblink-send-query.html	2018-08-06 20:30:47.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
CREATE EXTENSION command. By default, the objects will be placed in your current creation - target schema, typically public. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-prog-client.html postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-prog-client.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/contrib-prog-client.html 2017-11-06 22:32:43.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/contrib-prog-client.html 2018-08-06 20:30:51.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
spi module provides several workable examples - of using SPI and triggers. While these functions are of some value in + of using the Server Programming Interface + (SPI) and triggers. While these functions are of + some value in their own right, they are even more useful as examples to modify for your own purposes. The functions are general enough to be used with any table, but you have to specify table and field names (as described @@ -115,7 +123,7 @@ >

F.34.1. refint — Functions for Implementing Referential Integrity

F.34.2. timetravel — Functions for Implementing Time Travel

F.34.3. autoinc — Functions for Autoincrementing Fields

F.34.4. insert_username — Functions for Tracking Who Changed a Table

F.34.5. moddatetime — Functions for Tracking Last Modification Time

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.8.1. Syntax

F.8.2. Precision

F.8.3. Usage

F.8.4. Defaults

F.8.5. Notes

F.8.6. Credits

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

8.4.1. bytea

8.4.2. bytea
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

8.5.1.1. Dates

8.5.1.2. Times

8.5.1.3. Time Stamps

8.5.1.4. Special Values

Internally interval values are stored as months, days, - and seconds. This is done because the number of days in a month - varies, and a day can have 23 or 25 hours if a daylight savings - time adjustment is involved. The months and days fields are integers - while the seconds field can store fractions. Because intervals are - usually created from constant strings or timestamp subtraction, - this storage method works well in most cases. Functions - justify_days and justify_hours are - available for adjusting days and hours that overflow their normal - ranges. -

In the verbose input format, and in some fields of the more compact input formats, field values can have fractional parts; for example

Internally interval values are stored as months, days, + and seconds. This is done because the number of days in a month + varies, and a day can have 23 or 25 hours if a daylight savings + time adjustment is involved. The months and days fields are integers + while the seconds field can store fractions. Because intervals are + usually created from constant strings or timestamp subtraction, + this storage method works well in most cases, but can cause unexpected + results: + +

SELECT EXTRACT(hours from '80 minutes'::interval);
+ date_part
+-----------
+         1
+
+SELECT EXTRACT(days from '80 hours'::interval);
+ date_part
+-----------
+         0

+ + Functions justify_days and + justify_hours are available for adjusting days + and hours that overflow their normal ranges. +

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

8.7.1. Declaration of Enumerated Types

8.7.2. Ordering

8.7.3. Type Safety

8.7.4. Implementation Details

Enum labels are case sensitive, so + 'happy' is not the same as 'HAPPY'. + White space in the labels is significant too. +

Although enum types are primarily intended for static sets of values, + there is support for adding new values to an existing enum type, and for + renaming values (see ALTER TYPE). Existing values + cannot be removed from an enum type, nor can the sort ordering of such + values be changed, short of dropping and re-creating the enum type. +

An enum value occupies four bytes on disk. The length of an enum value's textual label is limited by the

Enum labels are case sensitive, so - 'happy' is not the same as 'HAPPY'. - White space in the labels is significant too. -

The translations from internal enum values to textual labels are kept in the system catalog

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

8.8.1. Points

8.8.4. Boxes

8.8.5. Paths

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
8.4.1. bytea
8.4.2. bytea
8.7.1. Declaration of Enumerated Types
8.7.2. Ordering
8.7.3. Type Safety
8.7.4. Implementation Details
8.8.1. Points
8.8.4. Boxes
8.8.5. Paths
8.13.1. Creating XML Values
8.13.2. Encoding Handling
8.13.3. Accessing XML Values
8.16.2. Constructing Composite Values
8.16.4. Modifying Composite Types
varbitvarbit [ (n) ]variable-length bit string
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation[1][1]
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

We use the following terms below: The +> We use the following terms below: the scaleprecision of a numeric is the - count of decimal digits in the fractional part, to the right of - the decimal point. The + is the total count of significant digits in the whole number, + that is, the number of digits to both sides of the decimal point. + The precision of a - scale of a numeric is the total count of significant digits in - the whole number, that is, the number of digits to both sides of - the decimal point. So the number 23.5141 has a precision of 6 - and a scale of 4. Integers can be considered to have a scale of - zero. +> is the + count of decimal digits in the fractional part, to the right of the + decimal point. So the number 23.5141 has a precision of 6 and a + scale of 4. Integers can be considered to have a scale of zero.

Both the maximum precision and the maximum scale of a diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/datatype-oid.html postgresql-9.5-9.5.14/doc/src/sgml/html/datatype-oid.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/datatype-oid.html 2017-11-06 22:31:23.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/datatype-oid.html 2018-08-06 20:29:27.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

8.13.1. Creating XML Values

8.13.2. Encoding Handling

8.13.3. Accessing XML Values

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
5.3.2. Not-Null Constraints
5.5.5. Changing a Column's Default Value
5.5.6. Changing a Column's Data Type
5.5.7. Renaming a Column
5.5.8. Renaming a Table
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

The policy above implicitly provides a WITH CHECK + clause identical to its USING clause, so that the + constraint applies both to rows selected by a command (so a manager + cannot SELECT, UPDATE, + or DELETE existing rows belonging to a different + manager) and to rows modified by a command (so rows belonging to a + different manager cannot be created via INSERT + or UPDATE). +

If no role is specified, or the special user name PUBLIC is used, then the policy applies to all - users on the system. To allow all users to access their own row in + users on the system. To allow all users to access only their own row in a usersCREATE POLICY user_policy ON users USING (user_name = current_user);

This works similarly to the previous example. +

To use a different policy for rows that are being added to the table - compared to those rows that are visible, the WITH CHECK - clause can be used. This policy would allow all users to view all rows + compared to those rows that are visible, multiple policies can be + combined. This pair of policies would allow all users to view all rows in the users

CREATE POLICY user_policy ON users
-    USING (true)
-    WITH CHECK (user_name = current_user);
CREATE POLICY user_sel_policy ON users + FOR SELECT + USING (true); +CREATE POLICY user_mod_policy ON users + USING (user_name = current_user);

In a SELECT command, these two policies are combined + using OR, with the net effect being that all rows + can be selected. In other command types, only the second policy applies, + so that the effects are the same as before. +

Row security can also be disabled with the

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

The ability to create like-named objects in different schemas complicates + writing a query that references precisely the same objects every time. It + also opens up the potential for users to change the behavior of other + users' queries, maliciously or accidentally. Due to the prevalence of + unqualified names in queries and their use + in PostgreSQL internals, adding a schema + to search_path effectively trusts all users having + CREATE privilege on that schema. When you run an + ordinary query, a malicious user able to create objects in a schema of + your search path can take control and execute arbitrary SQL functions as + though you executed them. +

The first schema named in the search path is called the current schema. Aside from being the first schema searched, it is also the schema in which new tables will be created if the public schema. If you do - not want to allow that, you can revoke that privilege: +> schema. + Some usage patterns call for + revoking that privilege:

REVOKE CREATE ON SCHEMA public FROM PUBLIC;
5.8.6. Usage Patterns

Schemas can be used to organize your data in many ways. There are - a few usage patterns that are recommended and are easily supported by - the default configuration: +> Schemas can be used to organize your data in many ways. There are a few + usage patterns easily supported by the default configuration, only one of + which suffices when database users mistrust other database users:

  • If you do not create any schemas then all users access the - public schema implicitly. This simulates the situation where - schemas are not available at all. This setup is mainly - recommended when there is only a single user or a few cooperating - users in a database. This setup also allows smooth transition - from the non-schema-aware world. +> Constrain ordinary users to user-private schemas. To implement this, + issue REVOKE CREATE ON SCHEMA public FROM PUBLIC, + and create a schema for each user with the same name as that user. If + affected users had logged in before this, consider auditing the public + schema for objects named like objects in + schema pg_catalog. Recall that the default search + path starts with $user, which resolves to the user + name. Therefore, if each user has a separate schema, they access their + own schemas by default.

  • You can create a schema for each user with the same name as - that user. Recall that the default search path starts with - Remove the public schema from each user's default search path + using $user, which resolves to the user name. - Therefore, if each user has a separate schema, they access their - own schemas by default. +>ALTER ROLE user SET + search_path = "$user". Everyone retains the ability to + create objects in the public schema, but only qualified names will + choose those objects. While qualified table references are fine, calls + to functions in the public schema will be + unsafe or unreliable. Also, a user holding + the CREATEROLE privilege can undo this setting and + issue arbitrary queries under the identity of users relying on the + setting. If you create functions or extensions in the public schema or + grant CREATEROLE to users not warranting this + almost-superuser ability, use the first pattern instead.

  • If you use this setup then you might also want to revoke access - to the public schema (or drop it altogether), so users are - truly constrained to their own schemas. +> Remove the public schema from search_path in + postgresql.conf. + The ensuing user experience matches the previous pattern. In addition + to that pattern's implications for functions + and CREATEROLE, this trusts database owners + like CREATEROLE. If you create functions or + extensions in the public schema or assign + the CREATEROLE + privilege, CREATEDB privilege or individual database + ownership to users not warranting almost-superuser access, use the + first pattern instead.

  • To install shared applications (tables to be used by everyone, - additional functions provided by third parties, etc.), put them - into separate schemas. Remember to grant appropriate - privileges to allow the other users to access them. Users can - then refer to these additional objects by qualifying the names - with a schema name, or they can put the additional schemas into - their search path, as they choose. +> Keep the default. All users access the public schema implicitly. This + simulates the situation where schemas are not available at all, giving + a smooth transition from the non-schema-aware world. However, any user + can issue arbitrary queries under the identity of any user not electing + to protect itself individually. This pattern is acceptable only when + the database has a single user or a few mutually-trusting users.

For any pattern, to install shared applications (tables to be used by + everyone, additional functions provided by third parties, etc.), put them + into separate schemas. Remember to grant appropriate privileges to allow + the other users to access them. Users can then refer to these additional + objects by qualifying the names with a schema name, or they can put the + additional schemas into their search path, as they choose. +

public schema in the SQL standard. For maximum conformance to the standard, you should - not use (perhaps even remove) the public schema. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/ddl-system-columns.html postgresql-9.5-9.5.14/doc/src/sgml/html/ddl-system-columns.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/ddl-system-columns.html 2017-11-06 22:31:22.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/ddl-system-columns.html 2018-08-06 20:29:25.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.10.1. Configuration

F.10.2. Usage

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.11.1. Configuration

F.11.2. Usage

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Tip: When inserting a lot of data at the same time, considering using +> When inserting a lot of data at the same time, consider using the COPY

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

J.4.1. Emacs/PSGML

J.4.2. Other Emacs Modes

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

J.3.1. HTML

J.3.2. Manpages

J.3.3. Print Output via JadeTeX

J.3.4. Overflow Text

J.3.5. Print Output via RTF

J.3.6. Plain Text Files

J.3.7. Syntax Check

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

J.5.1. Reference Pages

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

J.2.1. Installation on Fedora, RHEL, and Derivatives

J.2.2. Installation on FreeBSD

J.2.3. Debian Packages

J.2.4. OS X

J.2.5. Manual Installation from Source

J.2.5.1. Installing OpenJade

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

F.12.1. Cube-based Earth Distances

F.12.2. Point-based Earth Distances

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

If untrusted users have access to a database that has not adopted a + secure schema usage pattern, + begin each session by removing publicly-writable schemas + from search_path. For example, + add options=-csearch_path= + to options, or + issue EXEC SQL SELECT pg_catalog.set_config('search_path', '', + false); after connecting. This consideration is not specific to + ECPG; it applies to every interface for executing arbitrary SQL commands. +

Here are some examples of CONNECT

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

33.7.2.1. SQLDA Data Structure

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
33.6.1. Character Strings
33.6.2. The numeric Type
33.6.2. 33.6.3. The date Type
33.6.3. 33.6.4. The timestamp Type
33.6.4. 33.6.5. The interval Type
33.6.5. 33.6.6. The decimal Type
33.6.6. 33.6.7. errno Values of pgtypeslib
33.6.7. 33.6.8. Special Constants of pgtypeslib
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

33.6.1. Character Strings

Some functions such as PGTYPESnumeric_to_asc return + a pointer to a freshly allocated character string. These results should be + freed with PGTYPESchar_free instead of + free. (This is important only on Windows, where + memory allocation and release sometimes need to be done by the same + library.) +

33.6.1. The numeric Type33.6.2. The numeric Type

The numeric type offers to do calculations with arbitrary precision. See @@ -265,6 +291,10 @@ >dscale decimal digits, with rounding applied if necessary. + The result must be freed with PGTYPESchar_free().

33.6.2. The date Type33.6.3. The date Type

The date type in C enables your programs to deal with data of the SQL type @@ -1019,6 +1049,10 @@ CLASS="LITERAL" >YYYY-MM-DD format. + The result must be freed with PGTYPESchar_free().

33.6.3. The timestamp Type33.6.4. The timestamp Type

The timestamp type in C enables your programs to deal with data of the SQL @@ -1952,6 +1986,10 @@ > as its only argument and returns an allocated string that contains the textual representation of the timestamp. + The result must be freed with PGTYPESchar_free().

33.6.4. The interval Type33.6.5. The interval Type

The interval type in C enables your programs to deal with data of the SQL @@ -2851,6 +2889,10 @@ CLASS="LITERAL" >@ 1 day 12 hours 59 mins 10 secs. + The result must be freed with PGTYPESchar_free().

33.6.5. The decimal Type33.6.6. The decimal Type

The decimal type is similar to the numeric type. However it is limited to @@ -2965,7 +3007,7 @@ CLASS="SECT2" >33.6.6. errno Values of pgtypeslib33.6.7. errno Values of pgtypeslib

33.6.7. Special Constants of pgtypeslib33.6.8. Special Constants of pgtypeslib

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Compatibility

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
+1][b]bool[c]Section 33.4.4.2.
b. declared in ecpglib.h
c. declared in

33.4.4.2.1. timestamp, date

33.4.4.3.3. Typedefs

33.4.4.3.4. Pointers

33.4.5.1. Arrays

33.4.5.2. Composite Types

33.4.5.3. User-defined Base Types

. The external string representation of that type is (%lf,%lf)(%f,%f), which is defined in the functions

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10. (Some are not actually +> 9.5.14. (Some are not actually used at present, but are defined by the SQL standard.) The error classes are also shown. For each error class there is a
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
errno. [1][1]
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

51.3.1. What Goes Where

51.3.2. Formatting

51.3.3. Quotation Marks

51.3.4. Use of Quotes

51.3.5. Grammar and Punctuation

51.3.6. Upper Case vs. Lower Case

51.3.7. Avoid Passive Voice

51.3.8. Present vs. Past Tense

51.3.9. Type of the Object

51.3.10. Brackets

51.3.11. Assembling Error Messages

51.3.12. Reasons for Errors

51.3.13. Function Names

51.3.14. Tricky Words to Avoid

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

35.15.1. Extension Files35.15.1. Defining Extension Objects

Widely-distributed extensions should assume little about the database + they occupy. In particular, unless you issued SET search_path = + pg_temp, assume each unqualified name could resolve to an + object that a malicious user has defined. Beware of constructs that + depend on search_path implicitly: IN + and CASE expression WHEN + always select an operator using the search path. In their place, use + OPERATOR(schema.=) ANY + and CASE WHEN expression. +

35.15.2. Extension Files

The

35.15.2. Extension Relocatability35.15.3. Extension Relocatability

Users often wish to load the objects contained in an extension into a @@ -809,8 +862,8 @@ >

35.15.3. Extension Configuration Tables35.15.4. Extension Configuration Tables

Some extensions include configuration tables, which contain data that @@ -913,8 +966,8 @@ >

35.15.4. Extension Updates35.15.5. Extension Updates

One advantage of the extension mechanism is that it provides convenient @@ -1166,8 +1219,8 @@ >

35.15.5. Extension Example35.15.6. Extension Example

Here is a complete example of an

# pair extension comment = 'A key/value pair data type' default_version = '1.0' -relocatable = true

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
35.2.1. Base Types
35.2.2. Composite Types
35.2.4. Pseudo-Types
35.4.10. Polymorphic SQL
35.4.11. SQL
35.9.3. Version 0 Calling Conventions
35.9.4. Version 1 Calling Conventions
35.9.5. Writing Code
35.9.7. Composite-type Arguments
35.9.8. Returning Rows (Composite Types)
35.9.10. Polymorphic Arguments and Return Types
35.9.12. Shared Memory and LWLocks
35.13.1. COMMUTATOR
35.13.2. NEGATOR
35.13.3. RESTRICT
35.13.4. JOIN
35.13.5. HASHES
35.13.6. MERGES
35.15.1. Extension FilesDefining Extension Objects
35.15.2. Extension RelocatabilityExtension Files
35.15.3. Extension Configuration TablesExtension Relocatability
35.15.4. Extension UpdatesExtension Configuration Tables
35.15.5. Extension Updates
35.15.6. Extension Example
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

35.2.1. Base Types

35.2.2. Composite Types

35.2.4. Pseudo-Types

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
pgAdmin IIIpgAdmin, and there are several commercially available ones as well. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/external-extensions.html postgresql-9.5-9.5.14/doc/src/sgml/html/external-extensions.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/external-extensions.html 2017-11-06 22:32:44.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/external-extensions.html 2018-08-06 20:30:51.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
Perl DBI driverC++ interface
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
, as the core system can generate junk columns of these names. + If the extra expressions are more complex than simple Vars, they + must be run through eval_const_expressions + before adding them to the targetlist.

This function is called in the rewriter, not the planner, so the - information available is a bit different from that available to the +> Although this function is called during planning, the + information provided is a bit different from that available to other planning routines.

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

http://search.cpan.org/dist/DBD-Pg/https://metacpan.org/release/DBD-Pg/
C++New-style C++ interface
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
, int[], +> [,
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

9.23.1. IN

9.23.2. NOT IN

9.23.3. ANY

9.23.4. ALL
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

The seconds field, including fractional parts (0 - 59[1][1]

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
9.22.6. Single-row Comparison
9.23.1. IN
9.23.2. NOT IN
9.23.3. ANY
9.23.4. ALL
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Note: In While the examples for the functions + json_populate_record, , + json_populate_recordset, json_to_record and and + json_to_recordset, - type coercion from the JSON is "best effort" and may not result - in desired values for some types. JSON keys are matched to - identical column names in the target row type. JSON fields that do not - appear in the target row type will be omitted from the output, and - target columns that do not match any JSON field will simply be NULL. +> use constants, the typical use + would be to reference a table in the FROM clause + and use one of its json or jsonb columns + as an argument to the function. Extracted key values can then be + referenced in other parts of the query, like WHERE + clauses and target lists. Extracting multiple values in this + way can improve performance over extracting them separately with + per-key operators.

JSON keys are matched to identical column names in the target + row type. JSON type coercion for these functions is "best + effort" and may not result in desired values for some types. + JSON fields that do not appear in the target row type will be + omitted from the output, and target columns that do not match any + JSON field will simply be NULL. +

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

9.22.6. Single-row Comparison

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

9.14.1.1. xmlcomment

9.14.1.2. xmlconcat

9.14.1.3. xmlelement

9.14.1.4. xmlforest

9.14.1.5. xmlpi

9.14.1.6. xmlroot

9.14.2.1. IS DOCUMENT

9.14.2.2. IS NOT DOCUMENT

xml IS NOT DOCUMENT

The expression IS NOT DOCUMENT returns false if the + argument XML value is a proper XML document, true if it is not (that is, + it is a content fragment), or null if the argument is null. +

F.14.1. Soundex

F.14.2. Levenshtein

F.14.3. Metaphone

F.14.4. Double Metaphone

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
57.3.1. Generating Possible Plans with GEQO
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

Conversion Name [a]Notes:
a. The conversion names follow a standard naming scheme: The official name of the source encoding with all diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/functions-subquery.html postgresql-9.5-9.5.14/doc/src/sgml/html/functions-subquery.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/functions-subquery.html 2017-11-06 22:31:26.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/functions-subquery.html 2018-08-06 20:29:29.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

57.3.1. Generating Possible Plans with GEQO
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
Git, which you can get from http://git-scm.comhttps://git-scm.com. Many systems already have a recent version of
git clone git://git.postgresql.org/git/postgresql.git
git clone https://git.postgresql.org/git/postgresql.git

This will copy the full repository to your local machine, so it may take @@ -153,20 +153,17 @@ your current directory.

The Git mirror can also be reached via the HTTP protocol, if for example - a firewall is blocking access to the Git protocol. Just change the URL +> The Git mirror can also be reached via the Git protocol. Just change the URL prefix to httpsgit, as in:

git clone https://git.postgresql.org/git/postgresql.git
git clone git://git.postgresql.org/git/postgresql.git

- The HTTP protocol is less efficient than the Git protocol, so it will be - slower to use.

  • Git man pages, or see the website at http://git-scm.comhttps://git-scm.com.

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
  • PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.15.1. hstore

    F.15.2. hstore

    F.15.3. Indexes

    F.15.4. Examples

    F.15.5. Statistics

    F.15.6. Compatibility

    F.15.7. Transforms

    F.15.8. Authors

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Copyright © 1996-2017 The PostgreSQL Global Development Group

    © 1996-2018 The PostgreSQL Global Development Group


    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    15.5.1. Shared Libraries
    15.5.2. Environment Variables
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    15.7.1.1. GCC Issues

    15.7.1.2. Unix-Domain Sockets Broken

    15.7.1.3. Internet Address Issues

    15.7.1.4. Memory Management

    References and Resources

    The PostgreSQL 9.5.10 sources can be obtained from the +> 9.5.14 sources can be obtained from the download section of our website: . You should get a file named postgresql-9.5.10.tar.gzpostgresql-9.5.14.tar.gz or postgresql-9.5.10.tar.bz2postgresql-9.5.14.tar.bz2. After you have obtained the file, unpack it:

    gunzip postgresql-9.5.10.tar.gzgunzip postgresql-9.5.14.tar.gz
     tar xf postgresql-9.5.10.tartar xf postgresql-9.5.14.tar

    (Use postgresql-9.5.10postgresql-9.5.14 under the current directory with the

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    15.5.1. Shared Libraries

    15.5.2. Environment Variables

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    16.1.1. Requirements

    16.1.2. Special Considerations for 64-bit Windows

    16.1.3. Building

    16.1.4. Cleaning and Installing

    16.1.5. Running the Regression Tests

    IPC-Run-<version>.tar.gz source archive from CPAN, at http://search.cpan.org/dist/IPC-Run/https://metacpan.org/release/IPC-Run/, and uncompress. Edit the

    16.1.6. Building the Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    16.1.1. Requirements
    16.1.2. Special Considerations for 64-bit Windows
    16.1.3. Building
    16.1.4. Cleaning and Installing
    16.1.5. Running the Regression Tests
    16.1.6. Building the Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    16.2.1. Generated Files

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.16.1. Functions

    F.16.2. Sample Uses

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.17.1. intarray

    F.17.2. Index Support

    F.17.3. Example

    F.17.4. Benchmark

    F.17.5. Authors

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    This part contains assorted information that might be of use to diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/intro-whatis.html postgresql-9.5-9.5.14/doc/src/sgml/html/intro-whatis.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/intro-whatis.html 2017-11-06 22:31:20.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/intro-whatis.html 2018-08-06 20:29:23.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.18.1. Data Types

    F.18.2. Casts

    F.18.3. Functions and Operators

    F.18.4. Examples

    F.18.5. Bibliography

    F.18.6. Author

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    You might also want to configure your kernel to lock shared - memory into RAM and prevent it from being paged out to swap. - This can be accomplished using the sysctl - setting kern.ipc.shm_use_phys. -

    17.4.2. Resource Limits17.4.2. systemd RemoveIPC

    If systemd is in use, some care must be taken + that IPC resources (shared memory and semaphores) are not prematurely + removed by the operating system. This is especially of concern when + installing PostgreSQL from source. Users of distribution packages of + PostgreSQL are less likely to be affected, as + the postgres user is then normally created as a system + user. +

    The setting RemoveIPC + in logind.conf controls whether IPC objects are + removed when a user fully logs out. System users are exempt. This + setting defaults to on in stock systemd, but + some operating system distributions default it to off. +

    A typical observed effect when this setting is on is that the semaphore + objects used by a PostgreSQL server are removed at apparently random + times, leading to the server crashing with log messages like +

    LOG: semctl(1234567890, 0, IPC_RMID, ...) failed: Invalid argument

    + Different types of IPC objects (shared memory vs. semaphores, System V + vs. POSIX) are treated slightly differently + by systemd, so one might observe that some IPC + resources are not removed in the same way as others. But it is not + advisable to rely on these subtle differences. +

    A "user logging out" might happen as part of a maintenance + job or manually when an administrator logs in as + the postgres user or something similar, so it is hard + to prevent in general. +

    What is a "system user" is determined + at systemd compile time from + the SYS_UID_MAX setting + in /etc/login.defs. +

    Packaging and deployment scripts should be careful to create + the postgres user as a system user by + using useradd -r, adduser --system, + or equivalent. +

    Alternatively, if the user account was created incorrectly or cannot be + changed, it is recommended to set +

    RemoveIPC=no

    + in /etc/systemd/logind.conf or another appropriate + configuration file. +

    Caution

    At least one of these two things has to be ensured, or the PostgreSQL + server will be very unreliable. +

    17.4.3. Resource Limits

    Unix-like operating systems enforce various kinds of resource limits @@ -1399,7 +1527,7 @@ CLASS="SECT2" >17.4.3. Linux Memory Overcommit17.4.4. Linux Memory Overcommit

    In Linux 2.4 and later, the default virtual memory behavior is not @@ -1635,7 +1763,7 @@ CLASS="SECT2" >17.4.4. Linux Huge Pages17.4.5. Linux Huge Pages

    Using huge pages reduces overhead when using large contiguous chunks of diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/largeobjects.html postgresql-9.5-9.5.14/doc/src/sgml/html/largeobjects.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/largeobjects.html 2017-11-06 22:31:34.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/largeobjects.html 2018-08-06 20:29:38.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    E.1. Release 9.5.14
    E.2. Release 9.5.13
    E.3. Release 9.5.12
    E.4. Release 9.5.11
    E.5. Release 9.5.10
    E.2. E.6. Release 9.5.9
    E.3. E.7. Release 9.5.8
    E.4. E.8. Release 9.5.7
    E.5. E.9. Release 9.5.6
    E.6. E.10. Release 9.5.5
    E.7. E.11. Release 9.5.4
    E.8. E.12. Release 9.5.3
    E.9. E.13. Release 9.5.2
    E.10. E.14. Release 9.5.1
    E.11. E.15. Release 9.5
    E.12. E.16. Release 9.4.19
    E.17. Release 9.4.18
    E.18. Release 9.4.17
    E.19. Release 9.4.16
    E.20. Release 9.4.15
    E.13. E.21. Release 9.4.14
    E.14. E.22. Release 9.4.13
    E.15. E.23. Release 9.4.12
    E.16. E.24. Release 9.4.11
    E.17. E.25. Release 9.4.10
    E.18. E.26. Release 9.4.9
    E.19. E.27. Release 9.4.8
    E.20. E.28. Release 9.4.7
    E.21. E.29. Release 9.4.6
    E.22. E.30. Release 9.4.5
    E.23. E.31. Release 9.4.4
    E.24. E.32. Release 9.4.3
    E.25. E.33. Release 9.4.2
    E.26. E.34. Release 9.4.1
    E.27. E.35. Release 9.4
    E.28. E.36. Release 9.3.24
    E.37. Release 9.3.23
    E.38. Release 9.3.22
    E.39. Release 9.3.21
    E.40. Release 9.3.20
    E.29. E.41. Release 9.3.19
    E.30. E.42. Release 9.3.18
    E.31. E.43. Release 9.3.17
    E.32. E.44. Release 9.3.16
    E.33. E.45. Release 9.3.15
    E.34. E.46. Release 9.3.14
    E.35. E.47. Release 9.3.13
    E.36. E.48. Release 9.3.12
    E.37. E.49. Release 9.3.11
    E.38. E.50. Release 9.3.10
    E.39. E.51. Release 9.3.9
    E.40. E.52. Release 9.3.8
    E.41. E.53. Release 9.3.7
    E.42. E.54. Release 9.3.6
    E.43. E.55. Release 9.3.5
    E.44. E.56. Release 9.3.4
    E.45. E.57. Release 9.3.3
    E.46. E.58. Release 9.3.2
    E.47. E.59. Release 9.3.1
    E.48. E.60. Release 9.3
    E.49. E.61. Release 9.2.24
    E.50. E.62. Release 9.2.23
    E.51. E.63. Release 9.2.22
    E.52. E.64. Release 9.2.21
    E.53. E.65. Release 9.2.20
    E.54. E.66. Release 9.2.19
    E.55. E.67. Release 9.2.18
    E.56. E.68. Release 9.2.17
    E.57. E.69. Release 9.2.16
    E.58. E.70. Release 9.2.15
    E.59. E.71. Release 9.2.14
    E.60. E.72. Release 9.2.13
    E.61. E.73. Release 9.2.12
    E.62. E.74. Release 9.2.11
    E.63. E.75. Release 9.2.10
    E.64. E.76. Release 9.2.9
    E.65. E.77. Release 9.2.8
    E.66. E.78. Release 9.2.7
    E.67. E.79. Release 9.2.6
    E.68. E.80. Release 9.2.5
    E.69. E.81. Release 9.2.4
    E.70. E.82. Release 9.2.3
    E.71. E.83. Release 9.2.2
    E.72. E.84. Release 9.2.1
    E.73. E.85. Release 9.2
    E.74. E.86. Release 9.1.24
    E.75. E.87. Release 9.1.23
    E.76. E.88. Release 9.1.22
    E.77. E.89. Release 9.1.21
    E.78. E.90. Release 9.1.20
    E.79. E.91. Release 9.1.19
    E.80. E.92. Release 9.1.18
    E.81. E.93. Release 9.1.17
    E.82. E.94. Release 9.1.16
    E.83. E.95. Release 9.1.15
    E.84. E.96. Release 9.1.14
    E.85. E.97. Release 9.1.13
    E.86. E.98. Release 9.1.12
    E.87. E.99. Release 9.1.11
    E.88. E.100. Release 9.1.10
    E.89. E.101. Release 9.1.9
    E.90. E.102. Release 9.1.8
    E.91. E.103. Release 9.1.7
    E.92. E.104. Release 9.1.6
    E.93. E.105. Release 9.1.5
    E.94. E.106. Release 9.1.4
    E.95. E.107. Release 9.1.3
    E.96. E.108. Release 9.1.2
    E.97. E.109. Release 9.1.1
    E.98. E.110. Release 9.1
    E.99. E.111. Release 9.0.23
    E.100. E.112. Release 9.0.22
    E.101. E.113. Release 9.0.21
    E.102. E.114. Release 9.0.20
    E.103. E.115. Release 9.0.19
    E.104. E.116. Release 9.0.18
    E.105. E.117. Release 9.0.17
    E.106. E.118. Release 9.0.16
    E.107. E.119. Release 9.0.15
    E.108. E.120. Release 9.0.14
    E.109. E.121. Release 9.0.13
    E.110. E.122. Release 9.0.12
    E.111. E.123. Release 9.0.11
    E.112. E.124. Release 9.0.10
    E.113. E.125. Release 9.0.9
    E.114. E.126. Release 9.0.8
    E.115. E.127. Release 9.0.7
    E.116. E.128. Release 9.0.6
    E.117. E.129. Release 9.0.5
    E.118. E.130. Release 9.0.4
    E.119. E.131. Release 9.0.3
    E.120. E.132. Release 9.0.2
    E.121. E.133. Release 9.0.1
    E.122. E.134. Release 9.0
    E.123. E.135. Release 8.4.22
    E.124. E.136. Release 8.4.21
    E.125. E.137. Release 8.4.20
    E.126. E.138. Release 8.4.19
    E.127. E.139. Release 8.4.18
    E.128. E.140. Release 8.4.17
    E.129. E.141. Release 8.4.16
    E.130. E.142. Release 8.4.15
    E.131. E.143. Release 8.4.14
    E.132. E.144. Release 8.4.13
    E.133. E.145. Release 8.4.12
    E.134. E.146. Release 8.4.11
    E.135. E.147. Release 8.4.10
    E.136. E.148. Release 8.4.9
    E.137. E.149. Release 8.4.8
    E.138. E.150. Release 8.4.7
    E.139. E.151. Release 8.4.6
    E.140. E.152. Release 8.4.5
    E.141. E.153. Release 8.4.4
    E.142. E.154. Release 8.4.3
    E.143. E.155. Release 8.4.2
    E.144. E.156. Release 8.4.1
    E.145. E.157. Release 8.4
    E.146. E.158. Release 8.3.23
    E.147. E.159. Release 8.3.22
    E.148. E.160. Release 8.3.21
    E.149. E.161. Release 8.3.20
    E.150. E.162. Release 8.3.19
    E.151. E.163. Release 8.3.18
    E.152. E.164. Release 8.3.17
    E.153. E.165. Release 8.3.16
    E.154. E.166. Release 8.3.15
    E.155. E.167. Release 8.3.14
    E.156. E.168. Release 8.3.13
    E.157. E.169. Release 8.3.12
    E.158. E.170. Release 8.3.11
    E.159. E.171. Release 8.3.10
    E.160. E.172. Release 8.3.9
    E.161. E.173. Release 8.3.8
    E.162. E.174. Release 8.3.7
    E.163. E.175. Release 8.3.6
    E.164. E.176. Release 8.3.5
    E.165. E.177. Release 8.3.4
    E.166. E.178. Release 8.3.3
    E.167. E.179. Release 8.3.2
    E.168. E.180. Release 8.3.1
    E.169. E.181. Release 8.3
    E.170. E.182. Release 8.2.23
    E.171. E.183. Release 8.2.22
    E.172. E.184. Release 8.2.21
    E.173. E.185. Release 8.2.20
    E.174. E.186. Release 8.2.19
    E.175. E.187. Release 8.2.18
    E.176. E.188. Release 8.2.17
    E.177. E.189. Release 8.2.16
    E.178. E.190. Release 8.2.15
    E.179. E.191. Release 8.2.14
    E.180. E.192. Release 8.2.13
    E.181. E.193. Release 8.2.12
    E.182. E.194. Release 8.2.11
    E.183. E.195. Release 8.2.10
    E.184. E.196. Release 8.2.9
    E.185. E.197. Release 8.2.8
    E.186. E.198. Release 8.2.7
    E.187. E.199. Release 8.2.6
    E.188. E.200. Release 8.2.5
    E.189. E.201. Release 8.2.4
    E.190. E.202. Release 8.2.3
    E.191. E.203. Release 8.2.2
    E.192. E.204. Release 8.2.1
    E.193. E.205. Release 8.2
    E.194. E.206. Release 8.1.23
    E.195. E.207. Release 8.1.22
    E.196. E.208. Release 8.1.21
    E.197. E.209. Release 8.1.20
    E.198. E.210. Release 8.1.19
    E.199. E.211. Release 8.1.18
    E.200. E.212. Release 8.1.17
    E.201. E.213. Release 8.1.16
    E.202. E.214. Release 8.1.15
    E.203. E.215. Release 8.1.14
    E.204. E.216. Release 8.1.13
    E.205. E.217. Release 8.1.12
    E.206. E.218. Release 8.1.11
    E.207. E.219. Release 8.1.10
    E.208. E.220. Release 8.1.9
    E.209. E.221. Release 8.1.8
    E.210. E.222. Release 8.1.7
    E.211. E.223. Release 8.1.6
    E.212. E.224. Release 8.1.5
    E.213. E.225. Release 8.1.4
    E.214. E.226. Release 8.1.3
    E.215. E.227. Release 8.1.2
    E.216. E.228. Release 8.1.1
    E.217. E.229. Release 8.1
    E.218. E.230. Release 8.0.26
    E.219. E.231. Release 8.0.25
    E.220. E.232. Release 8.0.24
    E.221. E.233. Release 8.0.23
    E.222. E.234. Release 8.0.22
    E.223. E.235. Release 8.0.21
    E.224. E.236. Release 8.0.20
    E.225. E.237. Release 8.0.19
    E.226. E.238. Release 8.0.18
    E.227. E.239. Release 8.0.17
    E.228. E.240. Release 8.0.16
    E.229. E.241. Release 8.0.15
    E.230. E.242. Release 8.0.14
    E.231. E.243. Release 8.0.13
    E.232. E.244. Release 8.0.12
    E.233. E.245. Release 8.0.11
    E.234. E.246. Release 8.0.10
    E.235. E.247. Release 8.0.9
    E.236. E.248. Release 8.0.8
    E.237. E.249. Release 8.0.7
    E.238. E.250. Release 8.0.6
    E.239. E.251. Release 8.0.5
    E.240. E.252. Release 8.0.4
    E.241. E.253. Release 8.0.3
    E.242. E.254. Release 8.0.2
    E.243. E.255. Release 8.0.1
    E.244. E.256. Release 8.0
    E.245. E.257. Release 7.4.30
    E.246. E.258. Release 7.4.29
    E.247. E.259. Release 7.4.28
    E.248. E.260. Release 7.4.27
    E.249. E.261. Release 7.4.26
    E.250. E.262. Release 7.4.25
    E.251. E.263. Release 7.4.24
    E.252. E.264. Release 7.4.23
    E.253. E.265. Release 7.4.22
    E.254. E.266. Release 7.4.21
    E.255. E.267. Release 7.4.20
    E.256. E.268. Release 7.4.19
    E.257. E.269. Release 7.4.18
    E.258. E.270. Release 7.4.17
    E.259. E.271. Release 7.4.16
    E.260. E.272. Release 7.4.15
    E.261. E.273. Release 7.4.14
    E.262. E.274. Release 7.4.13
    E.263. E.275. Release 7.4.12
    E.264. E.276. Release 7.4.11
    E.265. E.277. Release 7.4.10
    E.266. E.278. Release 7.4.9
    E.267. E.279. Release 7.4.8
    E.268. E.280. Release 7.4.7
    E.269. E.281. Release 7.4.6
    E.270. E.282. Release 7.4.5
    E.271. E.283. Release 7.4.4
    E.272. E.284. Release 7.4.3
    E.273. E.285. Release 7.4.2
    E.274. E.286. Release 7.4.1
    E.275. E.287. Release 7.4
    E.276. E.288. Release 7.3.21
    E.277. E.289. Release 7.3.20
    E.278. E.290. Release 7.3.19
    E.279. E.291. Release 7.3.18
    E.280. E.292. Release 7.3.17
    E.281. E.293. Release 7.3.16
    E.282. E.294. Release 7.3.15
    E.283. E.295. Release 7.3.14
    E.284. E.296. Release 7.3.13
    E.285. E.297. Release 7.3.12
    E.286. E.298. Release 7.3.11
    E.287. E.299. Release 7.3.10
    E.288. E.300. Release 7.3.9
    E.289. E.301. Release 7.3.8
    E.290. E.302. Release 7.3.7
    E.291. E.303. Release 7.3.6
    E.292. E.304. Release 7.3.5
    E.293. E.305. Release 7.3.4
    E.294. E.306. Release 7.3.3
    E.295. E.307. Release 7.3.2
    E.296. E.308. Release 7.3.1
    E.297. E.309. Release 7.3
    E.298. E.310. Release 7.2.8
    E.299. E.311. Release 7.2.7
    E.300. E.312. Release 7.2.6
    E.301. E.313. Release 7.2.5
    E.302. E.314. Release 7.2.4
    E.303. E.315. Release 7.2.3
    E.304. E.316. Release 7.2.2
    E.305. E.317. Release 7.2.1
    E.306. E.318. Release 7.2
    E.307. E.319. Release 7.1.3
    E.308. E.320. Release 7.1.2
    E.309. E.321. Release 7.1.1
    E.310. E.322. Release 7.1
    E.311. E.323. Release 7.0.3
    E.312. E.324. Release 7.0.2
    E.313. E.325. Release 7.0.1
    E.314. E.326. Release 7.0
    E.315. E.327. Release 6.5.3
    E.316. E.328. Release 6.5.2
    E.317. E.329. Release 6.5.1
    E.318. E.330. Release 6.5
    E.319. E.331. Release 6.4.2
    E.320. E.332. Release 6.4.1
    E.321. E.333. Release 6.4
    E.322. E.334. Release 6.3.2
    E.323. E.335. Release 6.3.1
    E.324. E.336. Release 6.3
    E.325. E.337. Release 6.2.1
    E.326. E.338. Release 6.2
    E.327. E.339. Release 6.1.1
    E.328. E.340. Release 6.1
    E.329. E.341. Release 6.0
    E.330. E.342. Release 1.09
    E.331. E.343. Release 1.02
    E.332. E.344. Release 1.01
    E.333. E.345. Release 1.0
    E.334. E.346. Release 0.03
    E.335. E.347. Release 0.02
    E.336. E.348. NextRelease 9.5.10Release 9.5.14
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 DocumentationNextFunction and Trigger SecurityFunction Security
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    8.16.2. Constructing Composite Values

    8.16.4. Modifying Composite Types

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    38.2.2. View Rules in Non-SELECT
    38.2.3. The Power of Views in PostgreSQL
    38.4.1. How Update Rules Work
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    38.4.1. How Update Rules Work

    38.4.1.1. A First Rule Step by Step

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    38.2.2. View Rules in Non-SELECT

    38.2.3. The Power of Views in PostgreSQL
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    For more information on schema handling, see + Section 5.8. In particular, the default + configuration is suitable only when the database has a single user or + a few mutually-trusting users. +

    The current effective value of the search path can be examined via the search_path were resolved.

    For more information on schema handling, see Section 5.8. -

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    18.1.4. Parameter Interaction via the Shell
    18.8.5. Process Title

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    18.8.5. Process Title

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    streaming in the pg_stat_replication pg_stat_replication
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    Section 17.4.4Section 17.4.5.

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    17.4.2. Resource Limitssystemd RemoveIPC
    17.4.3. Resource Limits
    17.4.4. Linux Memory Overcommit
    17.4.4. 17.4.5. Linux Huge Pages
    17.9.3. Creating a Self-signed CertificateCreating Certificates
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.32.1. Rationale

    F.32.2. Syntax

    F.32.3. Precision

    F.32.4. Usage

    F.32.5. Notes

    F.32.6. Credits

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.33.5.1. Controlled Object Classes

    F.33.5.2. DML Permissions

    F.33.5.3. DDL Permissions

    F.33.5.4. Trusted Procedures

    F.33.5.5. Dynamic Domain Transitions

    F.33.5.6. Miscellaneous

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    This part is about extending the server functionality with diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/server-shutdown.html postgresql-9.5-9.5.14/doc/src/sgml/html/server-shutdown.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/server-shutdown.html 2017-11-06 22:31:29.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/server-shutdown.html 2018-08-06 20:29:33.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    51.3.1. What Goes Where
    51.3.2. Formatting
    51.3.3. Quotation Marks
    51.3.4. Use of Quotes
    51.3.5. Grammar and Punctuation
    51.3.6. Upper Case vs. Lower Case
    51.3.7. Avoid Passive Voice
    51.3.8. Present vs. Past Tense
    51.3.9. Type of the Object
    51.3.10. Brackets
    51.3.11. Assembling Error Messages
    51.3.12. Reasons for Errors
    51.3.13. Function Names
    51.3.14. Tricky Words to Avoid
    51.3.15. Proper Spelling
    51.3.16. Localization
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    This part contains reference information for the diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/sql-comment.html postgresql-9.5-9.5.14/doc/src/sgml/html/sql-comment.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/sql-comment.html 2017-11-06 22:31:44.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/sql-comment.html 2018-08-06 20:29:48.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    File Formats

    Text Format

    CSV Format

    Binary Format

    File Header

    Tuples

    File Trailer

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    Notes

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    is the function's link symbol, that is, the name of the function in the C - language source code. If the link symbol is omitted, it is assumed - to be the same as the name of the SQL function being defined. + language source code. If the link symbol is omitted, it is assumed to + be the same as the name of the SQL function being defined. The C names + of all functions must be different, so you must give overloaded C + functions different C names (for example, use the argument types as + part of the C names).

    When repeated overloading; that is, the same name can be used for several different functions so long as they have distinct - input argument types. However, the C names of all functions must be - different, so you must give overloaded C functions different C - names (for example, use the argument types as part of the C - names). + input argument types. Whether or not you use it, this capability entails + security precautions when calling functions in databases where some users + mistrust other users; see Section 10.3.

    Two functions are considered the same if they have the same names and @@ -1468,7 +1473,7 @@ >

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Policies can be applied for specific commands or for specific roles. The default for newly created policies is that they apply for all commands and - roles, unless otherwise specified. + roles, unless otherwise specified. Multiple policies may apply to a single + command; see below for more details. + Table 1 summarizes how the different types + of policy apply to specific commands.

    For policies that can have both

    Parameters

    Per-Command Policies

    Table 1. Policies Applied by Command Type

    CommandSELECT/ALL policyINSERT/ALL policyUPDATE/ALL policyDELETE/ALL policy
    USING expressionWITH CHECK expressionUSING expressionWITH CHECK expressionUSING expression
    SELECTExisting row
    SELECT FOR UPDATE/SHAREExisting rowExisting row
    INSERTNew row
    INSERT ... RETURNING New row [a] + New row
    UPDATE Existing & new rows [a] + Existing rowNew row
    DELETE Existing row [a] + Existing row
    ON CONFLICT DO UPDATEExisting & new rowsExisting rowNew row
    Notes:
    a. If read access is required to the existing or new row (for example, + a WHERE or RETURNING clause + that refers to columns from the relation). +

    Application of Multiple Policies

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    CREATE TABLE distributors ( did integer, - name varchar(40) + name varchar(40), CONSTRAINT con1 CHECK (did > 100 AND name <> '') );

    @@ -2682,7 +2682,7 @@ >

    Temporary Tables

    Non-deferred Uniqueness Constraints

    Column Check Constraints

    Inheritance

    Zero-column Tables

    Tablespaces

    Typed Tables

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Statement-level triggers on a view are fired only if the action on the + view is handled by a row-level INSTEAD OF trigger. + If the action is handled by an INSTEAD rule, then + whatever statements are emitted by the rule are executed in place of the + original statement naming the view, so that the triggers that will be + fired are those on tables named in the replacement statements. + Similarly, if the view is automatically updatable, then the action is + handled by automatically rewriting the statement into an action on the + view's base table, so that the base table's statement-level triggers are + the ones that are fired. +

    In PostgreSQL

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Composite Types

    Base Types

    Array Types

    Parameters

    Examples

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    ). Cursors that are not simply updatable might work, or might not, depending on plan choice details; so in the worst case, an application might work in testing - and then fail in production. + and then fail in production. If FOR UPDATE is + specified, the cursor is guaranteed to be updatable.

    The main reason not to use

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    When issuing queries in a database where some users mistrust other users, + observe security precautions from Section 10.3 when + writing function calls. +

    The arguments can optionally have names attached. See

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    function, the rules are different — see Section 40.7Section 40.7.3.

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 DocumentationPostgreSQL - 9.5.10. Background information can be found in Section 4.1.1. diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/sql-listen.html postgresql-9.5-9.5.14/doc/src/sgml/html/sql-listen.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/sql-listen.html 2017-11-06 22:31:47.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/sql-listen.html 2018-08-06 20:29:52.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Outputs

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    pg_notify

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    A user can only revoke privileges that were granted directly by that user. If, for example, user A has granted a privilege with - grant option to user B, and user B has in turned granted it to user + grant option to user B, and user B has in turn granted it to user C, then user A cannot revoke the privilege directly from C. Instead, user A could revoke the grant option from user B and use the

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    ] { ROW | ROWS } ONLY

    - In this syntax, to write anything except a simple integer constant for - start or + or count, you must write parentheses - around it. +> value is required by + the standard to be a literal constant, a parameter, or a variable name; + as a PostgreSQL extension, other expressions + are allowed, but will generally need to be enclosed in parentheses to avoid + ambiguity. If

    Examples

    Compatibility

    Omitted

    Empty

    Omitting the

    Function Calls in

    Namespace Available to

    Functional Dependencies

    Data-Modifying Statements in

    Nonstandard Clauses

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Notes

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Notes

    Examples

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 DocumentationSection 10.3.

    In either notation, parameters that have default values given in the diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/sql-syntax.html postgresql-9.5-9.5.14/doc/src/sgml/html/sql-syntax.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/sql-syntax.html 2017-11-06 22:31:21.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/sql-syntax.html 2018-08-06 20:29:25.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.35.1. Functions Provided

    F.35.2. Author

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    In some cases, the server certificate might be signed by an - "intermediate" certificate authority, rather than one that is - directly trusted by clients. To use such a certificate, append the - certificate of the signing authority to the The first certificate in server.crt file, - then its parent authority's certificate, and so on up to a certificate - authority, "root" or must be the + server's certificate because it must match the server's private key. + The certificates of "intermediate", that is trusted by - clients, i.e. signed by a certificate in the clients' +> certificate authorities + can also be appended to the file. Doing this avoids the necessity of + storing intermediate certificates on clients, assuming the root and + intermediate certificates were created with v3_ca + extensions. This allows easier expiration of intermediate certificates. +

    It is not necessary to add the root certificate to root.crt files. +>server.crt. Instead, clients must have the root + certificate of the server's certificate chain.

    17.9.1. Using Client Certificates

    To require the client to supply a trusted certificate, place - certificates of the certificate authorities ( To require the client to supply a trusted certificate, + place certificates of the root certificate authorities + (CAs) - you trust in the file root.crt in the data +>s) you trust in a file in the data directory, set the parameter ssl_ca_filepostgresql.conf to root.crt, - and set the to the new file name, and add the + authentication option clientcert parameter - to 1 on the appropriate clientcert=1 to the appropriate + hostssl line(s) in - line(s) in pg_hba.conf. - A certificate will then be requested from the client during - SSL connection startup. (See Section 31.18 for a - description of how to set up certificates on the client.) The server will +> for a description + of how to set up certificates on the client.) The server will verify that the client's certificate is signed by one of the trusted - certificate authorities. If intermediate CAs appear in -

    Intermediate certificates that chain up to existing root certificates + can also appear in the file root.crt, the file must also contain certificate - chains to their root CAs. Certificate Revocation List - (CRL) entries - are also checked if the parameter if + you wish to avoid storing them on clients (assuming the root and + intermediate certificates were created with v3_ca + extensions). Certificate Revocation List (CRL) entries are also + checked if the parameter ssl_crl_file is set. @@ -378,16 +373,6 @@ — but it will not insist that a client certificate be presented.

    Note that the server's root.crt lists the top-level - CAs that are considered trusted for signing client certificates. - In principle it need - not list the CA that signed the server's certificate, though in most cases - that CA would also be trusted for client certificates. -

    If you are setting up client certificates, you may wish to use the 17.9.3. Creating a Self-signed Certificate17.9.3. Creating Certificates

    To create a quick self-signed certificate for the server, use the - following To create a simple self-signed certificate for the server, valid for 365 + days, use the following OpenSSL command: -

    openssl req -new -text -out server.req

    - Fill out the information that openssl asks for. Make sure - you enter the local host name as "Common Name"; the challenge - password can be left blank. The program will generate a key that is - passphrase protected; it will not accept a passphrase that is less - than four characters long. To remove the passphrase (as you must if - you want automatic start-up of the server), run the commands: -

    openssl rsa -in privkey.pem -out server.key
    -rm privkey.pem

    - Enter the old passphrase to unlock the existing key. Now do: +> command, + replacing dbhost.yourdomain.com with the + server's host name:

    openssl req -x509 -in server.req -text -key server.key -out server.crt
    openssl req -new -x509 -days 365 -nodes -text -out server.crt \ + -keyout server.key -subj "/CN=dbhost.yourdomain.com"

    - to turn the certificate into a self-signed certificate and to copy - the key and certificate to where the server will look for them. - Finally do: + Then do:

    chmod og-rwx server.key
    documentation.

    A self-signed certificate can be used for testing, but a certificate +> While a self-signed certificate can be used for testing, a certificate signed by a certificate authority (CA) (either one of the - global CAs or a local one) should be used in production - so that clients can verify the server's identity. If all the clients - are local to the organization, using a local ) (usually an + enterprise-wide root CA is - recommended. +>) should be used in production. +

    To create a server certificate whose identity can be validated + by clients, first create a certificate signing request + (CSR) and a public/private key file: +

    openssl req -new -nodes -text -out root.csr \
    +  -keyout root.key -subj "/CN=root.yourdomain.com"
    +chmod og-rwx root.key

    + Then, sign the request with the key to create a root certificate + authority (using the default OpenSSL + configuration file location on Linux): +

    openssl x509 -req -in root.csr -text -days 3650 \
    +  -extfile /etc/ssl/openssl.cnf -extensions v3_ca \
    +  -signkey root.key -out root.crt

    + Finally, create a server certificate signed by the new root certificate + authority: +

    openssl req -new -nodes -text -out server.csr \
    +  -keyout server.key -subj "/CN=dbhost.yourdomain.com"
    +chmod og-rwx server.key
    +
    +openssl x509 -req -in server.csr -text -days 365 \
    +  -CA root.crt -CAkey root.key -CAcreateserial \
    +  -out server.crt

    + server.crt and server.key + should be stored on the server, and root.crt should + be stored on the client so the client can verify that the server's leaf + certificate was signed by its trusted root certificate. + root.key should be stored offline for use in + creating future certificates. +

    It is also possible to create a chain of trust that includes + intermediate certificates: +

    # root
    +openssl req -new -nodes -text -out root.csr \
    +  -keyout root.key -subj "/CN=root.yourdomain.com"
    +chmod og-rwx root.key
    +openssl x509 -req -in root.csr -text -days 3650 \
    +  -extfile /etc/ssl/openssl.cnf -extensions v3_ca \
    +  -signkey root.key -out root.crt
    +
    +# intermediate
    +openssl req -new -nodes -text -out intermediate.csr \
    +  -keyout intermediate.key -subj "/CN=intermediate.yourdomain.com"
    +chmod og-rwx intermediate.key
    +openssl x509 -req -in intermediate.csr -text -days 1825 \
    +  -extfile /etc/ssl/openssl.cnf -extensions v3_ca \
    +  -CA root.crt -CAkey root.key -CAcreateserial \
    +  -out intermediate.crt
    +
    +# leaf
    +openssl req -new -nodes -text -out server.csr \
    +  -keyout server.key -subj "/CN=dbhost.yourdomain.com"
    +chmod og-rwx server.key
    +openssl x509 -req -in server.csr -text -days 365 \
    +  -CA intermediate.crt -CAkey intermediate.key -CAcreateserial \
    +  -out server.crt

    + server.crt and + intermediate.crt should be concatenated + into a certificate file bundle and stored on the server. + server.key should also be stored on the server. + root.crt should be stored on the client so + the client can verify that the server's leaf certificate was signed + by a chain of certificates linked to its trusted root certificate. + root.key and intermediate.key + should be stored offline for use in creating future certificates.

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 DocumentationPostgreSQL tables and indexes.[1][1]
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.36.1. Functions Provided

    F.36.1.1. normal_rand

    F.36.1.2. crosstab(text)

    F.36.1.3. crosstab

    F.36.1.4. crosstab(text, text)

    F.36.1.5. connectby

    F.36.2. Author

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentationtest_decoding is an example of a logical decoding output plugin. It doesn't do anything especially useful, but can serve as - a starting point for developing your own decoder. + a starting point for developing your own output plugin.

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 DocumentationDELETE operations. operations. + Such INSTEAD OF triggers are fired once for each row that needs to be modified in the view. It is the responsibility of the - trigger's function to perform the necessary modifications to the - underlying base tables and, where appropriate, return the modified + trigger's function to perform the necessary modifications to the view's + underlying base table(s) and, where appropriate, return the modified row as it will appear in the view. Triggers on views can also be defined to execute once per DELETE operations. + However, such triggers are fired only if there is also + an INSTEAD OF trigger on the view. Otherwise, + any statement targeting the view must be rewritten into a statement + affecting its underlying base table(s), and then the triggers + that will be fired are the ones attached to the base table(s).

    The trigger function must be defined before the trigger itself can be diff -Nru postgresql-9.5-9.5.10/doc/src/sgml/html/trigger-example.html postgresql-9.5-9.5.14/doc/src/sgml/html/trigger-example.html --- postgresql-9.5-9.5.10/doc/src/sgml/html/trigger-example.html 2017-11-06 22:31:38.000000000 +0000 +++ postgresql-9.5-9.5.14/doc/src/sgml/html/trigger-example.html 2018-08-06 20:29:42.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.39.1. Portability Issues

    F.39.2. Converting a pre-8.3 Installation

    F.39.3. References

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.40.1. Examples

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    F.41.1. Examples

    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    psql (9.5.10)
    +>psql (9.5.14)
     Type "help" for help.
     
     mydb=>
    version ----------------------------------------------------------------------- - PostgreSQL 9.5.10 on i586-pc-linux-gnu, compiled by GCC 2.96, 32-bit + PostgreSQL 9.5.14 on i586-pc-linux-gnu, compiled by GCC 2.96, 32-bit (1 row)
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    This creates a security hazard when calling, via qualified name + [1], +a variadic function found in a schema that permits untrusted users to create +objects. A malicious user can take control and execute arbitrary SQL +functions as though you executed them. Substitute a call bearing +the VARIADIC keyword, which bypasses this hazard. Calls +populating VARIADIC "any" parameters often have no +equivalent formulation containing the VARIADIC keyword. To +issue those calls safely, the function's schema must permit only trusted users +to create objects.

  • error will result if no better match to the call can be found.

    This creates an availability hazard when calling, via qualified +name[1], any function found in a +schema that permits untrusted users to create objects. A malicious user can +create a function with the name of an existing function, replicating that +function's parameters and appending novel parameters having default values. +This precludes new calls to the original function. To forestall this hazard, +place functions in schemas that permit only trusted users to create objects.

  • Check for a function accepting exactly the input argument types. If one exists (there can be only one exact match in the set of -functions considered), use it. -(Cases involving [1], a function found in a +schema that permits untrusted users to create objects. In such situations, +cast arguments to force an exact match. (Cases involving unknown will never find a match at -this step.)

    +will never find a match at this step.)

  • CAST specification. [1][2]

  • Example 10-7. Variadic Function Resolution

    CREATE FUNCTION public.variadic_example(VARIADIC numeric[]) RETURNS int
    +  LANGUAGE sql AS 'SELECT 1';
    +CREATE FUNCTION

    + +This function accepts, but does not require, the VARIADIC keyword. It +tolerates both integer and numeric arguments: + +

    SELECT public.variadic_example(0),
    +       public.variadic_example(0.0),
    +       public.variadic_example(VARIADIC array[0.0]);
    + variadic_example | variadic_example | variadic_example
    +------------------+------------------+------------------
    +                1 |                1 |                1
    +(1 row)

    + +However, the first and second calls will prefer more-specific functions, if +available: + +

    CREATE FUNCTION public.variadic_example(numeric) RETURNS int
    +  LANGUAGE sql AS 'SELECT 2';
    +CREATE FUNCTION
    +
    +CREATE FUNCTION public.variadic_example(int) RETURNS int
    +  LANGUAGE sql AS 'SELECT 3';
    +CREATE FUNCTION
    +
    +SELECT public.variadic_example(0),
    +       public.variadic_example(0.0),
    +       public.variadic_example(VARIADIC array[0.0]);
    + variadic_example | variadic_example | variadic_example
    +------------------+------------------+------------------
    +                3 |                2 |                1
    +(1 row)

    + +Given the default configuration and only the first function existing, the +first and second calls are insecure. Any user could intercept them by +creating the second or third function. By matching the argument type exactly +and using the VARIADIC keyword, the third call is secure.

    Example 10-7. Substring Function Type ResolutionExample 10-8. Substring Function Type Resolution

    There are several [1]

    The hazard does not arise with a non-schema-qualified name, because a + search path containing schemas that permit untrusted users to create + objects is not a secure schema usage + pattern. +

    [2]
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation
    PostgreSQL 9.5.10 DocumentationPostgreSQL 9.5.14 Documentation

    Check for an operator accepting exactly the input argument types. If one exists (there can be only one exact match in the set of -operators considered), use it.

    [1] +(not typical), any operator found in a schema that permits untrusted users to +create objects. In such situations, cast arguments to force an exact match.

      Notes

      [1]

      The hazard does not arise with a non-schema-qualified name, because a + search path containing schemas that permit untrusted users to create + objects is not a secure schema usage + pattern. +