diff -Nru postgresql-9.3-9.3.20/config/perl.m4 postgresql-9.3-9.3.24/config/perl.m4 --- postgresql-9.3-9.3.20/config/perl.m4 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/config/perl.m4 2018-08-06 20:13:40.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.3-9.3.20/configure postgresql-9.3-9.3.24/configure --- postgresql-9.3-9.3.20/configure 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/configure 2018-08-06 20:13:40.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for PostgreSQL 9.3.20. +# Generated by GNU Autoconf 2.63 for PostgreSQL 9.3.24. # # Report bugs to . # @@ -598,8 +598,8 @@ # Identity of this package. PACKAGE_NAME='PostgreSQL' PACKAGE_TARNAME='postgresql' -PACKAGE_VERSION='9.3.20' -PACKAGE_STRING='PostgreSQL 9.3.20' +PACKAGE_VERSION='9.3.24' +PACKAGE_STRING='PostgreSQL 9.3.24' PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org' ac_unique_file="src/backend/access/common/heaptuple.c" @@ -1414,7 +1414,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.3.20 to adapt to many kinds of systems. +\`configure' configures PostgreSQL 9.3.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1479,7 +1479,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of PostgreSQL 9.3.20:";; + short | recursive ) echo "Configuration of PostgreSQL 9.3.24:";; esac cat <<\_ACEOF @@ -1625,7 +1625,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -PostgreSQL configure 9.3.20 +PostgreSQL configure 9.3.24 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1641,7 +1641,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.3.20, which was +It was created by PostgreSQL $as_me 9.3.24, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -4508,6 +4508,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:$LINENO: checking whether $CC supports -Wunused-command-line-argument" >&5 $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; } if test "${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+set}" = set; then @@ -4571,6 +4572,135 @@ 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:$LINENO: checking whether $CC supports -Wformat-truncation" >&5 +$as_echo_n "checking whether $CC supports -Wformat-truncation... " >&6; } +if test "${pgac_cv_prog_cc_cflags__Wformat_truncation+set}" = set; 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + pgac_cv_prog_cc_cflags__Wformat_truncation=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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:$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:$LINENO: checking whether $CC supports -Wstringop-truncation" >&5 +$as_echo_n "checking whether $CC supports -Wstringop-truncation... " >&6; } +if test "${pgac_cv_prog_cc_cflags__Wstringop_truncation+set}" = set; 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 >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + pgac_cv_prog_cc_cflags__Wstringop_truncation=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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:$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. @@ -7617,12 +7747,19 @@ { $as_echo "$as_me:$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:$LINENO: result: no" >&5 @@ -23214,7 +23351,8 @@ -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` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -23316,7 +23454,8 @@ -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` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -23416,6 +23555,143 @@ fi done +# strto[u]ll may exist but not be declared +{ $as_echo "$as_me:$LINENO: checking whether strtoll is declared" >&5 +$as_echo_n "checking whether strtoll is declared... " >&6; } +if test "${ac_cv_have_decl_strtoll+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strtoll + (void) strtoll; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_strtoll=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strtoll=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoll" >&5 +$as_echo "$ac_cv_have_decl_strtoll" >&6; } +if test "x$ac_cv_have_decl_strtoll" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOLL 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOLL 0 +_ACEOF + + +fi +{ $as_echo "$as_me:$LINENO: checking whether strtoull is declared" >&5 +$as_echo_n "checking whether strtoull is declared... " >&6; } +if test "${ac_cv_have_decl_strtoull+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strtoull + (void) strtoull; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_strtoull=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strtoull=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoull" >&5 +$as_echo "$ac_cv_have_decl_strtoull" >&6; } +if test "x$ac_cv_have_decl_strtoull" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOULL 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOULL 0 +_ACEOF + + +fi + + { $as_echo "$as_me:$LINENO: checking for builtin locking functions" >&5 $as_echo_n "checking for builtin locking functions... " >&6; } @@ -31438,7 +31714,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.3.20, which was +This file was extended by PostgreSQL $as_me 9.3.24, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31505,7 +31781,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -PostgreSQL config.status 9.3.20 +PostgreSQL config.status 9.3.24 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -Nru postgresql-9.3-9.3.20/configure.in postgresql-9.3-9.3.24/configure.in --- postgresql-9.3-9.3.20/configure.in 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/configure.in 2018-08-06 20:13:40.000000000 +0000 @@ -17,7 +17,7 @@ dnl m4_pattern_forbid(^PGAC_)dnl to catch undefined macros -AC_INIT([PostgreSQL], [9.3.20], [pgsql-bugs@postgresql.org]) +AC_INIT([PostgreSQL], [9.3.24], [pgsql-bugs@postgresql.org]) m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.63], [], [m4_fatal([Autoconf version 2.63 is required. Untested combinations of 'autoconf' and PostgreSQL versions are not @@ -430,10 +430,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. @@ -954,8 +966,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 # Functions introduced in OpenSSL 1.1.0. We used to check for # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL @@ -1145,6 +1157,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 @@ -1501,8 +1519,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]) AC_CACHE_CHECK([for builtin locking functions], pgac_cv_gcc_int_atomics, [AC_TRY_LINK([], diff -Nru postgresql-9.3-9.3.20/contrib/adminpack/adminpack.c postgresql-9.3-9.3.24/contrib/adminpack/adminpack.c --- postgresql-9.3-9.3.20/contrib/adminpack/adminpack.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/adminpack/adminpack.c 2018-08-06 20:13:40.000000000 +0000 @@ -178,7 +178,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); @@ -200,7 +200,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.3-9.3.20/contrib/auto_explain/auto_explain.c postgresql-9.3-9.3.24/contrib/auto_explain/auto_explain.c --- postgresql-9.3-9.3.20/contrib/auto_explain/auto_explain.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/auto_explain/auto_explain.c 2018-08-06 20:13:40.000000000 +0000 @@ -73,7 +73,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.3-9.3.20/contrib/btree_gist/btree_inet.c postgresql-9.3-9.3.24/contrib/btree_gist/btree_inet.c --- postgresql-9.3-9.3.20/contrib/btree_gist/btree_inet.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/btree_gist/btree_inet.c 2018-08-06 20:13:40.000000000 +0000 @@ -105,9 +105,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, @@ -124,13 +126,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.3-9.3.20/contrib/cube/cubeparse.c postgresql-9.3-9.3.24/contrib/cube/cubeparse.c --- postgresql-9.3-9.3.20/contrib/cube/cubeparse.c 2017-11-06 22:41:54.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/cube/cubeparse.c 2018-08-06 20:39:47.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.3-9.3.20/contrib/cube/cubescan.c postgresql-9.3-9.3.24/contrib/cube/cubescan.c --- postgresql-9.3-9.3.20/contrib/cube/cubescan.c 2017-11-06 22:41:54.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/cube/cubescan.c 2018-08-06 20:39:47.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, @@ -526,7 +517,7 @@ void cube_scanner_init(const char *str); void cube_scanner_finish(void); #define YY_NO_INPUT 1 -#line 530 "cubescan.c" +#line 521 "cubescan.c" #define INITIAL 0 @@ -559,19 +550,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. @@ -585,6 +576,10 @@ #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -618,7 +613,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, @@ -629,7 +624,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; \ @@ -642,7 +637,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) \ { \ @@ -697,7 +692,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 \ @@ -707,9 +702,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) ) { @@ -741,9 +736,9 @@ #line 50 "cubescan.l" -#line 745 "cubescan.c" +#line 740 "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); @@ -759,7 +754,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; @@ -771,7 +766,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 ); @@ -840,7 +835,7 @@ #line 61 "cubescan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 844 "cubescan.c" +#line 839 "cubescan.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -984,9 +979,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] ) @@ -1015,7 +1010,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++); @@ -1042,7 +1037,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; @@ -1055,7 +1050,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( @@ -1097,9 +1092,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()" ); @@ -1118,14 +1113,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; @@ -1137,7 +1132,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; @@ -1150,10 +1145,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; @@ -1165,12 +1160,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) @@ -1195,7 +1194,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( ) ) @@ -1219,7 +1218,7 @@ case EOB_ACT_END_OF_FILE: { if ( cube_yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1320,7 +1319,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. @@ -1467,7 +1466,7 @@ */ static void cube_yyensure_buffer_stack (void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -1475,15 +1474,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; @@ -1492,7 +1491,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 @@ -1512,7 +1511,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 ) { @@ -1522,7 +1521,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 ) @@ -1531,7 +1530,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; @@ -1554,7 +1553,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 @@ -1564,15 +1563,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()" ); @@ -1598,9 +1597,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 ); } @@ -1628,7 +1627,7 @@ */ int cube_yyget_lineno (void) { - + return cube_yylineno; } @@ -1651,7 +1650,7 @@ /** Get the length of the current token. * */ -yy_size_t cube_yyget_leng (void) +int cube_yyget_leng (void) { return cube_yyleng; } @@ -1666,29 +1665,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) @@ -1696,9 +1695,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) @@ -1707,10 +1706,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; @@ -1719,8 +1718,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 @@ -1758,7 +1757,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]; } @@ -1767,7 +1767,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1777,11 +1777,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 @@ -1789,17 +1790,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 60 "cubescan.l" +#line 61 "cubescan.l" diff -Nru postgresql-9.3-9.3.20/contrib/dblink/Makefile postgresql-9.3-9.3.24/contrib/dblink/Makefile --- postgresql-9.3-9.3.20/contrib/dblink/Makefile 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/dblink/Makefile 2018-08-06 20:13:40.000000000 +0000 @@ -3,7 +3,7 @@ MODULE_big = dblink OBJS = dblink.o PG_CPPFLAGS = -I$(libpq_srcdir) -SHLIB_LINK = $(libpq) +SHLIB_LINK_INTERNAL = $(libpq) SHLIB_PREREQS = submake-libpq EXTENSION = dblink diff -Nru postgresql-9.3-9.3.20/contrib/earthdistance/expected/earthdistance.out postgresql-9.3-9.3.24/contrib/earthdistance/expected/earthdistance.out --- postgresql-9.3-9.3.20/contrib/earthdistance/expected/earthdistance.out 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/earthdistance/expected/earthdistance.out 2018-08-06 20:13:40.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.3-9.3.20/contrib/earthdistance/sql/earthdistance.sql postgresql-9.3-9.3.24/contrib/earthdistance/sql/earthdistance.sql --- postgresql-9.3-9.3.20/contrib/earthdistance/sql/earthdistance.sql 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/earthdistance/sql/earthdistance.sql 2018-08-06 20:13:40.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.3-9.3.20/contrib/hstore/hstore_io.c postgresql-9.3-9.3.24/contrib/hstore/hstore_io.c --- postgresql-9.3-9.3.20/contrib/hstore/hstore_io.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/hstore/hstore_io.c 2018-08-06 20:13:40.000000000 +0000 @@ -339,7 +339,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.3-9.3.20/contrib/ltree/expected/ltree.out postgresql-9.3-9.3.24/contrib/ltree/expected/ltree.out --- postgresql-9.3-9.3.20/contrib/ltree/expected/ltree.out 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/ltree/expected/ltree.out 2018-08-06 20:13:40.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.3-9.3.20/contrib/ltree/ltree_op.c postgresql-9.3-9.3.24/contrib/ltree/ltree_op.c --- postgresql-9.3-9.3.20/contrib/ltree/ltree_op.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/ltree/ltree_op.c 2018-08-06 20:13:40.000000000 +0000 @@ -421,22 +421,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) @@ -447,11 +459,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; @@ -462,6 +475,8 @@ ptr++; } + /* Now compute size of result ... */ + reslen = LTREE_HDRSIZE; l1 = LTREE_FIRST(*a); for (i = 0; i < num; i++) { @@ -469,6 +484,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.3-9.3.20/contrib/ltree/sql/ltree.sql postgresql-9.3-9.3.24/contrib/ltree/sql/ltree.sql --- postgresql-9.3-9.3.20/contrib/ltree/sql/ltree.sql 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/ltree/sql/ltree.sql 2018-08-06 20:13:40.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.3-9.3.20/contrib/oid2name/Makefile postgresql-9.3-9.3.24/contrib/oid2name/Makefile --- postgresql-9.3-9.3.20/contrib/oid2name/Makefile 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/oid2name/Makefile 2018-08-06 20:13:40.000000000 +0000 @@ -7,7 +7,7 @@ OBJS = oid2name.o 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.3-9.3.20/contrib/oid2name/oid2name.c postgresql-9.3-9.3.24/contrib/oid2name/oid2name.c --- postgresql-9.3-9.3.20/contrib/oid2name/oid2name.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/oid2name/oid2name.c 2018-08-06 20:13:40.000000000 +0000 @@ -16,6 +16,7 @@ extern char *optarg; +#include "fe_utils/connect.h" #include "libpq-fe.h" /* an extensible array to keep track of elements to show */ @@ -269,6 +270,7 @@ PGconn *conn; char *password = NULL; bool new_pass; + PGresult *res; /* * Start the connection. Loop until we have a password if requested by @@ -328,6 +330,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.3-9.3.20/contrib/pgbench/Makefile postgresql-9.3-9.3.24/contrib/pgbench/Makefile --- postgresql-9.3-9.3.20/contrib/pgbench/Makefile 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pgbench/Makefile 2018-08-06 20:13:40.000000000 +0000 @@ -7,7 +7,8 @@ OBJS = pgbench.o PG_CPPFLAGS = -I$(libpq_srcdir) -PG_LIBS = $(libpq_pgport) $(PTHREAD_LIBS) +PG_LIBS_INTERNAL = $(libpq_pgport) +PG_LIBS = $(PTHREAD_LIBS) ifdef USE_PGXS PG_CONFIG = pg_config diff -Nru postgresql-9.3-9.3.20/contrib/pgcrypto/expected/rijndael.out postgresql-9.3-9.3.24/contrib/pgcrypto/expected/rijndael.out --- postgresql-9.3-9.3.20/contrib/pgcrypto/expected/rijndael.out 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pgcrypto/expected/rijndael.out 2018-08-06 20:13:40.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.3-9.3.20/contrib/pgcrypto/pgp-armor.c postgresql-9.3-9.3.24/contrib/pgcrypto/pgp-armor.c --- postgresql-9.3-9.3.20/contrib/pgcrypto/pgp-armor.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pgcrypto/pgp-armor.c 2018-08-06 20:13:40.000000000 +0000 @@ -43,7 +43,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; @@ -93,7 +93,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; @@ -161,7 +161,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 @@ -170,7 +170,7 @@ } static unsigned -b64_dec_len(unsigned srclen) +pg_base64_dec_len(unsigned srclen) { return (srclen * 3) >> 2; } @@ -215,7 +215,7 @@ memcpy(pos, armor_header, n); pos += n; - n = b64_encode(src, len, pos); + n = pg_base64_encode(src, len, pos); pos += n; if (*(pos - 1) != '\n') @@ -356,12 +356,12 @@ 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 */ - res = b64_decode(base64_start, base64_end - base64_start, dst); + res = pg_base64_decode(base64_start, base64_end - base64_start, dst); /* check crc */ if (res >= 0 && crc24(dst, res) != crc) @@ -373,11 +373,11 @@ unsigned pgp_armor_enc_len(unsigned len) { - return b64_enc_len(len) + strlen(armor_header) + strlen(armor_footer) + 16; + return pg_base64_enc_len(len) + strlen(armor_header) + strlen(armor_footer) + 16; } unsigned pgp_armor_dec_len(unsigned len) { - return b64_dec_len(len); + return pg_base64_dec_len(len); } diff -Nru postgresql-9.3-9.3.20/contrib/pgcrypto/sql/rijndael.sql postgresql-9.3-9.3.24/contrib/pgcrypto/sql/rijndael.sql --- postgresql-9.3-9.3.20/contrib/pgcrypto/sql/rijndael.sql 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pgcrypto/sql/rijndael.sql 2018-08-06 20:13:40.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.3-9.3.20/contrib/pg_upgrade/controldata.c postgresql-9.3-9.3.24/contrib/pg_upgrade/controldata.c --- postgresql-9.3-9.3.20/contrib/pg_upgrade/controldata.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/controldata.c 2018-08-06 20:13:40.000000000 +0000 @@ -57,6 +57,7 @@ bool got_date_is_int = false; bool got_float8_pass_by_value = false; bool got_data_checksum_version = false; + bool got_cluster_state = false; char *lc_collate = NULL; char *lc_ctype = NULL; char *lc_monetary = NULL; @@ -110,6 +111,65 @@ pg_putenv("LC_ALL", NULL); pg_putenv("LC_MESSAGES", "C"); + /* + * Check for clean shutdown + */ + if (!live_check || cluster == &new_cluster) + { + /* only pg_controldata outputs the cluster state */ + snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/pg_controldata\" \"%s\"" SYSTEMQUOTE, + cluster->bindir, cluster->pgdata); + fflush(stdout); + fflush(stderr); + + if ((output = popen(cmd, "r")) == NULL) + pg_log(PG_FATAL, "could not get control data using %s: %s\n", + cmd, strerror(errno)); + + /* we have the result of cmd in "output". so parse it line by line now */ + while (fgets(bufin, sizeof(bufin), output)) + { + if ((p = strstr(bufin, "Database cluster state:")) != NULL) + { + p = strchr(p, ':'); + + if (p == NULL || strlen(p) <= 1) + pg_log(PG_FATAL, "%d: database cluster state problem\n", __LINE__); + + p++; /* remove ':' char */ + + /* + * We checked earlier for a postmaster lock file, and if we found + * one, we tried to start/stop the server to replay the WAL. However, + * pg_ctl -m immediate doesn't leave a lock file, but does require + * WAL replay, so we check here that the server was shut down cleanly, + * from the controldata perspective. + */ + /* remove leading spaces */ + while (*p == ' ') + p++; + if (strcmp(p, "shut down\n") != 0) + { + if (cluster == &old_cluster) + pg_log(PG_FATAL, "The source cluster was not shut down cleanly.\n"); + else + pg_log(PG_FATAL, "The target cluster was not shut down cleanly.\n"); + } + got_cluster_state = true; + } + } + + pclose(output); + + if (!got_cluster_state) + { + if (cluster == &old_cluster) + pg_log(PG_FATAL, "The source cluster lacks cluster state information:\n"); + else + pg_log(PG_FATAL, "The target cluster lacks cluster state information:\n"); + } + } + snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/%s \"%s\"" SYSTEMQUOTE, cluster->bindir, live_check ? "pg_controldata\"" : "pg_resetxlog\" -n", diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/dump.c postgresql-9.3-9.3.24/contrib/pg_upgrade/dump.c --- postgresql-9.3-9.3.20/contrib/pg_upgrade/dump.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/dump.c 2018-08-06 20:13:40.000000000 +0000 @@ -18,7 +18,6 @@ generate_old_dump(void) { int dbnum; - mode_t old_umask; prep_status("Creating dump of global objects"); @@ -33,13 +32,6 @@ prep_status("Creating dump of database schemas\n"); - /* - * Set umask for this function, all functions it calls, and all - * subprocesses/threads it creates. We can't use fopen_priv() - * as Windows uses threads and umask is process-global. - */ - old_umask = umask(S_IRWXG | S_IRWXO); - /* create per-db dump files */ for (dbnum = 0; dbnum < old_cluster.dbarr.ndbs; dbnum++) { @@ -74,8 +66,6 @@ while (reap_child(true) == true) ; - umask(old_umask); - end_progress_output(); check_ok(); } diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/file.c postgresql-9.3-9.3.24/contrib/pg_upgrade/file.c --- postgresql-9.3-9.3.20/contrib/pg_upgrade/file.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/file.c 2018-08-06 20:13:40.000000000 +0000 @@ -239,17 +239,3 @@ return 0; } #endif - - -/* fopen() file with no group/other permissions */ -FILE * -fopen_priv(const char *path, const char *mode) -{ - mode_t old_umask = umask(S_IRWXG | S_IRWXO); - FILE *fp; - - fp = fopen(path, mode); - umask(old_umask); - - return fp; -} diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/pg_upgrade.c postgresql-9.3-9.3.24/contrib/pg_upgrade/pg_upgrade.c --- postgresql-9.3-9.3.20/contrib/pg_upgrade/pg_upgrade.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/pg_upgrade.c 2018-08-06 20:13:40.000000000 +0000 @@ -83,6 +83,9 @@ char *deletion_script_file_name = NULL; bool live_check = false; + /* Ensure that all files created by pg_upgrade are non-world-readable */ + umask(S_IRWXG | S_IRWXO); + parseCommandLine(argc, argv); get_restricted_token(os_info.progname); @@ -364,7 +367,8 @@ * start, assume the server is running. If the pid file is left over * from a server crash, this also allows any committed transactions * stored in the WAL to be replayed so they are not lost, because WAL - * files are not transfered from old to new servers. + * files are not transfered from old to new servers. We later check + * for a clean shutdown. */ if (start_postmaster(&old_cluster, false)) stop_postmaster(false); @@ -435,13 +439,13 @@ prepare_new_databases(void) { /* - * We set autovacuum_freeze_max_age to its maximum value so autovacuum - * does not launch here and delete clog files, before the frozen xids are - * set. + * Before we restore anything, set frozenxids of initdb-created tables. */ - set_frozenxids(false); + /* + * Now restore global objects (roles and tablespaces). + */ prep_status("Restoring global objects in the new cluster"); /* @@ -679,14 +683,25 @@ /* * set_frozenxids() * - * We have frozen all xids, so set relfrozenxid and datfrozenxid - * to be the old cluster's xid counter, which we just set in the new - * cluster. User-table frozenxid values will be set by pg_dumpall - * --binary-upgrade, but objects not set by the pg_dump must have - * proper frozen counters. + * This is called on the new cluster before we restore anything, with + * minmxid_only = false. Its purpose is to ensure that all initdb-created + * vacuumable tables have relfrozenxid/relminmxid matching the old cluster's + * xid/mxid counters. We also initialize the datfrozenxid/datminmxid of the + * built-in databases to match. + * + * As we create user tables later, their relfrozenxid/relminmxid fields will + * be restored properly by the binary-upgrade restore script. Likewise for + * user-database datfrozenxid/datminmxid. However, if we're upgrading from a + * pre-9.3 database, which does not store per-table or per-DB minmxid, then + * the relminmxid/datminmxid values filled in by the restore script will just + * be zeroes. + * + * Hence, with a pre-9.3 source database, a second call occurs after + * everything is restored, with minmxid_only = true. This pass will + * initialize all tables and databases, both those made by initdb and user + * objects, with the desired minmxid value. frozenxid values are left alone. */ -static -void +static void set_frozenxids(bool minmxid_only) { int dbnum; diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/pg_upgrade.h postgresql-9.3-9.3.24/contrib/pg_upgrade/pg_upgrade.h --- postgresql-9.3-9.3.20/contrib/pg_upgrade/pg_upgrade.h 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/pg_upgrade.h 2018-08-06 20:13:40.000000000 +0000 @@ -385,7 +385,9 @@ const char *dst); void check_hard_link(void); -FILE *fopen_priv(const char *path, const char *mode); + +/* fopen_priv() is no longer different from fopen() */ +#define fopen_priv(path, mode) fopen(path, mode) /* function.c */ diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/server.c postgresql-9.3-9.3.24/contrib/pg_upgrade/server.c --- postgresql-9.3-9.3.20/contrib/pg_upgrade/server.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/server.c 2018-08-06 20:13:40.000000000 +0000 @@ -9,6 +9,7 @@ #include "postgres_fe.h" +#include "fe_utils/connect.h" #include "pg_upgrade.h" @@ -39,6 +40,8 @@ exit(1); } + PQclear(executeQueryOrDie(conn, ALWAYS_SECURE_SEARCH_PATH_SQL)); + return conn; } diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/tablespace.c postgresql-9.3-9.3.24/contrib/pg_upgrade/tablespace.c --- postgresql-9.3-9.3.20/contrib/pg_upgrade/tablespace.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/tablespace.c 2018-08-06 20:13:40.000000000 +0000 @@ -37,7 +37,7 @@ * get_tablespace_paths() * * Scans pg_tablespace and returns a malloc'ed array of all tablespace - * paths. Its the caller's responsibility to free the array. + * paths. It's the caller's responsibility to free the array. */ static void get_tablespace_paths(void) diff -Nru postgresql-9.3-9.3.20/contrib/pg_upgrade/test.sh postgresql-9.3-9.3.24/contrib/pg_upgrade/test.sh --- postgresql-9.3-9.3.20/contrib/pg_upgrade/test.sh 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_upgrade/test.sh 2018-08-06 20:13:40.000000000 +0000 @@ -32,7 +32,7 @@ testhost=`uname -s` case $testhost in - MINGW*) + MINGW*|MSYS*) LISTEN_ADDRESSES="localhost" PGHOST=localhost ;; @@ -42,20 +42,18 @@ # script; the outcome mimics pg_regress.c:make_temp_sockdir(). PGHOST=$PG_REGRESS_SOCK_DIR if [ "x$PGHOST" = x ]; then - { - dir=`(umask 077 && - mktemp -d /tmp/pg_upgrade_check-XXXXXX) 2>/dev/null` && - [ -d "$dir" ] - } || - { + set +e + dir=`(umask 077 && + mktemp -d /tmp/pg_upgrade_check-XXXXXX) 2>/dev/null` + if [ ! -d "$dir" ]; then dir=/tmp/pg_upgrade_check-$$-$RANDOM (umask 077 && mkdir "$dir") - } || - { - echo "could not create socket temporary directory in \"/tmp\"" - exit 1 - } - + if [ ! -d "$dir" ]; then + echo "could not create socket temporary directory in \"/tmp\"" + exit 1 + fi + fi + set -e PGHOST=$dir trap 'rm -rf "$PGHOST"' 0 trap 'exit 3' 1 2 13 15 diff -Nru postgresql-9.3-9.3.20/contrib/pg_xlogdump/compat.c postgresql-9.3-9.3.24/contrib/pg_xlogdump/compat.c --- postgresql-9.3-9.3.20/contrib/pg_xlogdump/compat.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/pg_xlogdump/compat.c 2018-08-06 20:13:40.000000000 +0000 @@ -64,9 +64,11 @@ strftime(zone, sizeof(zone), "%Z", ltime); #ifdef HAVE_INT64_TIMESTAMP - sprintf(buf, "%s.%06d %s", ts, (int) (dt % USECS_PER_SEC), zone); + snprintf(buf, sizeof(buf), + "%s.%06d %s", ts, (int) (dt % USECS_PER_SEC), zone); #else - sprintf(buf, "%s.%.6f %s", ts, fabs(dt - floor(dt)), zone); + snprintf(buf, sizeof(buf), + "%s.%.6f %s", ts, fabs(dt - floor(dt)), zone); #endif return buf; diff -Nru postgresql-9.3-9.3.20/contrib/postgres_fdw/Makefile postgresql-9.3-9.3.24/contrib/postgres_fdw/Makefile --- postgresql-9.3-9.3.20/contrib/postgres_fdw/Makefile 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/postgres_fdw/Makefile 2018-08-06 20:13:40.000000000 +0000 @@ -4,7 +4,7 @@ OBJS = postgres_fdw.o option.o deparse.o connection.o PG_CPPFLAGS = -I$(libpq_srcdir) -SHLIB_LINK = $(libpq) +SHLIB_LINK_INTERNAL = $(libpq) SHLIB_PREREQS = submake-libpq EXTENSION = postgres_fdw diff -Nru postgresql-9.3-9.3.20/contrib/seg/segparse.c postgresql-9.3-9.3.24/contrib/seg/segparse.c --- postgresql-9.3-9.3.20/contrib/seg/segparse.c 2017-11-06 22:41:55.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/seg/segparse.c 2018-08-06 20:39:48.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" @@ -152,7 +152,7 @@ /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; + union YYSTYPE { #line 47 "segparse.y" /* yacc.c:355 */ @@ -166,6 +166,8 @@ #line 168 "segparse.c" /* yacc.c:355 */ }; + +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -179,7 +181,7 @@ /* Copy the second part of user declarations. */ -#line 183 "segparse.c" /* yacc.c:358 */ +#line 185 "segparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -1261,7 +1263,7 @@ result->l_ext = '\0'; result->u_ext = '\0'; } -#line 1265 "segparse.c" /* yacc.c:1646 */ +#line 1267 "segparse.c" /* yacc.c:1646 */ break; case 3: @@ -1282,7 +1284,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 1286 "segparse.c" /* yacc.c:1646 */ +#line 1288 "segparse.c" /* yacc.c:1646 */ break; case 4: @@ -1295,7 +1297,7 @@ result->l_ext = ( (yyvsp[-1].bnd).ext ? (yyvsp[-1].bnd).ext : '\0' ); result->u_ext = '-'; } -#line 1299 "segparse.c" /* yacc.c:1646 */ +#line 1301 "segparse.c" /* yacc.c:1646 */ break; case 5: @@ -1308,7 +1310,7 @@ result->l_ext = '-'; result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' ); } -#line 1312 "segparse.c" /* yacc.c:1646 */ +#line 1314 "segparse.c" /* yacc.c:1646 */ break; case 6: @@ -1318,7 +1320,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 1322 "segparse.c" /* yacc.c:1646 */ +#line 1324 "segparse.c" /* yacc.c:1646 */ break; case 7: @@ -1331,7 +1333,7 @@ (yyval.bnd).sigd = significant_digits((yyvsp[0].text)); (yyval.bnd).val = val; } -#line 1335 "segparse.c" /* yacc.c:1646 */ +#line 1337 "segparse.c" /* yacc.c:1646 */ break; case 8: @@ -1344,7 +1346,7 @@ (yyval.bnd).sigd = significant_digits((yyvsp[0].text)); (yyval.bnd).val = val; } -#line 1348 "segparse.c" /* yacc.c:1646 */ +#line 1350 "segparse.c" /* yacc.c:1646 */ break; case 9: @@ -1357,11 +1359,11 @@ (yyval.bnd).sigd = significant_digits((yyvsp[0].text)); (yyval.bnd).val = val; } -#line 1361 "segparse.c" /* yacc.c:1646 */ +#line 1363 "segparse.c" /* yacc.c:1646 */ break; -#line 1365 "segparse.c" /* yacc.c:1646 */ +#line 1367 "segparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff -Nru postgresql-9.3-9.3.20/contrib/seg/segscan.c postgresql-9.3-9.3.24/contrib/seg/segscan.c --- postgresql-9.3-9.3.20/contrib/seg/segscan.c 2017-11-06 22:41:55.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/seg/segscan.c 2018-08-06 20:39:48.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, @@ -526,7 +517,7 @@ void seg_scanner_init(const char *str); void seg_scanner_finish(void); #define YY_NO_INPUT 1 -#line 530 "segscan.c" +#line 521 "segscan.c" #define INITIAL 0 @@ -559,19 +550,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. @@ -585,6 +576,10 @@ #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -618,7 +613,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, @@ -629,7 +624,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; \ @@ -642,7 +637,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) \ { \ @@ -697,7 +692,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 \ @@ -707,9 +702,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) ) { @@ -741,9 +736,9 @@ #line 49 "segscan.l" -#line 745 "segscan.c" +#line 740 "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); @@ -759,7 +754,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; @@ -771,7 +766,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 ); @@ -840,7 +835,7 @@ #line 60 "segscan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 844 "segscan.c" +#line 839 "segscan.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -984,9 +979,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] ) @@ -1015,7 +1010,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++); @@ -1042,7 +1037,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; @@ -1055,7 +1050,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( @@ -1097,9 +1092,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()" ); @@ -1118,14 +1113,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; @@ -1137,7 +1132,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; @@ -1150,10 +1145,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; @@ -1165,12 +1160,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) @@ -1195,7 +1194,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( ) ) @@ -1219,7 +1218,7 @@ case EOB_ACT_END_OF_FILE: { if ( seg_yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1320,7 +1319,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. @@ -1467,7 +1466,7 @@ */ static void seg_yyensure_buffer_stack (void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -1475,15 +1474,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; @@ -1492,7 +1491,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 @@ -1512,7 +1511,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 ) { @@ -1522,7 +1521,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 ) @@ -1531,7 +1530,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; @@ -1554,7 +1553,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 @@ -1564,15 +1563,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()" ); @@ -1598,9 +1597,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 ); } @@ -1628,7 +1627,7 @@ */ int seg_yyget_lineno (void) { - + return seg_yylineno; } @@ -1651,7 +1650,7 @@ /** Get the length of the current token. * */ -yy_size_t seg_yyget_leng (void) +int seg_yyget_leng (void) { return seg_yyleng; } @@ -1666,29 +1665,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) @@ -1696,9 +1695,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) @@ -1707,10 +1706,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; @@ -1719,8 +1718,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 @@ -1758,7 +1757,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]; } @@ -1767,7 +1767,7 @@ #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -1777,11 +1777,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 @@ -1789,17 +1790,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 59 "segscan.l" +#line 60 "segscan.l" diff -Nru postgresql-9.3-9.3.20/contrib/spi/Makefile postgresql-9.3-9.3.24/contrib/spi/Makefile --- postgresql-9.3-9.3.20/contrib/spi/Makefile 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/spi/Makefile 2018-08-06 20:13:40.000000000 +0000 @@ -16,8 +16,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.3-9.3.20/contrib/start-scripts/macos/org.postgresql.postgres.plist postgresql-9.3-9.3.24/contrib/start-scripts/macos/org.postgresql.postgres.plist --- postgresql-9.3-9.3.20/contrib/start-scripts/macos/org.postgresql.postgres.plist 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/start-scripts/macos/org.postgresql.postgres.plist 2018-08-06 20:13:40.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.3-9.3.20/contrib/start-scripts/macos/postgres-wrapper.sh postgresql-9.3-9.3.24/contrib/start-scripts/macos/postgres-wrapper.sh --- postgresql-9.3-9.3.20/contrib/start-scripts/macos/postgres-wrapper.sh 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/start-scripts/macos/postgres-wrapper.sh 2018-08-06 20:13:40.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.3-9.3.20/contrib/start-scripts/macos/README postgresql-9.3-9.3.24/contrib/start-scripts/macos/README --- postgresql-9.3-9.3.20/contrib/start-scripts/macos/README 1970-01-01 00:00:00.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/start-scripts/macos/README 2018-08-06 20:13:40.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.3-9.3.20/contrib/start-scripts/osx/README postgresql-9.3-9.3.24/contrib/start-scripts/osx/README --- postgresql-9.3-9.3.20/contrib/start-scripts/osx/README 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/start-scripts/osx/README 2018-08-06 20:13:40.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.3-9.3.20/contrib/vacuumlo/Makefile postgresql-9.3-9.3.24/contrib/vacuumlo/Makefile --- postgresql-9.3-9.3.20/contrib/vacuumlo/Makefile 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/vacuumlo/Makefile 2018-08-06 20:13:40.000000000 +0000 @@ -7,7 +7,7 @@ OBJS = vacuumlo.o 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.3-9.3.20/contrib/vacuumlo/vacuumlo.c postgresql-9.3-9.3.24/contrib/vacuumlo/vacuumlo.c --- postgresql-9.3-9.3.20/contrib/vacuumlo/vacuumlo.c 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/contrib/vacuumlo/vacuumlo.c 2018-08-06 20:13:40.000000000 +0000 @@ -21,6 +21,7 @@ #include #endif +#include "fe_utils/connect.h" #include "libpq-fe.h" #define atooid(x) ((Oid) strtoul((x), NULL, 10)) @@ -138,11 +139,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.3-9.3.20/COPYRIGHT postgresql-9.3-9.3.24/COPYRIGHT --- postgresql-9.3-9.3.20/COPYRIGHT 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/COPYRIGHT 2018-08-06 20:13:40.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.3-9.3.20/debian/changelog postgresql-9.3-9.3.24/debian/changelog --- postgresql-9.3-9.3.20/debian/changelog 2017-11-13 14:59:51.000000000 +0000 +++ postgresql-9.3-9.3.24/debian/changelog 2018-08-15 18:34:53.000000000 +0000 @@ -1,3 +1,101 @@ +postgresql-9.3 (9.3.24-0ubuntu0.14.04) trusty-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) + - d/libecpg-dev.install: Add new pgtypes header. + - d/libpgtypes3.symbols: Add new pgtypes symbol. + - Details about these and other changes can be found at + https://www.postgresql.org/docs/9.3/static/release-9-3-24.html + + -- Christian Ehrhardt Tue, 14 Aug 2018 14:49:12 +0200 + +postgresql-9.3 (9.3.23-0ubuntu0.14.04) trusty; urgency=medium + + * New upstream release (LP: #1769888) + - A dump/restore is not required for those running 9.3.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.3/static/release-9-3-23.html + + -- Christian Ehrhardt Tue, 08 May 2018 15:17:51 +0200 + +postgresql-9.3 (9.3.22-0ubuntu0.14.04) trusty-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.3/static/release-9-3-22.html + + -- Christian Ehrhardt Wed, 28 Feb 2018 09:59:05 +0100 + +postgresql-9.3 (9.3.21-0ubuntu0.14.04) trusty-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.3/static/release-9-3-21.html + + -- Christian Ehrhardt Tue, 06 Feb 2018 15:19:51 +0100 + postgresql-9.3 (9.3.20-0ubuntu0.14.04) trusty-security; urgency=medium * New upstream release (LP: #1730661) diff -Nru postgresql-9.3-9.3.20/debian/libecpg-dev.install postgresql-9.3-9.3.24/debian/libecpg-dev.install --- postgresql-9.3-9.3.20/debian/libecpg-dev.install 2014-03-18 07:10:26.000000000 +0000 +++ postgresql-9.3-9.3.24/debian/libecpg-dev.install 2018-08-14 12:49:12.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.3-9.3.20/debian/libpgtypes3.symbols postgresql-9.3-9.3.24/debian/libpgtypes3.symbols --- postgresql-9.3-9.3.20/debian/libpgtypes3.symbols 2014-03-18 07:10:26.000000000 +0000 +++ postgresql-9.3-9.3.24/debian/libpgtypes3.symbols 2018-08-14 12:49:12.000000000 +0000 @@ -1,4 +1,5 @@ libpgtypes.so.3 libpgtypes3 #MINVER# + PGTYPESchar_free@Base 9.3.24 PGTYPESdate_dayofweek@Base 0 PGTYPESdate_defmt_asc@Base 0 PGTYPESdate_fmt_asc@Base 0 diff -Nru postgresql-9.3-9.3.20/doc/bug.template postgresql-9.3-9.3.24/doc/bug.template --- postgresql-9.3-9.3.20/doc/bug.template 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/bug.template 2018-08-06 20:13:40.000000000 +0000 @@ -27,7 +27,7 @@ Operating System (example: Linux 2.4.18) : - PostgreSQL version (example: PostgreSQL 9.3.20): PostgreSQL 9.3.20 + PostgreSQL version (example: PostgreSQL 9.3.24): PostgreSQL 9.3.24 Compiler used (example: gcc 3.3.5) : diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/acronyms.sgml postgresql-9.3-9.3.24/doc/src/sgml/acronyms.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/acronyms.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/acronyms.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -71,7 +71,7 @@ CPAN - Comprehensive Perl Archive Network + Comprehensive Perl Archive Network diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/backup.sgml postgresql-9.3-9.3.24/doc/src/sgml/backup.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/backup.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/backup.sgml 2018-08-06 20:13:40.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. @@ -110,9 +110,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 @@ -140,7 +140,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 @@ -200,11 +200,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 @@ -1083,7 +1083,7 @@ in the archive; it must return nonzero when so asked. This is not an error condition. 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.3-9.3.20/doc/src/sgml/config.sgml postgresql-9.3-9.3.24/doc/src/sgml/config.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/config.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/config.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -4891,6 +4891,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 @@ -4900,10 +4907,6 @@ current_schemas shows how the items appearing in search_path were resolved. - - - For more information on schema handling, see . - diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/contrib.sgml postgresql-9.3-9.3.24/doc/src/sgml/contrib.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/contrib.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/contrib.sgml 2018-08-06 20:13:40.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.3-9.3.20/doc/src/sgml/contrib-spi.sgml postgresql-9.3-9.3.24/doc/src/sgml/contrib-spi.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/contrib-spi.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/contrib-spi.sgml 2018-08-06 20:13:40.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.3-9.3.20/doc/src/sgml/datatype.sgml postgresql-9.3-9.3.24/doc/src/sgml/datatype.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/datatype.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/datatype.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -60,7 +60,7 @@ bit varying [ (n) ] - varbit + varbit [ (n) ] variable-length bit string @@ -494,15 +494,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. @@ -2658,19 +2657,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 @@ -2721,6 +2707,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. + + @@ -3047,6 +3060,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 @@ -3054,12 +3081,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.3-9.3.20/doc/src/sgml/dblink.sgml postgresql-9.3-9.3.24/doc/src/sgml/dblink.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/dblink.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/dblink.sgml 2018-08-06 20:13:40.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.3-9.3.20/doc/src/sgml/ddl.sgml postgresql-9.3-9.3.24/doc/src/sgml/ddl.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/ddl.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/ddl.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -1726,6 +1726,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 @@ -1842,8 +1856,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; @@ -1896,50 +1911,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. + @@ -1962,7 +2007,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.3-9.3.20/doc/src/sgml/dml.sgml postgresql-9.3-9.3.24/doc/src/sgml/dml.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/dml.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/dml.sgml 2018-08-06 20:13:40.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.3-9.3.20/doc/src/sgml/ecpg.sgml postgresql-9.3-9.3.24/doc/src/sgml/ecpg.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/ecpg.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/ecpg.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -185,6 +185,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; @@ -264,8 +276,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; @@ -1059,6 +1074,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; @@ -1113,6 +1129,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(); @@ -1187,6 +1204,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; @@ -1626,7 +1644,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 @@ -1853,6 +1871,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; @@ -1898,11 +1917,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 @@ -1976,6 +2007,7 @@ The numeric value will be printed with dscale decimal digits, with rounding applied if necessary. + The result must be freed with PGTYPESchar_free(). @@ -2363,9 +2395,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(). @@ -2788,6 +2821,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(). @@ -3296,6 +3330,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(). @@ -4283,6 +4318,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; @@ -4444,6 +4480,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; @@ -5865,6 +5902,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); @@ -5994,6 +6032,7 @@ TestCpp::TestCpp() { EXEC SQL CONNECT TO testdb1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; } void Test::test() @@ -6073,6 +6112,7 @@ db_connect() { EXEC SQL CONNECT TO testdb1; + EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT; } void @@ -6466,12 +6506,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; @@ -7072,6 +7114,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 */ @@ -7629,6 +7672,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; @@ -7784,6 +7828,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.3-9.3.20/doc/src/sgml/extend.sgml postgresql-9.3-9.3.24/doc/src/sgml/extend.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/extend.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/extend.sgml 2018-08-06 20:13:40.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.3-9.3.20/doc/src/sgml/external-projects.sgml postgresql-9.3-9.3.24/doc/src/sgml/external-projects.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/external-projects.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/external-projects.sgml 2018-08-06 20:13:40.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.3-9.3.20/doc/src/sgml/func.sgml postgresql-9.3-9.3.24/doc/src/sgml/func.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/func.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/func.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -9499,6 +9499,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> @@ -11059,7 +11077,7 @@ - array_fill(anyelement, int[], + array_fill(anyelement, int[] , int[]) diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/high-availability.sgml postgresql-9.3-9.3.24/doc/src/sgml/high-availability.sgml --- postgresql-9.3-9.3.20/doc/src/sgml/high-availability.sgml 2017-11-06 22:15:48.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/high-availability.sgml 2018-08-06 20:13:40.000000000 +0000 @@ -1261,7 +1261,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.3-9.3.20/doc/src/sgml/html/acronyms.html postgresql-9.3-9.3.24/doc/src/sgml/html/acronyms.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/acronyms.html 2017-11-06 22:40:40.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/acronyms.html 2018-08-06 20:38:33.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Comprehensive Perl Archive Network diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/admin.html postgresql-9.3-9.3.24/doc/src/sgml/html/admin.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/admin.html 2017-11-06 22:39:39.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/admin.html 2018-08-06 20:37:33.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

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

20.5. Function and Trigger SecurityFunction Security
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Options

Notes

Examples

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

Name

Synopsis

Options

Environment

Notes

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

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

Options

Environment

Notes

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Notes

Example

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Environment

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Environment

Files

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Options

Environment

Notes

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Environment

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Exit Status

Environment

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description @@ -208,7 +208,7 @@ >

Options

Environment

Notes

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Notes

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Environment

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

General Purpose

Semi-internal Options

Options for Single-User Mode

Environment

Diagnostics

Notes

Usage

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Exit Status

Usage

psql testdb -psql (9.3.20) +psql (9.3.24) 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. @@ -5840,7 +5870,7 @@ >

Advanced Features

Command-Line Editing

Files

Notes

Notes for Windows Users

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Options

Environment

Diagnostics

Notes

Examples

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.2.1. Configuration Parameters

F.2.2. Author

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Occasionally, users have wondered why host names are handled diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/auth-username-maps.html postgresql-9.3-9.3.24/doc/src/sgml/html/auth-username-maps.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/auth-username-maps.html 2017-11-06 22:39:36.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/auth-username-maps.html 2018-08-06 20:37:31.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.3.1. Configuration Parameters

F.3.2. Example

F.3.3. Author

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
> outfiledumpfile

@@ -301,14 +301,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 @@ -534,7 +544,7 @@ >pg_dumpall > outfiledumpfile

@@ -547,7 +557,7 @@ >psql -f infiledumpfile postgres

diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/backup-file.html postgresql-9.3-9.3.24/doc/src/sgml/html/backup-file.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/backup-file.html 2017-11-06 22:39:37.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/backup-file.html 2018-08-06 20:37:32.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

SQL

PostgreSQL-specific Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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_verbose configuration parameter, Configuration Parameters
avals, hstore Operators and Functions

B

box (data type), Boxes
bt_metap, Functions
bt_page_items, Functions
bt_page_stats, Functions

C

circle, Circles,
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_salt, gen_salt()
get_raw_page, 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_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
instr, Porting Examples
instr function, + Appendix +
int2
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
line segment, Line Segments
ll_to_earth, Cube-based Earth Distances
longitude, Cube-based Earth Distances
and locales, Behavior
lseg, Line Segments,
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_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
with user-defined C functions, Writing Code
pg_extension_config_dump, Extension Configuration Tables
pg_freespace, Functions
pg_notify, pg_notify
pg_relpages, Functions
pg_stat_statements_reset, Functions
point, Points,
polygon, Polygons,
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
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
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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.4.1. Example Usage

F.4.2. Authors

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.5.1. Example Usage

F.5.2. Authors

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

If your version is older than 9.3.20 we will almost certainly +> If your version is older than 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.6.1. Author

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

This part describes the client programming interfaces distributed diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/collation.html postgresql-9.3-9.3.24/doc/src/sgml/html/collation.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/collation.html 2017-11-06 22:39:37.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/collation.html 2018-08-06 20:37:31.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

22.2.1. Concepts

22.2.2. Managing Collations

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
.backup or .history. Also be aware that the base name of the
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/contrib-dblink-connect.html postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-connect.html
--- postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-dblink-connect.html	2017-11-06 22:40:35.000000000 +0000
+++ postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-connect.html	2018-08-06 20:38:29.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/contrib-dblink-connect-u.html postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-connect-u.html
--- postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-dblink-connect-u.html	2017-11-06 22:40:35.000000000 +0000
+++ postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-connect-u.html	2018-08-06 20:38:29.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/contrib-dblink-function.html postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-function.html
--- postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-dblink-function.html	2017-11-06 22:40:35.000000000 +0000
+++ postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-function.html	2018-08-06 20:38:29.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/contrib-dblink-get-connections.html postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-get-connections.html
--- postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-dblink-get-connections.html	2017-11-06 22:40:35.000000000 +0000
+++ postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-get-connections.html	2018-08-06 20:38:29.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Notes

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/contrib-dblink-send-query.html postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-send-query.html
--- postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-dblink-send-query.html	2017-11-06 22:40:35.000000000 +0000
+++ postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-dblink-send-query.html	2018-08-06 20:38:29.000000000 +0000
@@ -9,7 +9,7 @@
 REV="MADE"
 HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Arguments

Return Value

Examples

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
CREATE EXTENSION command. By default, the objects will be placed in your current creation - target schema, typically public. diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-prog-client.html postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-prog-client.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/contrib-prog-client.html 2017-11-06 22:40:39.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/contrib-prog-client.html 2018-08-06 20:38:33.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

8.4.1. bytea

8.4.2. bytea
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

8.8.1. Points

8.8.2. Line Segments

8.8.3. Boxes

8.8.4. Paths

8.8.5. Polygons

8.8.6. Circles

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.2. Line Segments
8.8.3. Boxes
8.8.4. Paths
8.8.5. Polygons
8.8.6. Circles
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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/datatype-oid.html postgresql-9.3-9.3.24/doc/src/sgml/html/datatype-oid.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/datatype-oid.html 2017-11-06 22:39:30.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/datatype-oid.html 2018-08-06 20:37:24.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

8.13.1. Creating XML Values

8.13.2. Encoding Handling

8.13.3. Accessing XML Values

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.7.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.3-9.3.20/doc/src/sgml/html/ddl-system-columns.html postgresql-9.3-9.3.24/doc/src/sgml/html/ddl-system-columns.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/ddl-system-columns.html 2017-11-06 22:39:29.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/ddl-system-columns.html 2018-08-06 20:37:22.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.10.1. Configuration

F.10.2. Usage

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.11.1. Configuration

F.11.2. Usage

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

J.4.1. Emacs/PSGML

J.4.2. Other Emacs Modes

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

J.5.1. Reference Pages

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

J.2.1. Linux

J.2.2. FreeBSD Installation

J.2.3. Debian Packages

J.2.4. Mac OS X

J.2.5. Manual Installation from Source

J.2.5.1. Installing OpenJade

F.12.1. Rationale

F.12.2. Usage

F.12.3. Author

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

F.13.1. Cube-based Earth Distances

F.13.2. Point-based Earth Distances

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

33.7.2.1. SQLDA Data Structure

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Compatibility

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

See Also

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

Name

Synopsis

Description

Parameters

Examples

Compatibility

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20. (Some are not actually +> 9.3.24. (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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
errno. [1][1]
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

49.3.1. What Goes Where

49.3.2. Formatting

49.3.3. Quotation Marks

49.3.4. Use of Quotes

49.3.5. Grammar and Punctuation

49.3.6. Upper Case vs. Lower Case

49.3.7. Avoid Passive Voice

49.3.8. Present vs. Past Tense

49.3.9. Type of the Object

49.3.10. Brackets

49.3.11. Assembling Error Messages

49.3.12. Reasons for Errors

49.3.13. Function Names

49.3.14. Tricky Words to Avoid

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

35.2.1. Base Types

35.2.2. Composite Types

35.2.4. Pseudo-Types

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
pgAdmin IIIpgAdmin, and there are several commercially available ones as well. diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/external-extensions.html postgresql-9.3-9.3.24/doc/src/sgml/html/external-extensions.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/external-extensions.html 2017-11-06 22:40:40.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/external-extensions.html 2018-08-06 20:38:33.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
Perl DBI driverC++ interface
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

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

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
, int[], +> [,
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

9.23.1. IN

9.23.2. NOT IN

9.23.3. ANY

9.23.4. ALL
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

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

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
9.22.6. Row-wise Comparison
9.23.1. IN
9.23.2. NOT IN
9.23.3. ANY
9.23.4. ALL
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

9.22.6. Row-wise Comparison

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.15.1. Soundex

F.15.2. Levenshtein

F.15.3. Metaphone

F.15.4. Double Metaphone

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
53.3.1. Generating Possible Plans with GEQO
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3-9.3.20/doc/src/sgml/html/functions-subquery.html postgresql-9.3-9.3.24/doc/src/sgml/html/functions-subquery.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/functions-subquery.html 2017-11-06 22:39:32.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/functions-subquery.html 2018-08-06 20:37:27.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

53.3.1. Generating Possible Plans with GEQO
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
  • PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.16.1. hstore

    F.16.2. hstore

    F.16.3. Indexes

    F.16.4. Examples

    F.16.5. Statistics

    F.16.6. Compatibility

    F.16.7. Authors

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Copyright © 1996-2017 The PostgreSQL Global Development Group

    © 1996-2018 The PostgreSQL Global Development Group


    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    15.5.1. Shared Libraries
    15.5.2. Environment Variables
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 sources can be obtained from the +> 9.3.24 sources can be obtained from the download section of our website: . You should get a file named postgresql-9.3.20.tar.gzpostgresql-9.3.24.tar.gz or postgresql-9.3.20.tar.bz2postgresql-9.3.24.tar.bz2. After you have obtained the file, unpack it:

    gunzip postgresql-9.3.20.tar.gzgunzip postgresql-9.3.24.tar.gz
     tar xf postgresql-9.3.20.tartar xf postgresql-9.3.24.tar

    (Use postgresql-9.3.20postgresql-9.3.24 under the current directory with the

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    15.5.1. Shared Libraries

    15.5.2. Environment Variables

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    16.2.1. Generated Files

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.17.1. Functions

    F.17.2. Sample Uses

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.18.1. intarray

    F.18.2. Index Support

    F.18.3. Example

    F.18.4. Benchmark

    F.18.5. Authors

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    This part contains assorted information that might be of use to diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/intro-whatis.html postgresql-9.3-9.3.24/doc/src/sgml/html/intro-whatis.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/intro-whatis.html 2017-11-06 22:39:27.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/intro-whatis.html 2018-08-06 20:37:21.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.19.1. Data Types

    F.19.2. Casts

    F.19.3. Functions and Operators

    F.19.4. Examples

    F.19.5. Bibliography

    F.19.6. Author

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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 @@ -1384,7 +1512,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 diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/largeobjects.html postgresql-9.3-9.3.24/doc/src/sgml/html/largeobjects.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/largeobjects.html 2017-11-06 22:39:40.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/largeobjects.html 2018-08-06 20:37:34.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    38.4.1. How Update Rules Work

    38.4.1.1. A First Rule Step by Step

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    38.2.2. View Rules in Non-SELECT

    38.2.3. The Power of Views in PostgreSQL
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    For more information on schema handling, see + Section 5.7. 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.7. -

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    17.4.2. Resource Limitssystemd RemoveIPC
    17.4.3. Resource Limits
    17.4.4. Linux Memory Overcommit
    17.9.3. Creating a Self-signed CertificateCreating Certificates
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    This part is about extending the server functionality with diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/server-shutdown.html postgresql-9.3-9.3.24/doc/src/sgml/html/server-shutdown.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/server-shutdown.html 2017-11-06 22:39:35.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/server-shutdown.html 2018-08-06 20:37:30.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    49.3.1. What Goes Where
    49.3.2. Formatting
    49.3.3. Quotation Marks
    49.3.4. Use of Quotes
    49.3.5. Grammar and Punctuation
    49.3.6. Upper Case vs. Lower Case
    49.3.7. Avoid Passive Voice
    49.3.8. Present vs. Past Tense
    49.3.9. Type of the Object
    49.3.10. Brackets
    49.3.11. Assembling Error Messages
    49.3.12. Reasons for Errors
    49.3.13. Function Names
    49.3.14. Tricky Words to Avoid
    49.3.15. Proper Spelling
    49.3.16. Localization
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Arguments

    Return Value

    Notes

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    This part contains reference information for the diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/sql-comment.html postgresql-9.3-9.3.24/doc/src/sgml/html/sql-comment.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/sql-comment.html 2017-11-06 22:39:49.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/sql-comment.html 2018-08-06 20:37:43.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    File Formats

    Text Format

    CSV Format

    Binary Format

    File Header

    Tuples

    File Trailer

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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 @@ -1425,7 +1430,7 @@ >

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

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

    @@ -2612,7 +2612,7 @@ >

    Temporary Tables

    Non-deferred Uniqueness Constraints

    Column Check Constraints

    Inheritance

    Zero-column Tables

    Tablespaces

    Typed Tables

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Composite Types

    Base Types

    Array Types

    Parameters

    Examples

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Examples

    Compatibility

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

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Outputs

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    pg_notify

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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

    Omitting the

    Function Calls in

    Namespace Available to

    Functional Dependencies

    Data-Modifying Statements in

    Nonstandard Clauses

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Notes

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Notes

    Examples

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    Section 10.3.

    In either notation, parameters that have default values given in the diff -Nru postgresql-9.3-9.3.20/doc/src/sgml/html/sql-syntax.html postgresql-9.3-9.3.24/doc/src/sgml/html/sql-syntax.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/sql-syntax.html 2017-11-06 22:39:28.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/sql-syntax.html 2018-08-06 20:37:22.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Outputs

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    Name

    Synopsis

    Description

    Parameters

    Notes

    Examples

    Compatibility

    See Also

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.35.1. Functions Provided

    F.35.2. Author

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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 must be the + server's certificate because it must match the server's private key. + The certificates of "root""intermediate" 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 - authority that is trusted by the clients. The root certificate should - be included in every case where

    It is not necessary to add the root certificate to + server.crt contains more than - one certificate. +>. 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 to the new file name, and add the + authentication option root.crt, - and set the 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. Certificate Revocation List (CRL) entries - are also checked if the parameter

    Intermediate certificates that chain up to existing root certificates + can also appear in the file root.crt 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. @@ -363,15 +373,6 @@ — but it will not insist that a client certificate be presented.

    Note that 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: +> command, + replacing dbhost.yourdomain.com with the + server's host name:

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

    - 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: -

    openssl req -x509 -in server.req -text -key server.key -out server.crt

    - 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL tables and indexes.[1][1]
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.38.1. Usage

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    DELETE 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.3-9.3.20/doc/src/sgml/html/trigger-example.html postgresql-9.3-9.3.24/doc/src/sgml/html/trigger-example.html --- postgresql-9.3-9.3.20/doc/src/sgml/html/trigger-example.html 2017-11-06 22:39:44.000000000 +0000 +++ postgresql-9.3-9.3.24/doc/src/sgml/html/trigger-example.html 2018-08-06 20:37:38.000000000 +0000 @@ -9,7 +9,7 @@ REV="MADE" HREF="mailto:pgsql-docs@postgresql.org">

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation

    F.39.1. Portability Issues

    F.39.2. Converting a pre-8.3 Installation

    F.39.3. References

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    psql (9.3.20)
    +>psql (9.3.24)
     Type "help" for help.
     
     mydb=>
    version ----------------------------------------------------------------------- - PostgreSQL 9.3.20 on i586-pc-linux-gnu, compiled by GCC 2.96, 32-bit + PostgreSQL 9.3.24 on i586-pc-linux-gnu, compiled by GCC 2.96, 32-bit (1 row)
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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]

    PostgreSQL 9.3.20 DocumentationPostgreSQL 9.3.24 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

    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.3.20 DocumentationPostgreSQL 9.3.24 Documentation
    [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. +