ACLOCAL_AMFLAGS = -I m4
docs:
- $(MAKE) -C doc all && $(MAKE) -C doc.ja all
+ $(MAKE) -C doc all && $(MAKE) -C doc.ja all && $(MAKE) -C doc.zh-cn all
.PHONY: docs
SUBDIRS = src
-DIST_SUBDIRS = src doc doc.ja
+DIST_SUBDIRS = src doc doc.ja doc.zh-cn
# suggested by libtoolize
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src
-DIST_SUBDIRS = src doc doc.ja
+DIST_SUBDIRS = src doc doc.ja doc.zh-cn
all: all-recursive
.SUFFIXES:
docs:
- $(MAKE) -C doc all && $(MAKE) -C doc.ja all
+ $(MAKE) -C doc all && $(MAKE) -C doc.ja all && $(MAKE) -C doc.zh-cn all
.PHONY: docs
# Tell versions [3.59,3.63) of GNU make to not export all variables.
ac_config_headers="$ac_config_headers src/include/config.h"
-ac_config_files="$ac_config_files Makefile doc/Makefile doc/src/Makefile doc/src/sgml/Makefile doc.ja/Makefile doc.ja/src/Makefile doc.ja/src/sgml/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pgenc/Makefile src/tools/pcp/Makefile src/tools/pgproto/Makefile src/tools/watchdog/Makefile src/watchdog/Makefile"
+ac_config_files="$ac_config_files Makefile doc/Makefile doc/src/Makefile doc/src/sgml/Makefile doc.ja/Makefile doc.ja/src/Makefile doc.ja/src/sgml/Makefile doc.zh-cn/Makefile doc.zh-cn/src/Makefile doc.zh-cn/src/sgml/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pgenc/Makefile src/tools/pcp/Makefile src/tools/pgproto/Makefile src/tools/watchdog/Makefile src/watchdog/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
"doc.ja/Makefile") CONFIG_FILES="$CONFIG_FILES doc.ja/Makefile" ;;
"doc.ja/src/Makefile") CONFIG_FILES="$CONFIG_FILES doc.ja/src/Makefile" ;;
"doc.ja/src/sgml/Makefile") CONFIG_FILES="$CONFIG_FILES doc.ja/src/sgml/Makefile" ;;
+ "doc.zh-cn/Makefile") CONFIG_FILES="$CONFIG_FILES doc.zh-cn/Makefile" ;;
+ "doc.zh-cn/src/Makefile") CONFIG_FILES="$CONFIG_FILES doc.zh-cn/src/Makefile" ;;
+ "doc.zh-cn/src/sgml/Makefile") CONFIG_FILES="$CONFIG_FILES doc.zh-cn/src/sgml/Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;;
"src/parser/Makefile") CONFIG_FILES="$CONFIG_FILES src/parser/Makefile" ;;
AM_CONFIG_HEADER(src/include/config.h)
-AC_OUTPUT([Makefile doc/Makefile doc/src/Makefile doc/src/sgml/Makefile doc.ja/Makefile doc.ja/src/Makefile doc.ja/src/sgml/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pgenc/Makefile src/tools/pcp/Makefile src/tools/pgproto/Makefile src/tools/watchdog/Makefile src/watchdog/Makefile])
+AC_OUTPUT([Makefile doc/Makefile doc/src/Makefile doc/src/sgml/Makefile doc.ja/Makefile doc.ja/src/Makefile doc.ja/src/sgml/Makefile doc.zh-cn/Makefile doc.zh-cn/src/Makefile doc.zh-cn/src/sgml/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pgenc/Makefile src/tools/pcp/Makefile src/tools/pgproto/Makefile src/tools/watchdog/Makefile src/watchdog/Makefile])
--- /dev/null
+# suggested by libtoolize
+ACLOCAL_AMFLAGS = -I m4
+DEFS = @DEFS@ \
+ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
+
+SUBDIRS = src
--- /dev/null
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = doc.zh-cn
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/c-compiler.m4 \
+ $(top_srcdir)/c-library.m4 $(top_srcdir)/general.m4 \
+ $(top_srcdir)/ac_func_accept_argtypes.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/include/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOG = @CATALOG@
+CC = @CC@
+CFLAGS = @CFLAGS@
+COLLATEINDEX = @COLLATEINDEX@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@ \
+ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
+
+DLLTOOL = @DLLTOOL@
+DOCBOOKSTYLE = @DOCBOOKSTYLE@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JADE = @JADE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LYNX = @LYNX@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MEMCACHED_DIR = @MEMCACHED_DIR@
+MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@
+MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@
+MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NSGMLS = @NSGMLS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OSX = @OSX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PGCONFIG = @PGCONFIG@
+PGSQL_BIN_DIR = @PGSQL_BIN_DIR@
+PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@
+PGSQL_LIB_DIR = @PGSQL_LIB_DIR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+STYLE = @STYLE@
+SUNIFDEF = @SUNIFDEF@
+VERSION = @VERSION@
+XMLLINT = @XMLLINT@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+have_docbook = @have_docbook@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# suggested by libtoolize
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-libtool cscopelist-am ctags \
+ ctags-am distclean distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+# suggested by libtoolize
+ACLOCAL_AMFLAGS = -I m4
+DEFS = @DEFS@ \
+ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
+
+EXTRA_DIST = figures/process-diagram.gif \
+ figures/process-diagram.odp \
+ figures/cluster.gif \
+ figures/cluster.odp
+
+SUBDIRS = sgml
+
--- /dev/null
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = doc.zh-cn/src
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/c-compiler.m4 \
+ $(top_srcdir)/c-library.m4 $(top_srcdir)/general.m4 \
+ $(top_srcdir)/ac_func_accept_argtypes.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/include/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOG = @CATALOG@
+CC = @CC@
+CFLAGS = @CFLAGS@
+COLLATEINDEX = @COLLATEINDEX@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@ \
+ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
+
+DLLTOOL = @DLLTOOL@
+DOCBOOKSTYLE = @DOCBOOKSTYLE@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JADE = @JADE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LYNX = @LYNX@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MEMCACHED_DIR = @MEMCACHED_DIR@
+MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@
+MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@
+MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NSGMLS = @NSGMLS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OSX = @OSX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PGCONFIG = @PGCONFIG@
+PGSQL_BIN_DIR = @PGSQL_BIN_DIR@
+PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@
+PGSQL_LIB_DIR = @PGSQL_LIB_DIR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+STYLE = @STYLE@
+SUNIFDEF = @SUNIFDEF@
+VERSION = @VERSION@
+XMLLINT = @XMLLINT@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+have_docbook = @have_docbook@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# suggested by libtoolize
+ACLOCAL_AMFLAGS = -I m4
+EXTRA_DIST = figures/process-diagram.gif \
+ figures/process-diagram.odp \
+ figures/cluster.gif \
+ figures/cluster.odp
+
+SUBDIRS = sgml
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-libtool cscopelist-am ctags \
+ ctags-am distclean distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN"[
+ <!ENTITY % version SYSTEM "version.sgml">
+ %version;
+]>
+
+<book id="pgpool-II-en"><title>pgpool-II english documentation</title>
+ <bookinfo>
+ <productname>pgpool-doc-en</productname>
+ <productnumber>&version;</productnumber>
+ <abstract>
+ <para>
+ Hello pgpool-II!
+ </para>
+ </abstract>
+</bookinfo>
+</book>
+
--- /dev/null
+HTML.index
+bookindex.sgml
+html/
+man-stamp
+man1/
+man3/
+pgpool.xml
--- /dev/null
+# suggested by libtoolize
+ACLOCAL_AMFLAGS = -I m4
+DEFS = @DEFS@ \
+ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
+
+all: html man1 man8
+
+GENERATED_SGML = bookindex.sgml version.sgml
+
+ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
+
+# Sometimes we don't want this one.
+ALMOSTALLSGML := $(filter-out %bookindex.sgml,$(ALLSGML))
+
+SPFLAGS = -wall -wno-unused-param -wno-empty -wfully-tagged
+
+OUTDIR = html
+
+#if DOCBOOKSTYLE
+#CATALOG = -c $(DOCBOOKSTYLE)/catalog
+#endif
+
+#override XSLTPROCFLAGS += --stringparam pgpool.version '$(VERSION)'
+override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
+
+#jade -G -t sgml -i html -d stylesheet.dsl#html -o abas pgpool-en.sgm
+#JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
+JADE.html.call = SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
+if STYLE_ENV_SET
+JADE.html.call += -V website-stylesheet
+XSLTPROC_HTML_FLAGS += --param website.stylesheet 1
+endif
+
+JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print -i include-index
+JADE.rtf.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print -i include-index
+
+JADE_html = $(JADE) $(SPFLAGS) -d stylesheet.dsl\#html -t sgml -i html -V website-stylesheet
+
+
+EXTRA_DIST = $(ALLSGML) html man1 man8 stylesheet.dsl stylesheet.css stylesheet-man.xsl stylesheet-common.xsl
+
+##
+## Man pages
+##
+
+man1 man8 distprep-man: man-stamp
+
+man-stamp: stylesheet-man.xsl pgpool.xml
+ $(XMLLINT) --noout --valid pgpool.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
+ touch $@
+
+# The draft target creates HTML output in draft mode, without index (for faster build).
+draft: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
+ $(MKDIR_P) html
+ $(JADE.html.call) -V draft-mode $<
+ cp $(srcdir)/stylesheet.css html/
+
+html: html-stamp
+
+html-stamp: pgpool.sgml $(ALLSGML) stylesheet.dsl
+ $(MKDIR_P) html
+ $(JADE.html.call) -i include-index $<
+ cp $(srcdir)/stylesheet.css html/
+ cp ../figures/*.gif html
+
+# single-page HTML
+pgpool.html: pgpool.sgml $(ALLSGML) stylesheet.dsl
+ $(JADE.html.call) -V nochunks -V rootchunk -V '(define %root-filename% #f)' -V '(define use-output-dir #f)' -i include-index $<
+
+# single-page text
+pgpool.txt: pgpool.html
+ $(LYNX) -force_html -dump -nolist $< > $@
+
+HTML.index: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
+ $(MKDIR_P) html
+ $(JADE.html.call) -V html-index $<
+
+bookindex.sgml: HTML.index
+ LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $<
+
+# single-page text
+#pgpool-en.txt: pgpool-en.html
+# $(LYNX) -force_html -dump -nolist $< > $@
+
+# single-page HTML
+#pgpool-en.html: pgpool-en.sgml $(ALLSGML) stylesheet.dsl
+# $(JADE.html.call) -V nochunks -V rootchunk -i include-index $< >$@
+
+%.rtf: %.sgml $(ALLSGML)
+ $(JADE.rtf.call) $<
+
+%-A4.tex-ps: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
+
+%-US.tex-ps: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
+
+%-A4.tex-pdf: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
+
+%-US.tex-pdf: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
+
+
+%.pdf: %.tex-pdf
+ @rm -f $*.aux $*.log $*.out
+# multiple runs are necessary to create proper intra-document links
+ pdfjadetex $<
+ pdfjadetex $<
+ pdfjadetex $<
+
+#pgpool-en.pdf: pgpool-en-A4.tex-pdf pgpool-en-US.tex-pdf
+
+# This generates an XML version of the flow-object tree. It's useful
+# # for debugging DSSSL code, and possibly to interface to some other
+# # tools that can make use of this.
+%.fot: %.sgml $(ALLSGML)
+ $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -i include-index -o $@ $<
+
+%.ps: %.dvi
+ dvips -o $@ $<
+
+##
+## XSLT processing
+##
+
+pgpool-en.xml: $(ALLSGML)
+ $(OSX) -D. -x lower -i include-xslt-index $< >pgpool-en.xmltmp
+ $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
+ -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
+ <pgpool-en.xmltmp > $@
+ rm pgpool-en.xmltmp
+
+
+pgpool.xml: $(srcdir)/pgpool.sgml $(ALMOSTALLSGML)
+ SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 \
+ $(OSX) -D. -x lower -i include-xslt-index $< >pgpool.xmltmp
+ $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
+ -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
+ <pgpool.xmltmp > $@
+ rm pgpool.xmltmp
+
+.PHONY: xslthtml-stamp
+
+xslthtml: xslthtml-stamp
+
+xslthtml: xslthtml-stamp
+
+xslthtml-stamp: stylesheet.xsl pgpool.xml
+ $(XMLLINT) --noout --valid pgpool.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
+ cp $(srcdir)/stylesheet.css html/
+
+htmlhelp: stylesheet-hh.xsl pgpool.xml
+ $(XMLLINT) --noout --valid pgpool.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $^
+
+%-A4.fo.tmp: stylesheet-fo.xsl %.xml
+ $(XMLLINT) --noout --valid $*.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
+
+%-US.fo.tmp: stylesheet-fo.xsl %.xml
+ $(XMLLINT) --noout --valid $*.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
+
+FOP = fop
+
+#xslthtml-stamp: stylesheet.xsl pgpool-en.xml
+# $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
+# cp $(srcdir)/stylesheet.css html/
+
+# reformat FO output so that locations of errors are easier to find
+%.fo: %.fo.tmp
+ $(XMLLINT) --format --output $@ $^
+
+epub: pgpool.epub
+ pgpool.epub: pgpool.xml
+ $(XMLLINT) --noout --valid $<
+ $(DBTOEPUB) $<
+
+version.sgml: $(top_srcdir)/configure
+ { \
+ echo "<!ENTITY version \"$(PACKAGE_VERSION)\">"; \
+ } > $@
+
+# tabs are harmless, but it is best to avoid them in SGML files
+check-tabs:
+ @( ! grep ' ' $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.dsl $(srcdir)/*.xsl) ) || (echo "Tabs appear in SGML/XML files" 1>&2; exit 1)
+
+CLEANFILES = *.html *.tex-pdf pgpool-en.rtf pgpool-en.txt html/* HTML.index bookindex.sgml man-stamp man1/* man3/* pgpool.xml
--- /dev/null
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@STYLE_ENV_SET_TRUE@am__append_1 = -V website-stylesheet
+@STYLE_ENV_SET_TRUE@am__append_2 = --param website.stylesheet 1
+subdir = doc.zh-cn/src/sgml
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/c-compiler.m4 \
+ $(top_srcdir)/c-library.m4 $(top_srcdir)/general.m4 \
+ $(top_srcdir)/ac_func_accept_argtypes.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/include/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOG = @CATALOG@
+CC = @CC@
+CFLAGS = @CFLAGS@
+COLLATEINDEX = @COLLATEINDEX@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@ \
+ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
+
+DLLTOOL = @DLLTOOL@
+DOCBOOKSTYLE = @DOCBOOKSTYLE@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JADE = @JADE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LYNX = @LYNX@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MEMCACHED_DIR = @MEMCACHED_DIR@
+MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@
+MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@
+MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NSGMLS = @NSGMLS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OSX = @OSX@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+PGCONFIG = @PGCONFIG@
+PGSQL_BIN_DIR = @PGSQL_BIN_DIR@
+PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@
+PGSQL_LIB_DIR = @PGSQL_LIB_DIR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+STYLE = @STYLE@
+SUNIFDEF = @SUNIFDEF@
+VERSION = @VERSION@
+XMLLINT = @XMLLINT@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@ $(am__append_2)
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+have_docbook = @have_docbook@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# suggested by libtoolize
+ACLOCAL_AMFLAGS = -I m4
+GENERATED_SGML = bookindex.sgml version.sgml
+ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
+
+# Sometimes we don't want this one.
+ALMOSTALLSGML := $(filter-out %bookindex.sgml,$(ALLSGML))
+SPFLAGS = -wall -wno-unused-param -wno-empty -wfully-tagged
+OUTDIR = html
+
+#jade -G -t sgml -i html -d stylesheet.dsl#html -o abas pgpool-en.sgm
+#JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
+JADE.html.call = SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 $(JADE) \
+ $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d \
+ stylesheet.dsl -t sgml -i output-html $(am__append_1)
+JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print -i include-index
+JADE.rtf.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print -i include-index
+JADE_html = $(JADE) $(SPFLAGS) -d stylesheet.dsl\#html -t sgml -i html -V website-stylesheet
+EXTRA_DIST = $(ALLSGML) html man1 man8 stylesheet.dsl stylesheet.css stylesheet-man.xsl stylesheet-common.xsl
+FOP = fop
+CLEANFILES = *.html *.tex-pdf pgpool-en.rtf pgpool-en.txt html/* HTML.index bookindex.sgml man-stamp man1/* man3/* pgpool.xml
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/sgml/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/sgml/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags-am uninstall uninstall-am
+
+
+all: html man1 man8
+
+#if DOCBOOKSTYLE
+#CATALOG = -c $(DOCBOOKSTYLE)/catalog
+#endif
+
+#override XSLTPROCFLAGS += --stringparam pgpool.version '$(VERSION)'
+override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
+
+man1 man8 distprep-man: man-stamp
+
+man-stamp: stylesheet-man.xsl pgpool.xml
+ $(XMLLINT) --noout --valid pgpool.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
+ touch $@
+
+# The draft target creates HTML output in draft mode, without index (for faster build).
+draft: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
+ $(MKDIR_P) html
+ $(JADE.html.call) -V draft-mode $<
+ cp $(srcdir)/stylesheet.css html/
+
+html: html-stamp
+
+html-stamp: pgpool.sgml $(ALLSGML) stylesheet.dsl
+ $(MKDIR_P) html
+ $(JADE.html.call) -i include-index $<
+ cp $(srcdir)/stylesheet.css html/
+ cp ../figures/*.gif html
+
+# single-page HTML
+pgpool.html: pgpool.sgml $(ALLSGML) stylesheet.dsl
+ $(JADE.html.call) -V nochunks -V rootchunk -V '(define %root-filename% #f)' -V '(define use-output-dir #f)' -i include-index $<
+
+# single-page text
+pgpool.txt: pgpool.html
+ $(LYNX) -force_html -dump -nolist $< > $@
+
+HTML.index: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
+ $(MKDIR_P) html
+ $(JADE.html.call) -V html-index $<
+
+bookindex.sgml: HTML.index
+ LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $<
+
+# single-page text
+#pgpool-en.txt: pgpool-en.html
+# $(LYNX) -force_html -dump -nolist $< > $@
+
+# single-page HTML
+#pgpool-en.html: pgpool-en.sgml $(ALLSGML) stylesheet.dsl
+# $(JADE.html.call) -V nochunks -V rootchunk -i include-index $< >$@
+
+%.rtf: %.sgml $(ALLSGML)
+ $(JADE.rtf.call) $<
+
+%-A4.tex-ps: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
+
+%-US.tex-ps: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
+
+%-A4.tex-pdf: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
+
+%-US.tex-pdf: %.sgml $(ALLSGML)
+ $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
+
+%.pdf: %.tex-pdf
+ @rm -f $*.aux $*.log $*.out
+# multiple runs are necessary to create proper intra-document links
+ pdfjadetex $<
+ pdfjadetex $<
+ pdfjadetex $<
+
+#pgpool-en.pdf: pgpool-en-A4.tex-pdf pgpool-en-US.tex-pdf
+
+# This generates an XML version of the flow-object tree. It's useful
+# # for debugging DSSSL code, and possibly to interface to some other
+# # tools that can make use of this.
+%.fot: %.sgml $(ALLSGML)
+ $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -i include-index -o $@ $<
+
+%.ps: %.dvi
+ dvips -o $@ $<
+
+pgpool-en.xml: $(ALLSGML)
+ $(OSX) -D. -x lower -i include-xslt-index $< >pgpool-en.xmltmp
+ $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
+ -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
+ <pgpool-en.xmltmp > $@
+ rm pgpool-en.xmltmp
+
+pgpool.xml: $(srcdir)/pgpool.sgml $(ALMOSTALLSGML)
+ SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 \
+ $(OSX) -D. -x lower -i include-xslt-index $< >pgpool.xmltmp
+ $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
+ -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
+ <pgpool.xmltmp > $@
+ rm pgpool.xmltmp
+
+.PHONY: xslthtml-stamp
+
+xslthtml: xslthtml-stamp
+
+xslthtml: xslthtml-stamp
+
+xslthtml-stamp: stylesheet.xsl pgpool.xml
+ $(XMLLINT) --noout --valid pgpool.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
+ cp $(srcdir)/stylesheet.css html/
+
+htmlhelp: stylesheet-hh.xsl pgpool.xml
+ $(XMLLINT) --noout --valid pgpool.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $^
+
+%-A4.fo.tmp: stylesheet-fo.xsl %.xml
+ $(XMLLINT) --noout --valid $*.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
+
+%-US.fo.tmp: stylesheet-fo.xsl %.xml
+ $(XMLLINT) --noout --valid $*.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
+
+#xslthtml-stamp: stylesheet.xsl pgpool-en.xml
+# $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
+# cp $(srcdir)/stylesheet.css html/
+
+# reformat FO output so that locations of errors are easier to find
+%.fo: %.fo.tmp
+ $(XMLLINT) --format --output $@ $^
+
+epub: pgpool.epub
+ pgpool.epub: pgpool.xml
+ $(XMLLINT) --noout --valid $<
+ $(DBTOEPUB) $<
+
+version.sgml: $(top_srcdir)/configure
+ { \
+ echo "<!ENTITY version \"$(PACKAGE_VERSION)\">"; \
+ } > $@
+
+# tabs are harmless, but it is best to avoid them in SGML files
+check-tabs:
+ @( ! grep ' ' $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.dsl $(srcdir)/*.xsl) ) || (echo "Tabs appear in SGML/XML files" 1>&2; exit 1)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+<!-- doc/src/sgml/README.links -->
+
+Linking within SGML documents can be confusing, so here is a summary:
+
+
+Intra-document Linking
+----------------------
+
+<xref>
+ use to get chapter/section number from the title of the target
+ link, or xreflabel if defined at the target, or refentrytitle if target
+ is a refentry; has no close tag
+ http://www.oasis-open.org/docbook/documentation/reference/html/xref.html
+
+<link>
+ use to supply text for the link, requires </link>
+ http://www.oasis-open.org/docbook/documentation/reference/html/link.html
+
+linkend=
+ controls the target of the link/xref, required
+
+endterm=
+ for <xref>, allows the text of the link/xref to be taken from a
+ different link target title
+
+
+External Linking
+----------------
+
+<ulink>
+ like <link>, but uses a URL (not a document target); requires
+ </ulink>; if no text is specified, the URL appears as the link
+ text
+ http://www.oasis-open.org/docbook/documentation/reference/html/ulink.html
+
+url=
+ used by <ulink> to specify the URL, required
+
+
+Guidelines
+----------
+
+o If you want to supply text, use <link>, else <xref>
+o Do not use text with <ulink> so the URL appears in printed output
+o Specific nouns like GUC variables, SQL commands, and contrib modules
+ usually have xreflabels
--- /dev/null
+<!-- doc/src/sgml/advanced.sgml -->
+
+<chapter id="tutorial-watchdog">
+ <title>Watchdog</title>
+
+ <sect1 id="tutorial-watchdog-intro">
+ <title>Introduction</title>
+
+ <para>
+ <firstterm>Watchdog</firstterm> is a sub process of
+ <productname>Pgpool-II</productname> to add high
+ availability. Watchdog is used to resolve the single point of
+ failure by coordinating multiple
+ <productname>Pgpool-II</productname> nodes. The watchdog was first
+ introduced in <productname>pgpool-II</productname>
+ <emphasis>V3.2</emphasis> and is significantly enhanced in
+ <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>, to
+ ensure the presence of a quorum at all time. This new addition to
+ watchdog makes it more fault tolerant and robust in handling and
+ guarding against the split-brain syndrome and network
+ partitioning. In addition, <emphasis>V3.7</emphasis> introduced
+ quorum failover (see <xref
+ linkend="config-watchdog-failover-behavior">) to reduce the false
+ positives of <productname>PostgreSQL</productname> server
+ failures. <emphasis>To ensure the quorum mechanism properly works, the number
+ of <productname>Pgpool-II</productname> nodes must be odd in number
+ and greater than or equal to 3.</emphasis>
+ </para>
+
+ <sect2 id="tutorial-watchdog-coordinating-nodes">
+ <title>Coordinating multiple <productname>Pgpool-II</productname> nodes</title>
+
+ <indexterm zone="tutorial-watchdog-coordinating-nodes">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ Watchdog coordinates multiple <productname>Pgpool-II</productname> nodes
+ by exchanging information with each other.
+ </para>
+ <para>
+ At the startup, if the watchdog is enabled, <productname>Pgpool-II</productname> node
+ sync the status of all configured backend nodes from the leader watchdog node.
+ And if the node goes on to become a leader node itself it initializes the backend
+ status locally. When a backend node status changes by failover etc..,
+ watchdog notifies the information to other <productname>Pgpool-II</productname>
+ nodes and synchronizes them. When online recovery occurs, watchdog restricts
+ client connections to other <productname>Pgpool-II</productname>
+ nodes for avoiding inconsistency between backends.
+ </para>
+
+ <para>
+ Watchdog also coordinates with all connected <productname>Pgpool-II</productname> nodes to ensure
+ that failback, failover and follow_primary commands must be executed only on one <productname>pgpool-II</productname> node.
+ </para>
+
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-lifechecking">
+ <title>Life checking of other <productname>Pgpool-II</productname> nodes</title>
+
+ <indexterm zone="tutorial-watchdog-lifechecking">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ Watchdog lifecheck is the sub-component of watchdog to monitor
+ the health of <productname>Pgpool-II</productname> nodes participating
+ in the watchdog cluster to provide the high availability.
+ Traditionally <productname>Pgpool-II</productname> watchdog provides
+ two methods of remote node health checking. <literal>"heartbeat"</literal>
+ and <literal>"query"</literal> mode.
+ The watchdog in <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>
+ adds a new <literal>"external"</literal> to <xref linkend="guc-wd-lifecheck-method">,
+ which enables to hook an external third party health checking
+ system with <productname>Pgpool-II</productname> watchdog.
+ </para>
+ <para>
+ Apart from remote node health checking watchdog lifecheck can also check
+ the health of node it is installed on by monitoring the connection to upstream servers.
+ If the monitoring fails, watchdog treats it as the local <productname>Pgpool-II</productname>
+ node failure.
+ </para>
+
+ <para>
+ In <literal>heartbeat</literal> mode, watchdog monitors other <productname>Pgpool-II</productname>
+ processes by using <literal>heartbeat</literal> signal.
+ Watchdog receives heartbeat signals sent by other <productname>Pgpool-II</productname>
+ periodically. If there is no signal for a certain period,
+ watchdog regards this as the failure of the <productname>Pgpool-II</productname>.
+ For redundancy you can use multiple network connections for heartbeat
+ exchange between <productname>Pgpool-II</productname> nodes.
+ This is the default and recommended mode to be used for health checking.
+ </para>
+
+ <para>
+ In <literal>query</literal> mode, watchdog monitors <productname>Pgpool-II</productname>
+ service rather than process. In this mode watchdog sends queries to other
+ <productname>Pgpool-II</productname> and checks the response.
+ <note>
+ <para>
+ Note that this method requires connections from other <productname>Pgpool-II</productname>,
+ so it would fail monitoring if the <xref linkend="guc-num-init-children"> parameter isn't large enough.
+ This mode is deprecated and left for backward compatibility.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ <literal>external</literal> mode is introduced by <productname>Pgpool-II</productname>
+ <emphasis>V3.5</emphasis>. This mode basically disables the built in lifecheck
+ of <productname>Pgpool-II</productname> watchdog and expects that the external system
+ will inform the watchdog about health of local and all remote nodes participating in the watchdog cluster.
+ </para>
+
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-consistency-of-config">
+ <title>Consistency of configuration parameters on all <productname>Pgpool-II</productname> nodes</title>
+
+ <indexterm zone="tutorial-watchdog-consistency-of-config">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ At startup watchdog verifies the <productname>Pgpool-II</productname>
+ configuration of the local node for the consistency with the configurations
+ on the leader watchdog node and warns the user of any differences.
+ This eliminates the likelihood of undesired behavior that can happen
+ because of different configuration on different <productname>Pgpool-II</productname> nodes.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-changing-active">
+ <title>Changing active/standby state when certain fault is detected</title>
+
+ <indexterm zone="tutorial-watchdog-changing-active">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ When a fault of <productname>Pgpool-II</productname> is detected,
+ watchdog notifies the other watchdogs of it.
+ If this is the active <productname>Pgpool-II</productname>,
+ watchdogs decide the new active <productname>Pgpool-II</productname>
+ by voting and change active/standby state.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-automatic-vip">
+ <title>Automatic virtual IP switching</title>
+
+ <indexterm zone="tutorial-watchdog-automatic-vip">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ When a standby <productname>Pgpool-II</productname> server promotes to active,
+ the new active server brings up virtual IP interface. Meanwhile, the previous
+ active server brings down the virtual IP interface. This enables the active
+ <productname>Pgpool-II</productname> to work using the same
+ IP address even when servers are switched.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-changing-automatic-register-in-recovery">
+ <title>Automatic registration of a server as a standby in recovery</title>
+
+ <indexterm zone="tutorial-watchdog-changing-automatic-register-in-recovery">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ When the broken server recovers or new server is attached, the watchdog process
+ notifies this to the other watchdogs in the cluster along with the information of the new server,
+ and the watchdog process receives information on the active server and
+ other servers. Then, the attached server is registered as a standby.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-start-stop">
+ <title>Starting/stopping watchdog</title>
+
+ <indexterm zone="tutorial-watchdog-start-stop">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ The watchdog process starts and stops automatically as sub-processes
+ of the <productname>Pgpool-II</productname>, therefore there is no
+ dedicated command to start and stop watchdog.
+ </para>
+ <para>
+ Watchdog controls the virtual IP interface, the commands executed by
+ the watchdog for bringing up and bringing down the VIP require the
+ root privileges. <productname>Pgpool-II</productname> requires the
+ user running <productname>Pgpool-II</productname> to have root
+ privileges when the watchdog is enabled along with virtual IP.
+ This is however not good security practice to run the
+ <productname>Pgpool-II</productname> as root user, the alternative
+ and preferred way is to run the <productname>Pgpool-II</productname>
+ as normal user and use either the custom commands for
+ <xref linkend="guc-if-up-cmd">, <xref linkend="guc-if-down-cmd">,
+ and <xref linkend="guc-arping-cmd"> using <command>sudo</command>
+ or use <command>setuid</command> ("set user ID upon execution")
+ on <literal>if_*</literal> commands
+ </para>
+ <para>
+ Lifecheck process is a sub-component of watchdog, its job is to monitor the
+ health of <productname>Pgpool-II</productname> nodes participating in
+ the watchdog cluster. The Lifecheck process is started automatically
+ when the watchdog is configured to use the built-in life-checking,
+ it starts after the watchdog main process initialization is complete.
+ However lifecheck process only kicks in when all configured watchdog
+ nodes join the cluster and becomes active. If some remote node fails
+ before the Lifecheck become active that failure will not get caught by the lifecheck.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="tutorial-watchdog-integrating-external-lifecheck">
+ <title>Integrating external lifecheck with watchdog</title>
+
+ <para>
+ <productname>Pgpool-II</productname> watchdog process uses the
+ <acronym>BSD</acronym> sockets for communicating with
+ all the <productname>Pgpool-II</productname> processes and the
+ same <acronym>BSD</acronym> socket can also be used by any third
+ party system to provide the lifecheck function for local and remote
+ <productname>Pgpool-II</productname> watchdog nodes.
+ The <acronym>BSD</acronym> socket file name for IPC is constructed
+ by appending <productname>Pgpool-II</productname> wd_port after
+ <literal>"s.PGPOOLWD_CMD."</literal> string and the socket file is
+ placed in the <xref linkend="guc-wd-ipc-socket-dir"> directory.
+ </para>
+
+ <sect2 id="tutorial-watchdog-ipc-command-packet">
+ <title>Watchdog IPC command packet format</title>
+
+ <indexterm zone="tutorial-watchdog-ipc-command-packet">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ The watchdog IPC command packet consists of three fields.
+ Below table details the message fields and description.
+ </para>
+
+ <table id="wd-ipc-command-format-table">
+ <title>Watchdog IPC command packet format</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Field</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>TYPE</entry>
+ <entry>BYTE1</entry>
+ <entry>Command Type</entry>
+ </row>
+ <row>
+ <entry>LENGTH</entry>
+ <entry>INT32 in network byte order</entry>
+ <entry>The length of data to follow</entry>
+ </row>
+ <row>
+ <entry>DATA</entry>
+ <entry>DATA in <acronym>JSON</acronym> format</entry>
+ <entry>Command data in <acronym>JSON</acronym> format</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-ipc-result-packet">
+ <title>Watchdog IPC result packet format</title>
+
+ <indexterm zone="tutorial-watchdog-ipc-result-packet">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ The watchdog IPC command result packet consists of three fields.
+ Below table details the message fields and description.
+ </para>
+
+ <table id="wd-ipc-result-format-table">
+ <title>Watchdog IPC result packet format</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Field</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>TYPE</entry>
+ <entry>BYTE1</entry>
+ <entry>Command Type</entry>
+ </row>
+ <row>
+ <entry>LENGTH</entry>
+ <entry>INT32 in network byte order</entry>
+ <entry>The length of data to follow</entry>
+ </row>
+ <row>
+ <entry>DATA</entry>
+ <entry>DATA in <acronym>JSON</acronym> format</entry>
+ <entry>Command result data in <acronym>JSON</acronym> format</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-ipc-command-packet-types">
+ <title>Watchdog IPC command packet types</title>
+
+ <indexterm zone="tutorial-watchdog-ipc-command-packet-types">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ The first byte of the IPC command packet sent to watchdog process
+ and the result returned by watchdog process is identified as the
+ command or command result type.
+ The below table lists all valid types and their meanings
+ </para>
+
+ <table id="wd-ipc-command-packet--types-table">
+ <title>Watchdog IPC command packet types</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Byte Value</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>REGISTER FOR NOTIFICATIONS</entry>
+ <entry>'0'</entry>
+ <entry>Command packet</entry>
+ <entry>Command to register the current connection to receive watchdog notifications</entry>
+ </row>
+ <row>
+ <entry>NODE STATUS CHANGE</entry>
+ <entry>'2'</entry>
+ <entry>Command packet</entry>
+ <entry>Command to inform watchdog about node status change of watchdog node</entry>
+ </row>
+ <row>
+ <entry>GET NODES LIST</entry>
+ <entry>'3'</entry>
+ <entry>Command packet</entry>
+ <entry>Command to get the list of all configured watchdog nodes</entry>
+ </row>
+ <row>
+ <entry>NODES LIST DATA</entry>
+ <entry>'4'</entry>
+ <entry>Result packet</entry>
+ <entry>The <acronym>JSON</acronym> data in packet contains the list of all configured watchdog nodes</entry>
+ </row>
+ <row>
+ <entry>CLUSTER IN TRANSITION</entry>
+ <entry>'7'</entry>
+ <entry>Result packet</entry>
+ <entry>Watchdog returns this packet type when it is not possible to process the command because the cluster is transitioning.</entry>
+ </row>
+ <row>
+ <entry>RESULT BAD</entry>
+ <entry>'8'</entry>
+ <entry>Result packet</entry>
+ <entry>Watchdog returns this packet type when the IPC command fails</entry>
+ </row>
+ <row>
+ <entry>RESULT OK</entry>
+ <entry>'9'</entry>
+ <entry>Result packet</entry>
+ <entry>Watchdog returns this packet type when IPC command succeeds</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-external-lifecheck-ipc">
+ <title>External lifecheck IPC packets and data</title>
+
+ <indexterm zone="tutorial-watchdog-external-lifecheck-ipc">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ "GET NODES LIST" ,"NODES LIST DATA" and "NODE STATUS CHANGE"
+ IPC messages of watchdog can be used to integration an external
+ lifecheck systems. Note that the built-in lifecheck of pgpool
+ also uses the same channel and technique.
+ </para>
+
+ <sect3 id="tutorial-watchdog-external-lifecheck-get-nodes">
+ <title>Getting list of configured watchdog nodes</title>
+
+ <indexterm zone="tutorial-watchdog-external-lifecheck-get-nodes">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ Any third party lifecheck system can send the "GET NODES LIST"
+ packet on watchdog IPC socket with a <acronym>JSON</acronym>
+ data containing the authorization key and value if
+ <xref linkend="guc-wd-authkey"> is set or empty packet data
+ when <xref linkend="guc-wd-authkey"> is not configured to get
+ the "NODES LIST DATA" result packet.
+ </para>
+ <para>
+ The result packet returned by watchdog for the "GET NODES LIST"
+ will contains the list of all configured watchdog nodes to do
+ health check on in the <acronym>JSON</acronym> format.
+ The <acronym>JSON</acronym> of the watchdog nodes contains the
+ <literal>"WatchdogNodes"</literal> Array of all watchdog nodes.
+ Each watchdog <acronym>JSON</acronym> node contains the
+ <literal>"ID"</literal>, <literal>"NodeName"</literal>,
+ <literal>"HostName"</literal>, <literal>"DelegateIP"</literal>,
+ <literal>"WdPort"</literal> and <literal>"PgpoolPort"</literal>
+ for each node.
+ </para>
+ <para>
+ <programlisting>
+ -- The example JSON data contained in "NODES LIST DATA"
+
+ {
+ "NodeCount":3,
+ "WatchdogNodes":
+ [
+ {
+ "ID":0,
+ "State":1,
+ "NodeName":"Linux_ubuntu_9999",
+ "HostName":"watchdog-host1",
+ "DelegateIP":"172.16.5.133",
+ "WdPort":9000,
+ "PgpoolPort":9999
+ },
+ {
+ "ID":1,
+ "State":1,
+ "NodeName":"Linux_ubuntu_9991",
+ "HostName":"watchdog-host2",
+ "DelegateIP":"172.16.5.133",
+ "WdPort":9000,
+ "PgpoolPort":9991
+ },
+ {
+ "ID":2,
+ "State":1,
+ "NodeName":"Linux_ubuntu_9992",
+ "HostName":"watchdog-host3",
+ "DelegateIP":"172.16.5.133",
+ "WdPort":9000,
+ "PgpoolPort":9992
+ }
+ ]
+ }
+
+ -- Note that ID 0 is always reserved for local watchdog node
+
+ </programlisting>
+ </para>
+ <para>
+ After getting the configured watchdog nodes information from the
+ watchdog the external lifecheck system can proceed with the
+ health checking of watchdog nodes, and when it detects some status
+ change of any node it can inform that to watchdog using the
+ "NODE STATUS CHANGE" IPC messages of watchdog.
+ The data in the message should contain the <acronym>JSON</acronym>
+ with the node ID of the node whose status is changed
+ (The node ID must be same as returned by watchdog for that node
+ in WatchdogNodes list) and the new status of node.
+ </para>
+ <para>
+ <programlisting>
+ -- The example JSON to inform pgpool-II watchdog about health check
+ failed on node with ID 1 will look like
+
+ {
+ "NodeID":1,
+ "NodeStatus":1,
+ "Message":"optional message string to log by watchdog for this event"
+ "IPCAuthKey":"wd_authkey configuration parameter value"
+ }
+
+ -- NodeStatus values meanings are as follows
+ NODE STATUS DEAD = 1
+ NODE STATUS ALIVE = 2
+
+ </programlisting>
+ </para>
+ </sect3>
+ </sect2>
+ </sect1>
+ <sect1 id="tutorial-watchdog-restrictions">
+ <title>Restrictions on watchdog</title>
+
+ <indexterm zone="tutorial-watchdog-restrictions">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+
+ <sect2 id="tutorial-watchdog-restrictions-query-mode">
+ <title>Watchdog restriction with query mode lifecheck</title>
+ <indexterm zone="tutorial-watchdog-restrictions-query-mode">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+
+ <para>
+ In query mode, when all the DB nodes are detached from a
+ <productname>Pgpool-II</productname> due to PostgreSQL server
+ failure or pcp_detach_node issued, watchdog regards that the
+ <productname>Pgpool-II</productname> service is in the down
+ status and brings the virtual IP assigned to watchdog down.
+ Thus clients of <productname>Pgpool-II</productname> cannot
+ connect to <productname>Pgpool-II</productname> using the
+ virtual IP any more. This is necessary to avoid split-brain,
+ that is, situations where there are multiple active
+ <productname>Pgpool-II</productname>.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-restrictions-down-watchdog-mode">
+ <title>Connecting to <productname>Pgpool-II</productname> whose watchdog status is down</title>
+ <indexterm zone="tutorial-watchdog-restrictions-down-watchdog-mode">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ Don't connect to <productname>Pgpool-II</productname> in down
+ status using the real IP. Because a <productname>Pgpool-II</productname>
+ in down status can't receive information from other
+ <productname>Pgpool-II</productname> watchdogs so it's backend status
+ may be different from other the <productname>Pgpool-II</productname>.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-restrictions-down-watchdog-require-restart">
+ <title><productname>Pgpool-II</productname> whose watchdog status is down requires restart</title>
+ <indexterm zone="tutorial-watchdog-restrictions-down-watchdog-require-restart">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ <productname>Pgpool-II</productname> in down status can't become active
+ nor the standby <productname>Pgpool-II</productname>.
+ Recovery from down status requires the restart of <productname>Pgpool-II</productname>.
+ </para>
+ </sect2>
+
+ <sect2 id="tutorial-watchdog-restrictions-active-take-time">
+ <title>Watchdog promotion to active takes few seconds</title>
+ <indexterm zone="tutorial-watchdog-restrictions-active-take-time">
+ <primary>WATCHDOG</primary>
+ </indexterm>
+ <para>
+ After the active <productname>Pgpool-II</productname> stops,
+ it will take a few seconds until the standby <productname>Pgpool-II</productname>
+ promote to new active, to make sure that the former virtual IP is
+ brought down before a down notification packet is sent to other
+ <productname>Pgpool-II</productname>.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="tutorial-advanced-arch">
+ <title>Architecture of the watchdog</title>
+
+ <para>
+ Watchdog is a sub process of <productname>Pgpool-II</productname>,
+ which adds the high availability and resolves the single point of
+ failure by coordinating multiple <productname>Pgpool-II</productname>.
+ The watchdog process automatically starts (if enabled) when the
+ <productname>Pgpool-II</productname> starts up and consists of two
+ main components, Watchdog core and the lifecheck system.
+ </para>
+
+ <sect2 id="tutorial-advanced-arch-wd-core">
+ <title>Watchdog Core</title>
+ <para>
+ Watchdog core referred as a "watchdog" is a
+ <productname>Pgpool-II</productname> child process that
+ manages all the watchdog related communications with the
+ <productname>Pgpool-II</productname> nodes present in the
+ cluster and also communicates with the <productname>Pgpool-II</productname>
+ parent and lifecheck processes.
+ </para>
+ <para>
+ The heart of a watchdog process is a state machine that starts
+ from its initial state (<literal>WD_LOADING</literal>) and transit
+ towards either standby (<literal>WD_STANDBY</literal>) or
+ leader/coordinator (<literal>WD_COORDINATOR</literal>) state.
+ Both standby and leader/coordinator states are stable states of the
+ watchdog state machine and the node stays in standby or
+ leader/coordinator state until some problem in local
+ <productname>Pgpool-II</productname> node is detected or a
+ remote <productname>Pgpool-II</productname> disconnects from the cluster.
+ </para>
+ <para>
+ The watchdog process performs the following tasks:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Manages and coordinates the local node watchdog state.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Interacts with built-in or external lifecheck system
+ for the of local and remote <productname>Pgpool-II</productname>
+ node health checking.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Interacts with <productname>Pgpool-II</productname> main
+ process and provides the mechanism to
+ <productname>Pgpool-II</productname> parent process for
+ executing the cluster commands over the watchdog channel.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Communicates with all the participating <productname>Pgpool-II
+ </productname> nodes to coordinate the selection of
+ leader/coordinator node and to ensure the quorum in the cluster.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Manages the Virtual-IP on the active/coordinator node and
+ allow the users to provide custom scripts for
+ escalation and de-escalation.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Verifies the consistency of <productname>Pgpool-II</productname>
+ configurations across the participating <productname>Pgpool-II
+ </productname> nodes in the watchdog cluster.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Synchronize the status of all PostgreSQL backends at startup.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Provides the distributed locking facility to
+ <productname>Pgpool-II</productname> main process
+ for synchronizing the different failover commands.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <sect3 id="tutorial-advanced-arch-wd-core-comm">
+ <title>Communication with other nodes in the Cluster</title>
+ <para>
+ Watchdog uses TCP/IP sockets for all the communication with other nodes.
+ Each watchdog node can have two sockets opened with each node. One is the
+ outgoing (client) socket which this node creates and initiate the
+ connection to the remote node and the second socket is the one which
+ is listening socket for inbound connection initiated by remote
+ watchdog node. As soon as the socket connection to remote node succeeds
+ watchdog sends the ADD NODE (<literal>WD_ADD_NODE_MESSAGE</literal>)
+ message on that socket. And upon receiving the ADD NODE message the
+ watchdog node verifies the node information encapsulated in the message
+ with the Pgpool-II configurations for that node, and if the node passes
+ the verification test it is added to the cluster otherwise the connection
+ is dropped.
+ </para>
+ </sect3>
+
+ <sect3 id="tutorial-advanced-arch-wd-ipc-data">
+ <title>IPC and data format</title>
+ <para>
+ Watchdog process exposes a <acronym>UNIX</acronym> domain socket
+ for IPC communications, which accepts and provides the data in
+ <acronym>JSON</acronym> format. All the internal <productname>Pgpool-II
+ </productname> processes, including <productname>Pgpool-II's</productname>
+ built-in lifecheck and <productname>Pgpool-II</productname> main process
+ uses this IPC socket interface to interact with the watchdog.
+ This IPC socket can also be used by any external/3rd party system
+ to interact with watchdog.
+ </para>
+ <para>
+ See <xref linkend="tutorial-watchdog-integrating-external-lifecheck"> for details
+ on how to use watchdog IPC interface for integrating external/3rd party systems.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="tutorial-advanced-arch-wd-lifecheck">
+ <title>Watchdog Lifecheck</title>
+ <para>
+ Watchdog lifecheck is the sub-component of watchdog that monitors the health
+ of <productname>Pgpool-II</productname> nodes participating in the watchdog
+ cluster. <productname>Pgpool-II</productname> watchdog provides three built-in
+ methods of remote node health checking, "heartbeat", "query" and "external" mode.
+ </para>
+ <para>
+ In "heartbeat" mode, The lifecheck process sends and receives the data over
+ <acronym>UDP</acronym> socket to check the availability of remote nodes and
+ for each node the parent lifecheck process spawns two child process one for
+ sending the heartbeat signal and another for receiving the heartbeat.
+ While in "query" mode, The lifecheck process uses the PostgreSQL libpq
+ interface for querying the remote <productname>Pgpool-II</productname>.
+ And in this mode the lifecheck process creates a new thread for each health
+ check query which gets destroyed as soon as the query finishes.
+ While in "external" mode, this mode disables the built in lifecheck of
+ <productname>Pgpool-II</productname>, and expects that the external system
+ will monitor local and remote node instead.
+ </para>
+ <para>
+ Apart from remote node health checking watchdog lifecheck can also check the
+ health of node it is installed on by monitoring the connection to upstream servers.
+ For monitoring the connectivity to the upstream server <productname>Pgpool-II
+ </productname> lifecheck uses <literal>execv()</literal> function to executes
+ <command>'ping -q -c3 hostname'</command> command.
+ So a new child process gets spawned for executing each ping command.
+ This means for each health check cycle a child process gets created and
+ destroyed for each configured upstream server.
+ For example, if two upstream servers are configured in the lifecheck and it is
+ asked to health check at ten second intervals, then after each ten second
+ lifecheck will spawn two child processes, one for each upstream server,
+ and each process will live until the ping command is finished.
+ </para>
+ </sect2>
+
+ </sect1>
+
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/biblio.sgml -->
+
+ <bibliography id="biblio">
+ <title>Bibliography</title>
+
+ <bibliodiv>
+ <title>Proceedings and Articles</title>
+
+ <biblioentry id="mishima2009">
+ <biblioset relation="article">
+ <title><ulink
+ url="http://www.vldb.org/pvldb/vol2/vldb09-694.pdf">Pangea: An
+ Eager Database Replication Middleware guaranteeing Snapshot
+ Isolation without modification of Database Servers</ulink></title>
+ <authorgroup>
+ <author>
+ <firstname>Takeshi</firstname>
+ <surname>Mishima</surname>
+ </author>
+ <author>
+ <firstname>Hiroshi</firstname>
+ <surname>Nakamura</surname>
+ </author>
+ </authorgroup>
+ </biblioset>
+ <confgroup>
+ <conftitle>VLDB Conference</conftitle>
+ <confdates>Aug. 2009</confdates>
+ <address>Lyon, France</address>
+ </confgroup>
+ </biblioentry>
+
+ </bibliodiv>
+ </bibliography>
--- /dev/null
+<!-- doc/src/sgml/client-auth.sgml -->
+
+<chapter id="client-authentication">
+ <title>Client Authentication</title>
+
+ <indexterm zone="client-authentication">
+ <primary>client authentication</primary>
+ </indexterm>
+
+ <para>
+ Since <productname>Pgpool-II</productname> is a middleware that works between
+ <productname>PostgreSQL</productname> servers and
+ a <productname>PostgreSQL</productname> database client, so when a
+ client application connects to
+ the <productname>Pgpool-II</productname>, <productname>Pgpool-II</productname>
+ in turn connects to the <productname>PostgreSQL</productname> servers
+ using the same credentials to serve the incoming client
+ connection. Thus, all the access privileges and restrictions defined
+ for the user in <productname>PostgreSQL</productname> gets
+ automatically applied to all <productname>Pgpool-II</productname>
+ clients, with an exceptions of the authentications
+ on <productname>PostgreSQL</productname> side that depends on the
+ client's IP addresses or host names. Reason being the connections
+ to the <productname>PostgreSQL</productname> server are made
+ by <productname>Pgpool-II</productname> on behalf of the connecting
+ clients and <productname>PostgreSQL</productname> server can only
+ see the IP address of the
+ <productname>Pgpool-II</productname> server and not that of the actual client.
+ Therefore, for the client host based authentications <productname>Pgpool-II</productname> has the
+ <literal>pool_hba</literal> mechanism similar to the <literal>pg_hba</literal> mechanism for
+ authenticating the incoming client connections.
+ </para>
+
+ <sect1 id="auth-pool-hba-conf">
+ <title>The <filename>pool_hba.conf</filename> File</title>
+
+ <indexterm zone="auth-pool-hba-conf">
+ <primary>pool_hba.conf</primary>
+ </indexterm>
+
+ <para>
+ Just like the <filename>pg_hba.conf</filename> file for <productname>PostgreSQL</productname>,
+ <productname>Pgpool-II</productname> supports a similar client authentication
+ function using a configuration file called <filename>pool_hba.conf</filename>.
+ If <productname>Pgpool-II</productname> is installed from source code, it also includes the sample
+ <filename>pool_hba.conf.sample</filename> file in the default
+ configuration directory (<literal>"/usr/local/etc"</literal>).
+ By default, pool_hba authentication is disabled, and
+ setting <varname>enable_pool_hba</varname>
+ to <literal>on</literal> enables it. see
+ the <xref linkend="guc-enable-pool-hba"> configuration
+ parameter.
+ </para>
+
+ <note>
+ <para>
+ If number of <productname>PostgreSQL</productname> servers is
+ only one, or when running in raw mode
+ (see <xref linkend="running-mode">),
+ <filename>pool_hba.conf</filename> is not necessary
+ thus <varname>enable_pool_hba</varname> may be being set to off.
+ In this case the client authentication method is completely
+ managed by <productname>PostgreSQL</productname>. Also number
+ of <productname>PostgreSQL</productname> servers is more than
+ one, or not running in raw
+ mode, <varname>enable_pool_hba</varname> may be being set to off
+ as long as the authentication method defined
+ by <productname>PostgreSQL</productname>
+ is <literal>trust</literal>.
+ </para>
+ </note>
+
+ <para>
+ The format of the <filename>pool_hba.conf</filename> file
+ follows very
+ closely <productname>PostgreSQL</productname>'s <filename>pg_hba.conf</filename>
+ format.
+ </para>
+ <para>
+ The general format of the <filename>pool_hba.conf</filename> file is
+ a set of records, one per line. Blank lines are ignored, as is any
+ text after the <literal>#</literal> comment character.
+ Records cannot be continued across lines.
+ A record is made
+ up of a number of fields which are separated by spaces and/or tabs.
+ Fields can contain white space if the field value is double-quoted.
+ Quoting one of the keywords in a database, user, or address field (e.g.,
+ <literal>all</literal> or <literal>replication</literal>) makes
+ the word lose its special meaning, and just match a database, user, or
+ host with that name.
+ </para>
+
+ <para>
+ Each record specifies a connection type, a client IP address
+ range (if relevant for the connection type), a database name, a
+ user name, and the authentication method to be used for
+ connections matching these parameters. The first record with a
+ matching connection type, client address, requested database,
+ and user name is used to perform authentication. There is
+ no <quote>fall-through</quote> or
+ <quote>backup</quote>: if one record is chosen and the authentication
+ fails, subsequent records are not considered. If no record matches,
+ access is denied.
+ </para>
+
+ <para>
+ A record can have one of the following formats
+ <synopsis>
+ local <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+
+ host <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>IP-address</replaceable> <replaceable>IP-mask</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+ hostssl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>IP-address</replaceable> <replaceable>IP-mask</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>IP-address</replaceable> <replaceable>IP-mask</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+
+ host <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+ hostssl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
+ </synopsis>
+ The meaning of the fields is as follows:
+
+ <variablelist>
+ <varlistentry>
+ <term><literal>local</literal></term>
+ <listitem>
+ <para>
+ This record matches connection attempts using Unix-domain
+ sockets. Without a record of this type, Unix-domain socket
+ connections are disallowed.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>host</literal></term>
+ <listitem>
+ <para>
+ This record matches connection attempts made using TCP/IP.
+ <literal>host</literal> records match either
+ <acronym>SSL</acronym> or non-<acronym>SSL</acronym> connection
+ attempts.
+ </para>
+ <note>
+ <para>
+ Remote TCP/IP connections will not be possible unless
+ the server is started with an appropriate value for the
+ <xref linkend="guc-listen-addresses"> configuration parameter,
+ since the default behavior is to listen for TCP/IP connections
+ only on the local loopback address <literal>localhost</literal>.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>hostssl</literal></term>
+ <listitem>
+ <para>
+ This record matches connection attempts made using TCP/IP, but only
+ when the connection is made with <acronym>SSL</acronym> encryption.
+ </para>
+ <para>
+ To make use of this option the <productname>Pgpool-II</productname> must be
+ built with SSL support. Furthermore, SSL must be enabled by setting the <xref linkend="guc-ssl">
+ configuration parameter. Otherwise, the hostssl record is ignored.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>hostnossl</literal></term>
+ <listitem>
+ <para>
+ This record type has the opposite behavior of hostssl; it only matches connection
+ attempts made over TCP/IP that do not use <acronym>SSL</acronym>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable>database</replaceable></term>
+ <listitem>
+ <para>
+ Specifies which database name(s) this record matches. The value
+ <literal>all</literal> specifies that it matches all databases.
+ <note>
+ <para>
+ <literal>"samegroup"</literal> for database field is not supported:
+ </para>
+ <para>
+ Since <productname>Pgpool-II</productname> does not know anything about
+ users in the <productname>PostgreSQL</productname> backend server, the database name is simply
+ compared against the entries in the database field of <filename>pool_hba.conf</filename>.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable>user</replaceable></term>
+ <listitem>
+ <para>
+ Specifies which database user name(s) this record
+ matches. The value <literal>all</literal> specifies that it
+ matches all users. Otherwise, this is the name of a specific
+ database user
+ <note>
+ <para>
+ group names following <literal>"+"</literal> for user field is not supported:
+ </para>
+ <para>
+ This is for the same reason as for the <literal>"samegroup"</literal> of database field.
+ A user name is simply checked against the entries in the user field of
+ <filename>pool_hba.conf</filename>.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable>address</replaceable></term>
+ <listitem>
+ <para>
+ Specifies the client machine address(es) that this record matches.
+ This field can contain either a host name, an IP address range,
+ or one of the special key words mentioned below.
+ </para>
+
+ <para>
+ An IP address range is specified using standard numeric notation for
+ the range's starting address, then a slash (<literal>/</literal>)
+ and a <acronym>CIDR</acronym> mask length.
+ The mask length indicates the number of high-order bits of the client
+ IP address that must match. Bits to the right of this should be zero
+ in the given IP address. There must not be any white space between the
+ IP address, the <literal>/</literal>, and the CIDR mask length.
+ </para>
+
+ <para>
+ Typical examples of an IPv4 address range specified this way are
+ <literal>172.20.143.89/32</literal> for a single host, or
+ <literal>172.20.143.0/24</literal> for a small network, or
+ <literal>10.6.0.0/16</literal> for a larger one.
+ An IPv6 address range might look like <literal>::1/128</literal> for
+ a single host (in this case the IPv6 loopback address) or
+ <literal>fe80::7a31:c1ff:0000:0000/96</literal> for a small network.
+ <literal>0.0.0.0/0</literal> represents all IPv4 addresses, and
+ <literal>::0/0</literal> represents all IPv6 addresses. To specify a
+ single host, use a mask length of 32 for IPv4 or 128 for IPv6.
+ In a network address, do not omit trailing zeroes.
+ </para>
+
+ <para>
+ An entry given in IPv4 format will match only IPv4 connections, and
+ an entry given in IPv6 format will match only IPv6 connections, even
+ if the represented address is in the IPv4-in-IPv6 range.
+ Note that entries in IPv6 format will be rejected if the system's C
+ library does not have support for IPv6 addresses.
+ </para>
+
+ <para>
+ You can also write <literal>all</literal> to match any IP address,
+ <literal>samehost</literal> to match any
+ of the server's own IP addresses, or samenet to match any address in
+ any <literal>subnet</literal> that the server is directly connected to.
+ </para>
+
+ <para>
+ If a host name is specified (anything that is not an IP address range or
+ a special key word is treated as a host name), that name is compared with
+ the result of a reverse name resolution of the client's IP address
+ (e.g., reverse DNS lookup, if DNS is used). Host name comparisons are
+ case insensitive. If there is a match, then a forward name resolution
+ (e.g., forward DNS lookup) is performed on the host name to check whether
+ any of the addresses it resolves to are equal to the client's IP address.
+ If both directions match, then the entry is considered to match.
+ (The host name that is used in <filename>pool_hba.conf</filename> should be the one that
+ address-to-name resolution of the client's IP address returns, otherwise
+ the line won't be matched. Some host name databases allow associating an
+ IP address with multiple host names, but the operating system will only
+ return one host name when asked to resolve an IP address.)
+ </para>
+
+ <para>
+ A host name specification that starts with a dot (<literal>.</literal>) matches
+ a suffix of the actual host name. So <literal>.example.com</literal> would match
+ <literal>foo.example.com</literal> (but not just <literal>example.com</literal>).
+ </para>
+
+ <para>
+ When host names are specified in <filename>pool_hba.conf</filename>, you should
+ make sure that name resolution is reasonably fast. It can be of advantage to
+ set up a local name resolution cache such as <acronym>nscd</acronym>.
+ </para>
+
+ <para>
+ This field only applies to host, hostssl, and hostnossl records.
+ </para>
+ <para>
+ Specifying the host name in address field is not supported prior to
+ <productname>Pgpool-II </productname><emphasis>V3.7</emphasis>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable>IP-address</replaceable></term>
+ <term><replaceable>IP-mask</replaceable></term>
+ <listitem>
+ <para>
+ These two fields can be used as an alternative to the
+ <replaceable>IP-address</replaceable><literal>/</literal>
+ <replaceable>mask-length</replaceable> notation.
+ Instead of specifying the mask length, the actual mask
+ is specified in a separate column. For
+ example, <literal>255.0.0.0</literal> represents an
+ IPv4 <acronym>CIDR</acronym> mask length
+ of <literal>8</literal>,
+ and <literal>255.255.255.255</literal> represents a
+ <acronym>CIDR</acronym> mask length of 32.
+ </para>
+
+ <para>
+ This field only applies to host, hostssl, and hostnossl records.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable>auth-method</replaceable></term>
+ <listitem>
+ <para>
+ Specifies the authentication method to use when a connection matches
+ this record. The possible choices are summarized here; details
+ are in <xref linkend="auth-methods">.
+
+ <variablelist>
+ <varlistentry>
+ <term><literal>trust</literal></term>
+ <listitem>
+ <para>
+ Allow the connection unconditionally. This method
+ allows anyone that can connect to the
+ <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>reject</literal></term>
+ <listitem>
+ <para>
+ Reject the connection unconditionally. This is useful for
+ <quote>filtering out</quote> certain hosts, for example a
+ <literal>reject</literal> line could block a specific
+ host from connecting.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>md5</literal></term>
+ <listitem>
+ <para>
+ Require the client to supply a double-MD5-hashed password for
+ authentication.
+
+ <note>
+ <para>
+ To use <literal>md5</literal>
+ authentication, you need to register the
+ user name and password
+ in <xref linkend="guc-pool-passwd"> file.
+ See <xref linkend="auth-md5"> for more
+ details. If you don't want to manage
+ password by
+ using <filename>pool_passwd</filename>,
+ you could
+ use <xref linkend="guc-allow-clear-text-frontend-auth">.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>scram-sha-256</literal></term>
+ <listitem>
+ <para>
+ Perform SCRAM-SHA-256 authentication to verify the user's password.
+ <note>
+ <para>
+ To use <literal>scram-sha-256</literal>
+ authentication, you need to register the
+ user name and password
+ in <xref linkend="guc-pool-passwd"> file.
+ See <xref linkend="auth-scram"> for more
+ details. If you don't want to manage
+ password by
+ using <filename>pool_passwd</filename>,
+ you could
+ use <xref linkend="guc-allow-clear-text-frontend-auth">.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>cert</literal></term>
+ <listitem>
+ <para>
+ Authenticate using SSL client certificates.
+ See <xref linkend="auth-cert"> for more details.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>pam</literal></term>
+ <listitem>
+ <para>
+ Authenticate using the Pluggable Authentication Modules
+ (PAM) service provided by the operating system.
+ See <xref linkend="auth-pam"> for details.
+ </para>
+ <para>
+ PAM authentication is supported using user information on the host
+ where <productname>Pgpool-II</productname> is running.
+ To enable PAM support the <productname>Pgpool-II</productname>
+ must be configured with <command>"--with-pam"</command>
+ </para>
+ <para>
+ To enable PAM authentication, you must create a
+ service-configuration file
+ for <productname>Pgpool-II</productname> in the system's PAM
+ configuration directory (that is usually located
+ at <literal>"/etc/pam.d"</literal>). A sample
+ service-configuration file is also installed
+ as <literal>"share/pgpool.pam"</literal> under the install
+ directory.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>ldap</literal></term>
+ <listitem>
+ <para>
+ Authenticate using LDAP server.
+ See <xref linkend="auth-ldap"> for more details.
+ </para>
+ <para>
+ To enable LDAP support the <productname>Pgpool-II</productname>
+ must be configured with <command>"--with-ldap"</command>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable>auth-options</replaceable></term>
+ <listitem>
+ <para>
+ After the <replaceable>auth-method</replaceable> field,
+ there can be field(s) of the
+ form <replaceable>name</replaceable><literal>=</literal>
+ <replaceable>value</replaceable>
+ that specify options for the authentication method.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ Since the <filename>pool_hba.conf</filename> records are examined
+ sequentially for each connection attempt, the order of the records
+ is significant. Typically, earlier records will have tight
+ connection match parameters and weaker authentication methods, while
+ later records will have looser match parameters and stronger
+ authentication methods. For example, one might wish to
+ use <literal>trust</literal> authentication for local TCP/IP
+ connections but require a password for remote TCP/IP connections. In
+ this case a record specifying
+ <literal>trust</literal> authentication for connections from 127.0.0.1 would
+ appear before a record specifying password authentication for a wider
+ range of allowed client IP addresses.
+ </para>
+
+ <tip>
+ <para>
+ All pool_hba authentication options described in this section are
+ about the authentication taking place between a client and the
+ <productname>Pgpool-II</productname>. A client still has to go
+ through the <productname>PostgreSQL</productname>'s authentication
+ process and must have the <literal>CONNECT</literal> privilege for
+ the database on the backend <productname>PostgreSQL</productname>
+ server.
+ </para>
+ <para>
+ As far as pool_hba is concerned, it does not matter if a user name
+ and/or database name given by a client
+ (i.e. <command>psql -U testuser testdb</command>)
+ really exists in the backend. pool_hba only cares if a match in the
+ <filename>pool_hba.conf</filename> can be found or not.
+ </para>
+ </tip>
+
+ <para>
+ Some examples of <filename>pool_hba.conf</filename> entries.
+ See the next section for details on the different authentication methods.
+ </para>
+
+ <example id="example-pg-hba.conf">
+ <title>Example <filename>pool_hba.conf</filename> Entries</title>
+ <programlisting>
+ # Allow any user on the local system to connect to any database with
+ # any database user name using Unix-domain sockets (the default for local
+ # connections).
+ #
+ # TYPE DATABASE USER ADDRESS METHOD
+ local all all trust
+
+ # The same using local loopback TCP/IP connections.
+ #
+ # TYPE DATABASE USER ADDRESS METHOD
+ host all all 127.0.0.1/32 trust
+
+ # Allow any user from host 192.168.12.10 to connect to database
+ # "postgres" if the user's password is correctly supplied.
+ #
+ # TYPE DATABASE USER ADDRESS METHOD
+ host postgres all 192.168.12.10/32 md5
+ </programlisting>
+ </example>
+ </sect1>
+
+ <sect1 id="auth-methods">
+ <title>Authentication Methods</title>
+ <para>
+ The following subsections describe the authentication methods in more detail.
+ </para>
+
+ <sect2 id="auth-trust">
+ <title>Trust Authentication</title>
+
+ <para>
+ When <literal>trust</literal> authentication is specified,
+ <productname>Pgpool-II</productname> assumes that anyone who can
+ connect to the server is authorized to access connect with
+ whatever database user name they specify.
+ </para>
+ </sect2>
+
+ <sect2 id="auth-md5">
+ <title>MD5 Password Authentication</title>
+
+ <indexterm>
+ <primary>MD5</primary>
+ </indexterm>
+
+ <para>
+ This authentication method is the password-based authentication
+ methods in which MD-5-hashed password is sent by client.
+ Since <productname>Pgpool-II</productname> does not has the
+ visibility of <productname>PostgreSQL</productname>'s database
+ user password and client application only sends the MD5-hash of
+ the password, so <literal>md5</literal> authentication
+ in <productname>Pgpool-II</productname> is supported using the
+ <xref linkend="guc-pool-passwd"> authentication file.
+ </para>
+
+ <note>
+ <para>
+ If <productname>Pgpool-II</productname> is operated in raw
+ mode or there's only 1 backend configured, you don't need to
+ setup <xref linkend="guc-pool-passwd">.
+ </para>
+ </note>
+
+ <sect3 id="md5-authentication-file-format">
+ <title>Authentication file format</title>
+ <para>
+ To use the <literal>md5</literal> authentication
+ <xref linkend="guc-pool-passwd"> authentication file
+ must contain the user password in either plain text
+ <literal>md5</literal> or <literal>AES</literal> encrypted format.
+ </para>
+ <para>
+ The <xref linkend="guc-pool-passwd"> file should contain lines in the following format:
+ <programlisting>
+ "username:plain_text_passwd"
+ </programlisting>
+ <programlisting>
+ "username:encrypted_passwd"
+ </programlisting>
+ </para>
+ </sect3>
+
+ <sect3 id="setting-md5-authentication">
+ <title>Setting md5 Authentication</title>
+ <indexterm zone="setting-md5-authentication">
+ <primary>MD5</primary>
+ </indexterm>
+
+ <para>
+ here are the steps to enable <literal>md5</literal>
+ authentication:
+ </para>
+ <para>
+ 1- Login as the database's operating system user and type
+ <command>"pg_md5 --md5auth --username=username password"</command> user name
+ and <literal>md5</literal> encrypted password are registered
+ into <xref linkend="guc-pool-passwd">. If pool_passwd does not exist yet, pg_md5
+ command will automatically create it for you.
+ <note>
+ <para>
+ user name and password must be identical to those registered
+ in <productname>PostgreSQL</productname> server.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ 2- Add an appropriate md5 entry to <filename>pool_hba.conf</filename>.
+ See <xref linkend="auth-pool-hba-conf"> for more details.
+ </para>
+ <para>
+ 3- After changing md5 password (in both pool_passwd
+ and <productname>PostgreSQL</productname> of course), reload
+ the pgpool configurations.
+ </para>
+ </sect3>
+
+ </sect2>
+
+ <sect2 id="auth-scram">
+ <title>scram-sha-256 Authentication</title>
+
+ <indexterm zone="auth-scram">
+ <primary>SCRAM</primary>
+ </indexterm>
+
+ <para>
+ This authentication method also known as SCRAM is a
+ challenge-response based authentication that prevents the
+ password sniffing on untrusted connections.
+ Since <productname>Pgpool-II</productname> does not has the
+ visibility of <productname>PostgreSQL</productname>'s database user
+ password, so <literal>SCRAM</literal> authentication is supported using the
+ <xref linkend="guc-pool-passwd"> authentication file.
+ </para>
+
+ <sect3 id="scram-authentication-file-format">
+ <title>Authentication file entry for SCRAM</title>
+
+ <para>
+ To use the <literal>SCRAM</literal> authentication
+ <xref linkend="guc-pool-passwd"> authentication file
+ must contain the user password in either plain text
+ or <literal>AES</literal> encrypted format.
+
+ <programlisting>
+ "username:plain_text_passwd"
+ </programlisting>
+ <programlisting>
+ "username:AES_encrypted_passwd"
+ </programlisting>
+ <note>
+ <para>
+ <literal>md5</literal> type user passwords in
+ <xref linkend="guc-pool-passwd"> file can't be used for
+ <literal>scram</literal> authentication
+ </para>
+ </note>
+ </para>
+ </sect3>
+
+ <sect3 id="setting-scram-sha-256-authentication">
+ <title>Setting scram-sha-256 Authentication</title>
+ <indexterm zone="setting-scram-sha-256-authentication">
+ <primary>SCRAM</primary>
+ </indexterm>
+
+ <para>
+ Here are the steps to enable <literal>scram-sha-256</literal>
+ authentication:
+ </para>
+ <para>
+ 1- Create <xref linkend="guc-pool-passwd"> file entry
+ for database user and password in plain text or <literal>AES</literal>
+ encrypted format.
+ The <xref linkend="PG-ENC"> utility that comes with <productname>Pgpool-II</productname>
+ can be used to create the <literal>AES</literal> encrypted password
+ entries in the <xref linkend="guc-pool-passwd"> file.
+ <note>
+ <para>
+ User name and password must be identical to those registered
+ in the <productname>PostgreSQL</productname> server.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ 2- Add an appropriate scram-sha-256 entry to <filename>pool_hba.conf</filename>.
+ See <xref linkend="auth-pool-hba-conf"> for more details.
+ </para>
+ <para>
+ 3- After changing SCRAM password (in both pool_passwd
+ and <productname>PostgreSQL</productname> of course), reload
+ the <productname>Pgpool-II</productname> configuration.
+ </para>
+ </sect3>
+
+ </sect2>
+
+ <sect2 id="auth-cert">
+ <title>Certificate Authentication</title>
+
+ <indexterm zone="auth-cert">
+ <primary>Certificate</primary>
+ </indexterm>
+
+ <para>
+ This authentication method uses <literal>SSL</literal> client certificates
+ to perform authentication. It is therefore only available for SSL connections.
+ When using this authentication method, the <productname>Pgpool-II</productname>
+ will require that the client provide a valid certificate.
+ No password prompt will be sent to the client.
+ The <literal>cn</literal> (Common Name) attribute of the certificate will be
+ compared to the requested database user name, and if they match the login will
+ be allowed.
+ </para>
+
+ <note>
+ <para>
+ The certificate authentication works between only client and
+ <productname>Pgpool-II</productname>. The certificate
+ authentication does not work between
+ <productname>Pgpool-II</productname> and
+ <productname>PostgreSQL</productname>. For backend
+ authentication you can use any other authentication method.
+ </para>
+ </note>
+
+ </sect2>
+
+ <sect2 id="auth-pam">
+ <title>PAM Authentication</title>
+
+ <indexterm zone="auth-pam">
+ <primary>PAM</primary>
+ </indexterm>
+
+ <para>
+ This authentication method uses PAM (Pluggable
+ Authentication Modules) as the authentication mechanism. The
+ default PAM service name is <literal>pgpool</literal>.
+ PAM authentication is supported using user information on
+ the host where <productname>Pgpool-II</productname> is executed.
+ For more
+ information about PAM, please read the
+ <ulink url="http://www.kernel.org/pub/linux/libs/pam/">
+ <productname>Linux-PAM</productname> Page</ulink>.
+ </para>
+
+ <para>
+ To enable PAM authentication, you need to create a service-configuration
+ file for <productname>Pgpool-II</productname> in the system's
+ PAM configuration directory (which is usually at <literal>"/etc/pam.d"</literal>).
+ A sample service-configuration file is installed as
+ <filename>"share/pgpool-II/pgpool.pam"</filename> under the install directory.
+ </para>
+
+ <note>
+ <para>
+ To enable PAM support the <productname>Pgpool-II</productname>
+ must be configured with <command>"--with-pam"</command>
+ </para>
+ </note>
+ </sect2>
+
+ <sect2 id="auth-ldap">
+ <title>LDAP Authentication</title>
+
+ <indexterm zone="auth-ldap">
+ <primary>LDAP</primary>
+ </indexterm>
+
+ <para>
+ This authentication method uses LDAP as the password certification method.
+ LDAP is used only to validate the user name/password pairs. Therefore the user must
+ already exist in the database before LDAP can be used for authentication.
+ </para>
+
+ <para>
+ LDAP authentication can operate in two modes. In the first mode, which we
+ will call the simple bind mode, the server will bind to the distinguished
+ name constructed as
+ <replaceable>prefix</replaceable> <replaceable>username</replaceable> <replaceable>suffix</replaceable>.
+ Typically, the <replaceable>prefix</replaceable> parameter is used to specify
+ <literal>cn=</literal>, or <replaceable>DOMAIN</replaceable><literal>\</literal>
+ in an Active Directory environment. <replaceable>suffix</replaceable> is used
+ to specify the remaining part of the DN in a non-Active Directory environment.
+ </para>
+
+ <para>
+ In the second mode, which we will call the search+bind mode, the server first
+ binds to the LDAP directory with a fixed user name and password, specified
+ with <replaceable>ldapbinddn</replaceable> and <replaceable>ldapbindpasswd</replaceable>,
+ and performs a search for the user trying to log in to the database. If no
+ user and password is configured, an anonymous bind will be attempted to the
+ directory. The search will be performed over the subtree at
+ <replaceable>ldapbasedn</replaceable>, and will try to do an exact match of
+ the attribute specified in <replaceable>ldapsearchattribute</replaceable>.
+ Once the user has been found in this search, the server disconnects and
+ re-binds to the directory as this user, using the password specified by the
+ client, to verify that the login is correct. This mode is the same as that
+ used by LDAP authentication schemes in other software, such as Apache
+ <literal>mod_authnz_ldap</literal> and <literal>pam_ldap</literal>. This
+ method allows for significantly more flexibility in where the user objects
+ are located in the directory, but will cause two separate connections to the
+ LDAP server to be made.
+ </para>
+
+ <para>
+ The following configuration options are used in both modes:
+ <variablelist>
+ <varlistentry>
+ <term><literal>ldapserver</literal></term>
+ <listitem>
+ <para>
+ Names or IP addresses of LDAP servers to connect to. Multiple servers
+ may be specified, separated by spaces.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapport</literal></term>
+ <listitem>
+ <para>
+ Port number on LDAP server to connect to. If no port is specified, the
+ LDAP library's default port setting will be used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapscheme</literal></term>
+ <listitem>
+ <para>
+ Set to <literal>ldaps</literal> to use LDAPS. This is a non-standard
+ way of using LDAP over SSL, supported by some LDAP server implementations.
+ See also the <literal>ldaptls</literal> option for an alternative.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldaptls</literal></term>
+ <listitem>
+ <para>
+ Set to 1 to make the connection between Pgpool-II and the LDAP server
+ use TLS encryption. This uses the <literal>StartTLS</literal> operation
+ per RFC 4513. See also the <literal>ldapscheme</literal> option for an alternative.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ Note that using <literal>ldapscheme</literal> or
+ <literal>ldaptls</literal> only encrypts the traffic between the
+ Pgpool-II server and the LDAP server. The connection between the
+ Pgpool-II server and the client will still be unencrypted
+ unless SSL is used there as well.
+ </para>
+
+ <para>
+ The following options are used in simple bind mode only:
+ <variablelist>
+ <varlistentry>
+ <term><literal>ldapprefix</literal></term>
+ <listitem>
+ <para>
+ String to prepend to the user name when forming the DN to bind as,
+ when doing simple bind authentication.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapsuffix</literal></term>
+ <listitem>
+ <para>
+ String to append to the user name when forming the DN to bind as,
+ when doing simple bind authentication.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ The following options are used in search+bind mode only:
+ <variablelist>
+ <varlistentry>
+ <term><literal>ldapbasedn</literal></term>
+ <listitem>
+ <para>
+ Root DN to begin the search for the user in, when doing search+bind
+ authentication.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapbinddn</literal></term>
+ <listitem>
+ <para>
+ DN of user to bind to the directory with to perform the search when
+ doing search+bind authentication.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapbindpasswd</literal></term>
+ <listitem>
+ <para>
+ Password for user to bind to the directory with to perform the search
+ when doing search+bind authentication.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapsearchattribute</literal></term>
+ <listitem>
+ <para>
+ Attribute to match against the user name in the search when doing
+ search+bind authentication. If no attribute is specified, the
+ <literal>uid</literal> attribute will be used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapsearchfilter</literal></term>
+ <listitem>
+ <para>
+ The search filter to use when doing search+bind authentication.
+ Occurrences of <literal>$username</literal> will be replaced with the
+ user name. This allows for more flexible search filters than
+ <literal>ldapsearchattribute</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ldapurl</literal></term>
+ <listitem>
+ <para>
+ An RFC 4516 LDAP URL. This is an alternative way to write some of the
+ other LDAP options in a more compact and standard form. The format is
+<synopsis>
+ldap[s]://<replaceable>host</replaceable>[:<replaceable>port</replaceable>]/<replaceable>basedn</replaceable>[?[<replaceable>attribute</replaceable>][?[<replaceable>scope</replaceable>][?[<replaceable>filter</replaceable>]]]]
+</synopsis>
+ <replaceable>scope</replaceable> must be one of <literal>base</literal>,
+ <literal>one</literal>, <literal>sub</literal>, typically the last.
+ (The default is <literal>base</literal>, which is normally not useful
+ in this application.) <replaceable>attribute</replaceable> can nominate
+ a single attribute, in which case it is used as a value for <literal>ldapsearchattribute</literal>.
+ If <replaceable>attribute</replaceable> is empty then <replaceable>filter</replaceable>
+ can be used as a value for <literal>ldapsearchfilter</literal>.
+ </para>
+
+ <para>
+ The URL scheme <literal>ldaps</literal> chooses the LDAPS method for
+ making LDAP connections over SSL, equivalent to using <literal>ldapscheme=ldaps</literal>.
+ To use encrypted LDAP connections using the <literal>StartTLS</literal>
+ operation, use the normal URL scheme <literal>ldap</literal> and specify the
+ <literal>ldaptls</literal> option in addition to <literal>ldapurl</literal>.
+ </para>
+
+ <para>
+ For non-anonymous binds, <literal>ldapbinddn</literal> and
+ <literal>ldapbindpasswd</literal> must be specified as separate options.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>backendusepasswd</literal></term>
+ <listitem>
+ <para>
+ Set to 1 to make the password used for LDAP authentication use authentication
+ between <productname>Pgpool-II</productname> and backend.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ It is an error to mix configuration options for simple bind with options
+ for search+bind.
+ </para>
+
+ <para>
+ When using search+bind mode, the search can be performed using a single
+ attribute specified with <literal>ldapsearchattribute</literal>, or using
+ a custom search filter specified with
+ <literal>ldapsearchfilter</literal>.
+ Specifying <literal>ldapsearchattribute=foo</literal> is equivalent to
+ specifying <literal>ldapsearchfilter="(foo=$username)"</literal>. If neither
+ option is specified the default is
+ <literal>ldapsearchattribute=uid</literal>.
+ </para>
+
+ <para>
+ If <productname>Pgpool-II</productname> was compiled with
+ <productname>OpenLDAP</productname> as the LDAP client library, the
+ <literal>ldapserver</literal> setting may be omitted. In that case, a
+ list of host names and ports is looked up via RFC 2782 DNS SRV records.
+ The name <literal>_ldap._tcp.DOMAIN</literal> is looked up, where
+ <literal>DOMAIN</literal> is extracted from <literal>ldapbasedn</literal>.
+ </para>
+
+ <para>
+ Here is an example for a simple-bind LDAP configuration:
+<programlisting>
+host ... ldap ldapserver=ldap.example.net ldapprefix="cn=" ldapsuffix=", dc=example, dc=net"
+</programlisting>
+ When a connection to the database server as database
+ user <literal>foo</literal> is requested, Pgpool-II will attempt to
+ bind to the LDAP server using the DN <literal>cn=foo, dc=example,
+ dc=net</literal> and the password provided by the client. If that connection
+ succeeds, the database access is granted.
+ </para>
+
+ <para>
+ Here is an example for a search+bind configuration:
+<programlisting>
+host ... ldap ldapserver=ldap.example.net ldapbasedn="dc=example, dc=net" ldapsearchattribute=uid
+</programlisting>
+ When a connection to the database server as database
+ user <literal>foo</literal> is requested, Pgpool-II will attempt to
+ bind anonymously (since <literal>ldapbinddn</literal> was not specified) to
+ the LDAP server, perform a search for <literal>(uid=foo)</literal>
+ under the specified base DN. If an entry is found, it will then attempt to
+ bind using that found information and the password supplied by the client.
+ If that second connection succeeds, the database access is granted.
+ </para>
+
+ <para>
+ Here is the same search+bind configuration written as a URL:
+<programlisting>
+host ... ldap ldapurl="ldap://ldap.example.net/dc=example,dc=net?uid?sub"
+</programlisting>
+ Some other software that supports authentication against LDAP uses the
+ same URL format, so it will be easier to share the configuration.
+ </para>
+
+ <para>
+ Here is an example for a search+bind configuration that uses
+ <literal>ldapsearchfilter</literal> instead of
+ <literal>ldapsearchattribute</literal> to allow authentication by
+ user ID or email address:
+<programlisting>
+host ... ldap ldapserver=ldap.example.net ldapbasedn="dc=example, dc=net" ldapsearchfilter="(|(uid=$username)(mail=$username))"
+</programlisting>
+ </para>
+
+ <para>
+ Here is an example for a search+bind configuration that uses DNS SRV
+ discovery to find the host name(s) and port(s) for the LDAP service for the
+ domain name <literal>example.net</literal>:
+<programlisting>
+host ... ldap ldapbasedn="dc=example,dc=net"
+</programlisting>
+ </para>
+
+ <tip>
+ <para>
+ Since LDAP often uses commas and spaces to separate the different
+ parts of a DN, it is often necessary to use double-quoted parameter
+ values when configuring LDAP options, as shown in the examples.
+ </para>
+ </tip>
+
+ <note>
+ <para>
+ To enable LDAP support the <productname>Pgpool-II</productname>
+ must be configured with <command>"--with-ldap"</command>
+ </para>
+ </note>
+ </sect2>
+ <sect2 id="auth-gssapi">
+ <title>GSSAPI Authentication</title>
+ <indexterm zone="auth-gssapi">
+ <primary>GSSAPI</primary>
+ </indexterm>
+
+ <para>
+ GSSAPI is an industry-standard protocol for secure authentication
+ defined in RFC 2743. Currently
+ <productname>Pgpool-II</productname> does not support GSSAPI.
+ Clients should not use GSSAPI authentication, or should use
+ "prefer GSSAPI authentication if possible" option (this is the
+ default setting of <productname>PostgreSQL</productname> clients).
+ If latter is chosen, <productname>Pgpool-II</productname> requests
+ non-GSSAPI authentication to client, and the clients will fall
+ back to non-GSSAPI authentication method. Thus, usually users do
+ not need to worry about that <productname>Pgpool-II</productname>
+ does not accept GSSAPI authentication.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="auth-different-auth-method">
+ <title>Using different methods for frontend and backend authentication</title>
+
+ <indexterm zone="auth-different-auth-method">
+ <primary>AUTH</primary>
+ </indexterm>
+
+ <para>
+ Since <productname>Pgpool-II</productname><emphasis>V4.0</emphasis>
+ it possible to use different authentication for client application
+ and backend <productname>PostgreSQL</productname> servers.
+ For example, a client application can use <literal>scram-sha-256</literal>
+ to connect to <productname>Pgpool-II</productname> which
+ in turn can use <literal>trust</literal> or <literal>md5</literal>
+ authentication to connect to <productname>PostgreSQL</productname>
+ backend for the same session.
+
+ </para>
+ </sect1>
+
+ <sect1 id="auth-aes-encrypted-password">
+ <title>Using AES256 encrypted passwords in <xref linkend="guc-pool-passwd"></title>
+
+ <indexterm zone="auth-aes-encrypted-password">
+ <primary>AUTH</primary>
+ </indexterm>
+
+ <para>
+ <literal>SCRAM</literal> authentication guards against the man-in-the-middle
+ type of attack, so <productname>Pgpool-II</productname> requires the user password
+ to authenticate with the <productname>PostgreSQL</productname> backend.
+ </para>
+
+ <para>
+ However, storing the clear text passwords in the <filename>"pool_passwd"</filename> file
+ is not a good idea.
+ </para>
+ <para>
+ You can instead store AES256 encrypted passwords, which will be used for authentication.
+ The password is first encrypted using the AES256 encryption with the user provided key
+ and then the encrypted password is <literal>base64</literal> encoded and
+ an <literal>AES</literal> prefix is added to the encoded string.
+ <note>
+ <para>
+ You can use the <xref linkend="PG-ENC"> utility to create the properly
+ formatted AES256 encrypted password.
+ </para>
+ </note>
+ </para>
+
+ <sect2 id="auth-create-aes-passwords">
+ <title>Creating encrypted password entries</title>
+ <para>
+ <xref linkend="PG-ENC"> can be used to create <literal>AES</literal>
+ encrypted password entries in <xref linkend="guc-pool-passwd"> file.
+ <xref linkend="PG-ENC"> requires the key for encrypting the password entries.
+ Later that same key will be required by <productname>Pgpool-II</productname>
+ to decrypt the passwords to use for authentication.
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> must be built with SSL
+ (--with-openssl) support to use the encrypted password feature.
+ </para>
+ </note>
+ </para>
+ </sect2>
+
+ <sect2 id="auth-aes-decryption-key">
+ <title>Providing decryption key to <productname>Pgpool-II</productname></title>
+
+ <para>
+ If you have <literal>AES</literal> encrypted passwords stored in the
+ <xref linkend="guc-pool-passwd"> file, then <productname>Pgpool-II</productname>
+ will require the decryption key to decrypt the passwords before using them,
+ <productname>Pgpool-II</productname> tries to read the decryption key at
+ startup from the <filename>.pgpoolkey</filename> file.
+ <indexterm><primary>pgpoolkey</primary></indexterm>
+ <indexterm><primary>PGPOOLKEYFILE</primary></indexterm>
+ <filename>.pgpoolkey</filename> is a plain text file which
+ contains the decryption key string.
+ </para>
+ <para>
+ By default the <productname>Pgpool-II</productname> will look for the
+ <filename>.pgpoolkey</filename> file in the user's home directory or the file
+ referenced by environment variable <literal>PGPOOLKEYFILE</literal>.
+ You can also specify the key file using the (-k, --key-file=KEY_FILE)
+ command line argument to the <xref linkend="PGPOOL"> command.
+ The permissions on .pgpoolkey must disallow any access to world or group.
+ Change the file permissions by the command <command>chmod 0600 ~/.pgpoolkey</command>.
+ </para>
+ </sect2>
+
+ </sect1>
+
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<chapter id="runtime-config">
+ <title>Server Configuration</title>
+
+ <indexterm>
+ <primary>configuration</primary>
+ <secondary>of the server</secondary>
+ </indexterm>
+
+ <para>
+ There are many configuration parameters that affect the behavior of
+ <productname>Pgpool-II</productname>. In the first section of this chapter we
+ describe how to interact with configuration parameters. The subsequent sections
+ discuss each parameter in detail.
+ </para>
+
+ <sect1 id="config-setting">
+ <title>Setting Parameters</title>
+
+ <sect2 id="config-setting-names-values">
+ <title>Parameter Names and Values</title>
+
+ <para>
+ All parameter names are case-insensitive. Every parameter takes a
+ value of one of five types: boolean, string, integer, floating point,
+ or enumerated (enum). The type determines the syntax for setting the
+ parameter:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>Boolean:</emphasis>
+ Values can be written as
+ <literal>on</literal>,
+ <literal>off</literal>,
+ <literal>true</literal>,
+ <literal>false</literal>,
+ <literal>yes</literal>,
+ <literal>no</literal>,
+ <literal>1</literal>,
+ <literal>0</literal>
+ (all case-insensitive) or any unambiguous prefix of one of these.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>String:</emphasis>
+ In general, enclose the value in single quotes, doubling any single
+ quotes within the value. Quotes can usually be omitted if the value
+ is a simple number or identifier, however.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>Numeric (integer and floating point):</emphasis>
+ A decimal point is permitted only for floating-point parameters.
+ Do not use thousands separators. Quotes are not required.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>Numeric with Unit:</emphasis>
+ The numeric parameters that describe the quantities of
+ memory or time have an implicit unit.
+ The unit might be kilobytes, megabytes, milliseconds,
+ seconds, or minutes.
+ For example:
+
+ <programlisting>
+ search_primary_node_timeout = 6min
+ memqcache_total_size = 64MB
+ </programlisting>
+ An unadorned numeric value for one of these settings will use
+ the parameter's default unit.
+ </para>
+ <para>
+ The unit name is case-sensitive, and there can be whitespace between the numeric value and the unit.
+ </para>
+ <para>Valid memory units are kB (kilobytes), MB (megabytes), GB (gigabytes), and TB (terabytes).</para>
+ <para>Valid time units are ms (milliseconds), s (seconds), min (minutes), h (hours), and d (days).</para>
+
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>Enumerated:</emphasis>
+ Enumerated-type parameters are written in the same way as string
+ parameters, but are restricted to have one of a limited set of
+ values. Enum parameter values are case-insensitive.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="config-setting-configuration-file">
+ <title>Parameter Interaction via the Configuration File</title>
+
+ <para>
+ The most fundamental way to set these parameters is to edit the file
+ <filename>pgpool.conf</><indexterm><primary>pgpool.conf</></>,
+ which is located in <literal>$prefix/etc/pgpool.conf</literal>, if it
+ installed from source code. An example of what this file might look like is:
+ <programlisting>
+ # This is a comment
+ listen_addresses = 'localhost'
+ port = 9999
+ serialize_accept = off
+ reset_query_list = 'ABORT; DISCARD ALL'
+ </programlisting>
+
+ One parameter is specified per line. The equal sign between name and
+ value is optional. Whitespace is insignificant (except within a quoted
+ parameter value) and blank lines are
+ ignored. Hash marks (<literal>#</literal>) designate the remainder
+ of the line as a comment. Parameter values that are not simple
+ identifiers or numbers must be single-quoted. To embed a single
+ quote in a parameter value, write either two quotes (preferred)
+ or backslash-quote.
+ </para>
+
+ <para>
+ Parameters set in this way provide default values for the cluster.
+ The settings seen by active sessions will be these values unless they
+ are overridden. The following sections describe ways in which the
+ administrator or user can override these defaults.
+ </para>
+
+ <para>
+ <indexterm>
+ <primary>SIGHUP</primary>
+ </indexterm>
+ The configuration file is reread whenever the main server process
+ receives a <systemitem>SIGHUP</> signal; this signal is most easily
+ sent by running <literal>pgpool reload</> from the command line. The main
+ pgpool process also propagates this signal to all its child
+ processes, so that next sessions also adopt the new values.
+ Some parameters can only be set at server start; any changes to their
+ entries in the configuration file will be ignored until the server is restarted.
+ Invalid parameter settings in the configuration file are likewise
+ ignored (but logged) during <systemitem>SIGHUP</> processing.
+ </para>
+ </sect2>
+
+ <sect2 id="config-setting-sql-command-interaction">
+ <title>Parameter Interaction via SQL Clients</title>
+
+ <para>
+ <productname>Pgpool-II</productname> also provides two SQL style
+ commands to interact with session-local configuration settings.
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ The <xref linkend="SQL-PGPOOL-SHOW"> command allows inspection of the
+ current value of all parameters.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The <xref linkend="SQL-PGPOOL-SET"> command allows modification of the
+ current value of those parameters that can be set locally to a
+ session; it has no effect on other sessions.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </sect2>
+ </sect1>
+
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-config-connection-pooling">
+ <title>Connection Pooling</title>
+
+ <para>
+ <productname>Pgpool-II</productname> maintains established
+ connections to the PostgreSQL servers, and reuses them whenever a
+ new connection with the same properties (i.e. user name, database,
+ protocol version) comes in. It reduces the connection overhead,
+ and improves system's overall throughput.
+ </para>
+
+ <sect2 id="runtime-config-connection-pooling-settings">
+ <title>Connection Pooling Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-connection-cache" xreflabel="connection_cache">
+ <term><varname>connection_cache</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>connection_cache</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Caches connections to backends when set to on. Default is on.
+ <emphasis>However, connections to <literal>template0</>, <literal>template1</>,
+ <literal>postgres</> and <literal>regression</> databases are not cached even if
+ <varname>connection_cache</> is on.</emphasis>
+ </para>
+ <para>
+ You need to restart <productname>Pgpool-II</productname>
+ if you change this value.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-max-pool" xreflabel="max_pool">
+ <term><varname>max_pool</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>max_pool</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The maximum number of cached connections
+ in each <productname>Pgpool-II</productname> child
+ process. <productname>Pgpool-II</productname> reuses the
+ cached connection if an incoming connection is connecting
+ to the same database with the same user name and the same
+ run-time parameters. If not,
+ <productname>Pgpool-II</productname> creates a new
+ connection to the backend. If the number of cached
+ connections exceeds max_pool, the oldest connection will
+ be discarded, and uses that slot for the new connection.
+ </para>
+ <para>
+ Default value is 4. Please be aware that the number of
+ connections from <productname>Pgpool-II</productname> processes to the backends may reach
+ num_init_children * max_pool in total.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-listen-backlog-multiplier" xreflabel="listen_backlog_multiplier">
+ <term><varname>listen_backlog_multiplier</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>listen_backlog_multiplier</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the length of connection queue from frontend to
+ <productname>Pgpool-II</productname>. The queue length (actually
+ <literal>"backlog"</literal> parameter of <literal>listen()</literal>
+ system call) is defined as
+ <varname>listen_backlog_multiplier</varname> * <xref linkend="guc-num-init-children">.
+ </para>
+ <note>
+ <para>
+ Some systems have the upper limit of the backlog parameter of
+ <literal>listen()</literal> system call.
+ See <xref linkend="guc-num-init-children"> for more details.
+ </para>
+ </note>
+ <para>
+ Default is 2.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-serialize-accept" xreflabel="serialize_accept">
+ <term><varname>serialize_accept</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>serialize_accept</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> enables the serialization
+ on incoming client connections.
+ Without serialization the OS kernel wakes up all of the <productname>
+ Pgpool-II</productname> children processes to execute <literal>accept()</> and one of them
+ actually gets the incoming connection. The problem here is, because so my child
+ process wake up at a same time, heavy context switching occurs and the
+ performance is affected.
+ </para>
+ <para>
+ This phenomena is a well known classic problem called
+ "the thundering herd problem". This can be solved by the
+ serialization of the <literal>accept()</> calls, so that only one
+ <productname>Pgpool-II</productname> process gets woken up
+ for incoming connection to execute the <literal>accept()
+ </literal>.
+ </para>
+
+ <para>
+ But serialization has its own overheads, and it is recommended
+ to be used only with the larger values of <xref linkend="guc-num-init-children">.
+ For the small number of <xref linkend="guc-num-init-children">,
+ the serialize accept can degrade the performance because of
+ serializing overhead.
+ </para>
+
+ <note>
+ <para>
+ It is recommended to do a benchmark before deciding whether to use
+ <varname>serialize_accept</varname> or not, because the correlation
+ of <xref linkend="guc-num-init-children"> and <varname>serialize_accept</varname>
+ can be different on different environments.
+ </para>
+ </note>
+
+ <example id="example-serialize-accept-pgbench">
+ <title>Using pgbench to decide if serialize_accept should be used</title>
+ <para>
+ To run the <command>pgbench</command> use the following
+ command.
+ <programlisting>
+ pgbench -n -S -p 9999 -c 32 -C -S -T 300 test
+ </programlisting>
+ Here, <literal>-C</literal> tells <command>pgbench</command> to connect
+ to database each time a transaction gets executed. <literal>-c 32</literal>
+ specifies the number of the concurrent sessions to <productname>Pgpool-II</productname>.
+ You should change this according to your system's requirement.
+ After <command>pgbench</command> finishes, check the number from
+ "including connections establishing".
+ </para>
+ </example>
+
+ <note>
+ <para>
+ When <xref linkend="guc-child-life-time"> is enabled, <varname>serialize_accept</varname>
+ has no effect. Make sure that you set <xref linkend="guc-child-life-time"> to 0 if you intend
+ to turn on the <varname>serialize_accept</varname>.
+ And if you are worried about <productname>Pgpool-II</productname> process memory leaks
+ or whatever potential issue, you could use <xref linkend="guc-child-max-connections"> instead.
+ This is purely an implementation limitation and may be removed in the future.
+ </para>
+ </note>
+
+ <para>
+ Default is off.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-child-life-time" xreflabel="child_life_time">
+ <term><varname>child_life_time</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>child_life_time</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the time in seconds to terminate a <productname>Pgpool-II
+ </productname> child process if it remains idle. The new child process
+ is immediately spawned by <productname>Pgpool-II</productname> when it
+ is terminated because of <varname>child_life_time</varname>.
+ <varname>child_life_time</varname> is a measure to prevent the
+ memory leaks and other unexpected errors in <productname>Pgpool-II
+ </productname> children.
+ </para>
+ <note>
+ <para>
+ <varname>child_life_time</varname> does not apply to
+ processes that have not accepted any connection yet.
+ </para>
+ </note>
+ <note>
+ <para>
+ <xref linkend="guc-serialize-accept"> becomes ineffective when
+ <varname>child_life_time</varname> is enabled.
+ </para>
+ </note>
+ <para>
+ Default is 300 (5 minutes) and setting it to 0 disables the feature.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-client-idle-limit" xreflabel="client_idle_limit">
+ <term><varname>client_idle_limit</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>client_idle_limit</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the time in seconds to disconnect a client if it remains idle
+ since the last query.
+ This is useful for preventing the <productname>Pgpool-II</productname>
+ children from being occupied by a lazy clients or broken TCP/IP
+ connection between client and <productname>Pgpool-II</productname>.
+ </para>
+ <note>
+ <para>
+ <varname>client_idle_limit</varname> is ignored in
+ the second stage of online recovery.
+ </para>
+ </note>
+ <para>
+ The default is 0, which turns off the feature.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-child-max-connections" xreflabel="child_max_connections">
+ <term><varname>child_max_connections</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>child_max_connections</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the lifetime of a <productname>Pgpool-II</productname>
+ child process in terms of the number of client connections it can receive.
+ <productname>Pgpool-II</productname> will terminate the child process
+ after it has served <varname>child_max_connections</varname> client
+ connections and will immediately spawn a new child process to take its place.
+ </para>
+ <para>
+ <varname>child_max_connections</varname> is useful on a very busy server,
+ where <xref linkend="guc-child-life-time"> and <xref linkend="guc-connection-life-time">
+ never gets triggered. It is also useful to prevent the <productname>PostgreSQL</> servers from getting
+ too big.
+ </para>
+ <para>
+ The default is 0, which turns off the feature.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-connection-life-time" xreflabel="connection_life_time">
+ <term><varname>connection_life_time</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>connection_life_time</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the time in seconds to terminate the cached connections
+ to the PostgreSQL backend. This serves as the cached connection expiration time.
+ </para>
+ <para>
+ The default is 0, which means the cached connections will not be disconnected.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-reset-query-list" xreflabel="reset_query_list">
+ <term><varname>reset_query_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>reset_query_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the <acronym>SQL</acronym> commands to be sent to reset the backend connection
+ when exiting the user session. Multiple commands can be specified by delimiting each
+ by <literal>";"</literal>.
+ </para>
+
+ <para>
+ The available commands differ among <productname>PostgreSQL</> versions.
+ Below are some recommended settings for <varname>reset_query_list</varname>
+ on different <productname>PostgreSQL</> versions.
+ Note, however, that <literal>ABORT</literal> command should be always included.
+ </para>
+
+ <table id="reset-query-list-suggestions-table">
+ <title>Recommended setting for <varname>reset_query_list</varname>
+ on different PostgreSQL versions</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>PostgreSQL version</entry>
+ <entry>reset_query_list</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>7.1 or earlier</entry>
+ <entry><literal>'ABORT'</literal></entry>
+ </row>
+
+ <row>
+ <entry>7.2 to 8.2</entry>
+ <entry><literal>'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'</literal></entry>
+ </row>
+
+ <row>
+ <entry>8.3 or later</entry>
+ <entry><literal>'ABORT; DISCARD ALL'</literal></entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>
+ <literal>"ABORT"</literal> is not issued when not in a transaction block for 7.4 or later
+ <productname>PostgreSQL</> versions.
+ </para>
+ </note>
+ <para>
+ Default is <literal>'ABORT; DISCARD ALL'</literal>.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+</sect1>
+
+<sect1 id="runtime-config-logging">
+ <title>Error Reporting and Logging</title>
+
+ <sect2 id="runtime-config-logging-where-to-log">
+ <title>Where To Log</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-log-destination" xreflabel="log_destination">
+ <term><varname>log_destination</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>log_destination</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> supports two destinations
+ for logging the <productname>Pgpool-II</productname> messages.
+ The supported log destinations are <literal>stderr</literal>
+ and <literal>syslog</literal>. You can also set this parameter to a list
+ of desired log destinations separated by commas if you want the log messages
+ on the multiple destinations.
+ <programlisting>
+ #for example to log on both syslog and stderr
+ log_destination = 'syslog,stderr'
+ </programlisting>
+ The default is to log to <literal>stderr</literal> only.
+ </para>
+ <note>
+ <para>
+ On some systems you will need to alter the configuration of your
+ system's <application>syslog</application> daemon in order to make use of the
+ <literal>syslog</literal> option
+ for <varname>log_destination</varname>. <productname>Pgpool-II</productname>
+ can log to <application>syslog</application> facilities LOCAL0 through LOCAL7
+ (see <xref linkend="guc-syslog-facility">), but the default
+ <application>syslog</application>
+ configuration on most platforms will discard all such messages.
+ You will need to add something like:
+ <programlisting>
+ local0.* /var/log/pgpool.log
+ </programlisting>
+ to the syslog daemon's configuration file to make it work.
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-logging-collector" xreflabel="logging_collector">
+ <term><varname>logging_collector</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>logging_collector</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ This parameter enables the logging collector, which is a background process that captures
+ log messages sent to stderr and redirects them into log files.
+ </para>
+ <note>
+ <para>
+ It is possible to log to stderr without using the logging collector; the log messages will
+ just go to wherever the server's stderr is directed. However, that method is only suitable
+ for low log volumes, since it provides no convenient way to rotate log files.
+ </para>
+ </note>
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+ <para>
+ <varname>logging_collector</varname> is not available prior to
+ <productname>Pgpool-II </productname><emphasis>V4.2</emphasis>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-directory" xreflabel="log_directory">
+ <term><varname>log_directory</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>log_directory</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When <xref linkend="guc-logging-collector"> is enabled, this parameter determines
+ the directory in which log files will be created.
+ </para>
+ <para>The default is <literal>/tmp/pgpool_logs</literal>.</para>
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-filename" xreflabel="log_filename">
+ <term><varname>log_filename</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>log_filename</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When <xref linkend="guc-logging-collector"> is enabled, this parameter sets the
+ file names of the created log files. The value is treated as a
+ <literal>strftime</literal> pattern, so %-escapes can be used to specify time-varying
+ file names.
+ The supported %-escapes are similar to those listed in the Open Group's
+ <ulink url="https://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html">strftime</ulink>specification.
+ </para>
+ <para>
+ If you specify a file name without escapes, you should plan to use a log rotation
+ utility to avoid eventually filling the entire disk.
+ </para>
+ <para>
+ The default is <literal>pgpool-%Y-%m-%d_%H%M%S.log</literal>.
+ </para>
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-file-mode" xreflabel="log_file_mode">
+ <term><varname>log_file_mode</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>log_file_mode</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ This parameter sets the permissions for log files when <xref linkend="guc-logging-collector">
+ is enabled. The parameter value is expected to be a numeric mode specified in the format
+ accepted by the <literal>chmod</literal> and <literal>umask</literal> system calls.
+ </para>
+
+ <note>
+ <para>
+ To use the customary octal format the number must start with a 0 (zero).
+ </para>
+ </note>
+
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-rotation-age" xreflabel="log_rotation_age">
+ <term><varname>log_rotation_age</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>log_rotation_age</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When <xref linkend="guc-logging-collector"> is enabled, this parameter determines
+ the maximum amount of time to use an individual log file, after which a new log
+ file will be created. If this value is specified without units,
+ it is taken as minutes. The default is 24 hours.
+ </para>
+ <para>
+ Set to zero to disable size-based creation of new log files.
+ </para>
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-rotation-size" xreflabel="log_rotation_size">
+ <term><varname>log_rotation_size</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>log_rotation_size</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When <xref linkend="guc-logging-collector"> is enabled, this parameter determines
+ the maximum size of an individual log file. After this many kilobytes have been
+ emitted into a log file, a new log file will be created.
+ </para>
+ <para>
+ Set to zero to disable size-based creation of new log files.
+ </para>
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-truncate-on-rotation" xreflabel="log_truncate_on_rotation">
+ <term><varname>log_truncate_on_rotation</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_truncate_on_rotation</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When <xref linkend="guc-logging-collector"> is enabled,
+ this parameter will cause <productname>Pgpool-II</> to truncate (overwrite),
+ rather than append to, any existing log file of the same name.
+ However, truncation will occur only when a new file is being opened due to
+ time-based rotation, not during the startup or size-based rotation.
+ When off, pre-existing files will be appended to in all cases.
+ For example, using this setting in combination with a <xref linkend="guc-log-filename">
+ like pgpool-%H.log would result in generating twenty-four hourly log
+ files and then cyclically overwriting them.
+ </para>
+ <para>
+ This parameter can only be set at the Pgpool-II start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-syslog-facility" xreflabel="syslog_facility">
+ <term><varname>syslog_facility</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>syslog_facility</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ See also the documentation of your system's syslog daemon.
+ When logging to <application>syslog</application> is enabled,
+ this parameter determines the <application>syslog</application>
+ <literal>"facility"</literal> to be used.
+ You can choose from <literal>LOCAL0</>, <literal>LOCAL1</>,
+ <literal>LOCAL2</>, <literal>LOCAL3</>, <literal>LOCAL4</>,
+ <literal>LOCAL5</>, <literal>LOCAL6</>, <literal>LOCAL7</>;
+ the default is <literal>LOCAL0</>.
+ See also the documentation of your system's <application>syslog</> daemon.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-syslog-ident" xreflabel="syslog_ident">
+ <term><varname>syslog_ident</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>syslog_ident</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When logging to <application>syslog</> is enabled, this parameter determines
+ the program name used to identify <productname>Pgpool-II</productname>
+ messages in <application>syslog</> logs. The default is <literal>pgpool</literal>.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-config-logging-when-to-log">
+ <title>When To Log</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-client-min-messages" xreflabel="client_min_messages">
+ <term><varname>client_min_messages</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>client_min_messages</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Controls which minimum message levels are sent to the client.
+ Valid values are <literal>DEBUG5</>, <literal>DEBUG4</>,
+ <literal>DEBUG3</>, <literal>DEBUG2</>, <literal>DEBUG1</>,
+ <literal>LOG</>, <literal>NOTICE</>, <literal>WARNING</> and
+ <literal>ERROR</>. Each level includes
+ all the levels that follow it. The default is <literal>NOTICE</>.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-min-messages" xreflabel="log_min_messages">
+ <term><varname>log_min_messages</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>log_min_messages</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The default is WARNING.
+ Controls which minimum message levels are emitted to log.
+ Valid values are <literal>DEBUG5</>, <literal>DEBUG4</>,
+ <literal>DEBUG3</>, <literal>DEBUG2</>, <literal>DEBUG1</>,
+ <literal>INFO</>, <literal>NOTICE</>, <literal>WARNING</>,
+ <literal>ERROR</>, <literal>LOG</>, <literal>FATAL</>,
+ and <literal>PANIC</>.
+ Each level includes all the levels that follow it.
+ The default is <literal>WARNING</>.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-config-logging-what-to-log">
+ <title>What To Log</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-log-statement" xreflabel="log_statement">
+ <term><varname>log_statement</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_statement</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on, prints all SQL statements to the log.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-per-node-statement" xreflabel="log_per_node_statement">
+ <term><varname>log_per_node_statement</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_per_node_statement</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Similar to <xref linkend="guc-log-statement">, except that it print the
+ logs for each DB node separately. It can be useful to make sure that
+ replication or load-balancing is working.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-client-messages" xreflabel="log_client_messages">
+ <term><varname>log_client_messages</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_client_messages</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on, prints client messages to the log.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-hostname" xreflabel="log_hostname">
+ <term><varname>log_hostname</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_hostname</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on, prints the hostname instead of IP address
+ in the <command>ps</> command result, and connection logs
+ (when <xref linkend="guc-log-connections"> is on).
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-connections" xreflabel="log_connections">
+ <term><varname>log_connections</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_connections</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on, prints all client connections from to the log.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-disconnections" xreflabel="log_disconnections">
+ <term><varname>log_disconnections</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>log_disconnections</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on, prints all client connection terminations to the log.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-error-verbosity" xreflabel="log_error_verbosity">
+ <term><varname>log_error_verbosity</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>log_error_verbosity</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Controls the amount of detail emitted for each message that is logged.
+ Valid values are <literal>TERSE</>, <literal>DEFAULT</>, and <literal>VERBOSE</>,
+ each adding more fields
+ to displayed messages. <literal>TERSE</> excludes the logging of <literal>DETAIL</>,
+ <literal>HINT</>,
+ and <literal>CONTEXT</> error information.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-line-prefix" xreflabel="log_line_prefix">
+ <term><varname>log_line_prefix</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>log_line_prefix</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ This is a <function>printf</>-style string that is output at the beginning of
+ each log line.
+ <literal>%</literal> characters begin <quote>escape sequences</> that are replaced
+ with information outlined below.
+ All unrecognized escapes are ignored. Other characters are copied straight to
+ the log line. Default is '%t: pid %p: ', which prints timestamp and process id,
+ which keeps backward compatibility with pre<productname>Pgpool-II</productname>
+ <emphasis>V3.4</emphasis>.
+ </para>
+
+ <table id="log-line-prefix-table">
+ <title>log_line_prefix escape options</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Escape</entry>
+ <entry>Effect</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>%a</entry>
+ <entry>
+ Application name. The initial value for child (session
+ process) is "child". If Clients set application name
+ (either in the startup message or by using SET command),
+ application name will be changed accordingly. In other types
+ of process, application name is a hard coded string. see
+ <xref linkend="application-name-table">.
+ </entry>
+ </row>
+
+ <row>
+ <entry>%p</entry>
+ <entry>Process ID (PID)</entry>
+ </row>
+
+ <row>
+ <entry>%P</entry>
+ <entry>Process name</entry>
+ </row>
+
+ <row>
+ <entry>%t</entry>
+ <entry>Time stamp</entry>
+ </row>
+
+ <row>
+ <entry>%d</entry>
+ <entry>Database name</entry>
+ </row>
+
+ <row>
+ <entry>%u</entry>
+ <entry>User name</entry>
+ </row>
+
+ <row>
+ <entry>%l</entry>
+ <entry>Log line number for each process</entry>
+ </row>
+
+ <row>
+ <entry>%%</entry>
+ <entry>'%' character</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="application-name-table">
+ <title>application names in various process</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Process type</entry>
+ <entry>application name</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>main</entry>
+ <entry>main</entry>
+ </row>
+
+ <row>
+ <entry>child</entry>
+ <entry>child</entry>
+ </row>
+
+ <row>
+ <entry>streaming replication delay check worker</entry>
+ <entry>sr_check_worker</entry>
+ </row>
+
+ <row>
+ <entry>watchdog heart beat sender</entry>
+ <entry>heart_beat_sender</entry>
+ </row>
+
+ <row>
+ <entry>watchdog heart beat receiver</entry>
+ <entry>heart_beat_receiver</entry>
+ </row>
+
+ <row>
+ <entry>watchdog</entry>
+ <entry>watchdog</entry>
+ </row>
+
+ <row>
+ <entry>watchdog life check</entry>
+ <entry>life_check</entry>
+ </row>
+
+ <row>
+ <entry>follow primary child</entry>
+ <entry>follow_child</entry>
+ </row>
+
+ <row>
+ <entry>watchdog utility</entry>
+ <entry>watchdog_utility</entry>
+ </row>
+
+ <row>
+ <entry>pcp main</entry>
+ <entry>pcp_main</entry>
+ </row>
+
+ <row>
+ <entry>pcp child</entry>
+ <entry>pcp_child</entry>
+ </row>
+
+ <row>
+ <entry>health check process</entry>
+ <entry>health_check%d (%d is replaced with backend node id)</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-config-connection">
+ <title>Connections and Authentication</title>
+
+ <sect2 id="runtime-config-connection-settings">
+ <title>Connection Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-listen-addresses" xreflabel="listen_addresses">
+ <term><varname>listen_addresses</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>listen_addresses</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the hostname or IP address, on
+ which <productname>Pgpool-II</productname> will accept
+ TCP/IP connections. <literal>'*'</literal> accepts all
+ incoming connections. <literal>''</literal> disables
+ TCP/IP connections. Default
+ is <literal>'localhost'</literal>. Connections via UNIX
+ domain socket are always accepted.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-port" xreflabel="port">
+ <term><varname>port</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>port</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The port number used
+ by <productname>Pgpool-II</productname> to listen for
+ connections. Default is 9999.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-socket-dir" xreflabel="socket_dir">
+ <term><varname>socket_dir</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>socket_dir</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The directory where the UNIX domain socket accepting connections for
+ <productname>Pgpool-II</productname> will be
+ created. Default is <literal>/tmp</literal>. Be aware that
+ this socket might be deleted by a cron job. We recommend
+ to set this value to <literal>/var/run</literal> or such
+ directory.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-pcp-listen-addresses" xreflabel="pcp_listen_addresses">
+ <term><varname>pcp_listen_addresses</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>pcp_listen_addresses</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the hostname or IP address, on which pcp process
+ will accept TCP/IP connections. <literal>*</literal>
+ accepts all incoming connections. <literal>"" </literal>
+ disables TCP/IP connections. Default
+ is <literal>*</literal>. Connections via UNIX domain
+ socket are always accepted.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-pcp-port" xreflabel="pcp_port">
+ <term><varname>pcp_port</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>pcp_port</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The port number used by PCP
+ process to listen for connections. Default is 9898.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-pcp-socket-dir" xreflabel="pcp_socket_dir">
+ <term><varname>pcp_socket_dir</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>pcp_socket_dir</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The directory where the UNIX domain socket accepting
+ connections for PCP process will be created. Default
+ is <literal>/tmp</literal>. Be aware that this socket
+ might be deleted by a cron job. We recommend to set this
+ value to <literal>/var/run</literal> or such directory.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-num-init-children" xreflabel="num_init_children">
+ <term><varname>num_init_children</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>num_init_children</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The number of
+ preforked <productname>Pgpool-II</productname> server
+ processes. Default is 32. num_init_children is also the
+ concurrent connections limit
+ to <productname>Pgpool-II</productname> from clients. If
+ more than num_init_children clients try to connect to
+ <productname>Pgpool-II</productname>, <emphasis>they are
+ blocked (not rejected with an error,
+ like <productname>PostgreSQL</productname>) until a
+ connection to any <productname>Pgpool-II</productname>
+ process is closed</emphasis>
+ unless <xref linkend="guc-reserved-connections"> is set
+ to 1 or more. Up to
+ <xref linkend="guc-listen-backlog-multiplier">*
+ num_init_children can be queued.
+ </para>
+ <para>
+ The queue is inside the kernel called "listen queue". The
+ length of the listen queue is called "backlog". There is
+ an upper limit of the backlog in some systems, and if
+ num_init_children*<xref linkend="guc-listen-backlog-multiplier">
+ exceeds the number, you need to set the backlog higher.
+ Otherwise, following problems may occur in heavy loaded systems:
+ <itemizedlist>
+ <listitem>
+ <para>
+ connecting to <productname>Pgpool-II</productname> fails
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ connecting to <productname>Pgpool-II</productname> is
+ getting slow because of retries in the kernel.
+ </para>
+ </listitem>
+ </itemizedlist>
+ You can check if the listen queue is actually overflowed by using
+ "netstat -s" command. If you find something like:
+ <programlisting>
+ 535 times the listen queue of a socket overflowed
+ </programlisting>
+ then the listen queue is definitely overflowed. You
+ should increase the backlog in this case (you will be
+ required a super user privilege).
+ <programlisting>
+ # sysctl net.core.somaxconn
+ net.core.somaxconn = 128
+ # sysctl -w net.core.somaxconn = 256
+ </programlisting>
+ You could add following to /etc/sysctl.conf instead.
+ <programlisting>
+ net.core.somaxconn = 256
+ </programlisting>
+ </para>
+ <para>
+ Number of connections to
+ each <productname>PostgreSQL</productname> is roughly
+ max_pool*num_init_children.
+ </para>
+
+ <para>
+ However, canceling a query creates another
+ connection to the backend; thus, a query cannot be canceled if
+ all the connections are in use. If you want to ensure that queries can
+ be canceled, set this value to twice the expected connections.
+ </para>
+ <para>
+ In addition, <productname>PostgreSQL</productname> allows concurrent
+ connections for non superusers up to max_connections -
+ superuser_reserved_connections.
+ </para>
+ <para>
+ In summary, max_pool, num_init_children, max_connections,
+ superuser_reserved_connections must satisfy the following formula:
+ <programlisting>
+ max_pool*num_init_children <= (max_connections - superuser_reserved_connections) (no query canceling needed)
+ max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connections) (query canceling needed)
+ </programlisting>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-reserved-connections" xreflabel="reserved_connections">
+ <term><varname>reserved_connections</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>reserved_connections</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When this parameter is set to 1 or greater, incoming
+ connections from clients are not accepted with error
+ message "Sorry, too many clients already", rather than
+ blocked if the number of current connections from clients
+ is more than (<xref linkend="guc-num-init-children"> -
+ <varname>reserved_connections</varname>). For example,
+ if <varname>reserved_connections</varname> = 1
+ and <xref linkend="guc-num-init-children"> = 32, then the
+ 32th connection from a client will be refused. This
+ behavior is similar
+ to <productname>PostgreSQL</productname> and good for
+ systems on which the number of connections from clients is
+ large and each session may take long time. In this case
+ length of the listen queue could be very long and may
+ cause the system unstable. In this situation setting this
+ parameter to non 0 is a good idea to prevent the listen
+ queue becomes very long.
+ </para>
+ <para>
+ If this parameter is set to 0, no connection from clients
+ will be refused. The default value is 0.
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-config-authentication-settings">
+ <title>Authentication Settings</title>
+ <variablelist>
+
+ <varlistentry id="guc-enable-pool-hba" xreflabel="enable_pool_hba">
+ <term><varname>enable_pool_hba</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>enable_pool_hba</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ If <literal>true</literal>, <productname>Pgpool-II</productname> will use the
+ <filename>pool_hba.conf</filename> for the client
+ authentication. See <xref linkend="auth-pool-hba-conf">
+ for details on how to configure
+ <filename>pool_hba.conf</filename> for client authentication.
+ Default is <literal>false</literal>.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-pool-passwd" xreflabel="pool_passwd">
+ <term><varname>pool_passwd</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>pool_passwd</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specify the path (absolute or relative) to password file for
+ authentication. Default value is <literal>"pool_passwd"</literal>.
+ A relative path will be interpreted with respect to the directory
+ where configuration file is placed.
+ Specifying <literal>''</literal> (empty) disables the use
+ of password file.
+ </para>
+ <para>
+ Passwords can be stored in the pool_passwd file using three formats.
+ AES256 encrypted format, plain text format and md5 format.
+ <productname>Pgpool-II</productname> identifies the password format type
+ by it's prefix, so each password entry in the pool_passwd must be prefixed
+ as per the password format.
+ </para>
+ <para>
+ To store the password in the plain text format use <literal>TEXT</literal> prefix.
+ For example. to store clear text password string <literal>"mypassword"</literal>
+ in the pool_passwd, prepend the password string with <literal>TEXT</literal> prefix.
+ e.g. <literal>TEXTmypassword</literal>
+ </para>
+ <para>
+ similarly md5 hashed passwords must be prefixed with <literal>md5</literal> and
+ AES256 encrypted password types can be stored using <literal>AES</literal> prefix.
+ see <xref linkend="auth-aes-encrypted-password"> for more details on using
+ AES256 encrypted passwords.
+ </para>
+
+ <para>
+ In the absence of a valid prefix, <productname>Pgpool-II</productname> will
+ be considered the string as a plain text password.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-allow-clear-text-frontend-auth" xreflabel="allow_clear_text_frontend_auth">
+ <term><varname>allow_clear_text_frontend_auth</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>allow_clear_text_frontend_auth</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ If <productname>PostgreSQL</productname> backend servers require
+ <literal>md5</literal> or <literal> SCRAM</literal> authentication for some
+ user's authentication but the password for that user is not present in the
+ <filename>"pool_passwd"</filename> file, then enabling
+ <literal>allow_clear_text_frontend_auth</literal> will allow the
+ <productname>Pgpool-II</productname> to use clear-text-password
+ authentication with frontend clients to get the password in plain text form
+ from the client and use it for backend authentication.
+ </para>
+ <para>
+ Default is <literal>false</literal>.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+ <note>
+ <para>
+ <literal>allow_clear_text_frontend_auth</literal> only works when <xref linkend="guc-enable-pool-hba"> is not enabled
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-authentication-timeout" xreflabel="authentication_timeout">
+ <term><varname>authentication_timeout</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>authentication_timeout</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specify the timeout in seconds
+ for <productname>Pgpool-II</productname>
+ authentication. Specifying 0 disables the time out.
+ Default value is 60.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </sect2>
+</sect1>
+
+<sect1 id="runtime-config-running-mode">
+ <title>Clustering mode</title>
+ <para>
+ <variablelist>
+ <varlistentry id="guc-backend-clustering-mode" xreflabel="backend_clustering_mode">
+ <term><varname>backend_clustering_mode</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>backend_clustering_mode</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Clustering mode is the method to sync
+ <productname>PostgreSQL</productname> servers. To set the clustering
+ mode, <varname>backend_clustering_mode</varname> can be used. In
+ this section we discuss how to set the clustering mode. See <xref
+ linkend="planning-postgresql"> for more details.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <sect2 id="runtime-config-streaming-replication-mode">
+ <title>Streaming replication mode</title>
+
+ <para>
+ This mode is most popular and recommended clustering mode. In this
+ mode <productname>PostgreSQL</productname> is responsible to
+ replicate each servers. To enable this mode, use
+ 'streaming_replication' for
+ <varname>backend_clustering_mode</varname>.
+ <programlisting>
+backend_clustering_mode = 'streaming_replication'
+ </programlisting>
+ In this mode you can have up to 127 streaming replication standby servers.
+ Also it is possible not to have standby server at all.
+ </para>
+ <para>
+ See <xref linkend="runtime-streaming-replication-check"> for
+ additional parameters for streaming replication mode.
+ </para>
+ </sect2>
+
+ <sect2 id="runtime-config-logical-replication-mode">
+ <title>Logical replication mode</title>
+
+ <para>
+ This mode is recently added. In this mode
+ <productname>PostgreSQL</productname> is responsible to replicate
+ each servers. To enable this mode, use 'logical_replication' for
+ <varname>backend_clustering_mode</varname>.
+ <programlisting>
+backend_clustering_mode = 'logical_replication'
+ </programlisting>
+ In this mode you can have up to 127 logical replication standby servers.
+ Also it is possible not to have standby server at all.
+ </para>
+ </sect2>
+
+ <sect2 id="runtime-config-slony-mode">
+ <title>Slony mode</title>
+
+ <para>
+ This mode is used to couple <productname>Pgpool-II</productname>
+ with <acronym>Slony-I</acronym>. Slony-I is responsible for doing
+ the actual data replication. To enable this mode, use 'slony' for
+ <varname>backend_clustering_mode</varname>.
+ <programlisting>
+backend_clustering_mode = 'slony'
+ </programlisting>
+ In this mode you can have up to 127 replica servers. Also it is
+ possible not to have replica server at all.
+ </para>
+ </sect2>
+
+ <sect2 id="guc-replication-mode" xreflabel="native_replication_mode">
+ <title>Native replication mode</title>
+
+ <para>
+ This mode makes the <productname>Pgpool-II</productname> to
+ replicate data between <productname>PostgreSQL</productname>
+ backends. To enable this mode, use 'native_replication' for
+ <varname>backend_clustering_mode</varname>.
+ <programlisting>
+backend_clustering_mode = 'native_replication'
+ </programlisting>
+ In this mode you can have up to 127 standby replication servers.
+ Also it is possible not to have standby server at all.
+ </para>
+
+ <para>
+ Following options affect the behavior of
+ <productname>Pgpool-II</productname> in the replication mode.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-replication-stop-on-mismatch" xreflabel="replication_stop_on_mismatch">
+ <term><varname>replication_stop_on_mismatch</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>replication_stop_on_mismatch</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, and all nodes do not reply with the same
+ packet kind to the query that was sent to
+ all <productname>PostgreSQL</productname> backend nodes,
+ then the backend node whose reply differs from the
+ majority is degenerated by
+ the <productname>Pgpool-II</productname>.
+ If <varname>replication_stop_on_mismatch</varname> is set
+ to off and a similar situation happens then
+ the <productname>Pgpool-II</productname> only terminates
+ the current user session but does not degenerate a backend
+ node.
+ </para>
+
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> does not examine
+ the data returned by the backends and takes the decision
+ only by comparing the result packet types.
+ </para>
+ </note>
+
+ <para>
+ A typical use case of enabling
+ the <varname>replication_stop_on_mismatch</varname> is to
+ guard against the data inconsistency among the backend
+ nodes. For example, you may want to degenerate a backend
+ node if an UPDATE statement fails on one backend node
+ while passes on others.
+ </para>
+ <para>
+ Default is off.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-failover-if-affected-tuples-mismatch" xreflabel="failover_if_affected_tuples_mismatch">
+ <term><varname>failover_if_affected_tuples_mismatch</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>failover_if_affected_tuples_mismatch</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, and all nodes do not reply with the same
+ number of affected tuples to the INSERT/UPDATE/DELETE
+ query, then the backend node whose reply differs from the
+ majority is degenerated by
+ the <productname>Pgpool-II</productname>.
+ If <varname>failover_if_affected_tuples_mismatch</varname>
+ is set to off and a similar situation happens then
+ the <productname>Pgpool-II</productname> only terminates
+ the current user session but does not degenerate a backend
+ node.
+ </para>
+
+ <note>
+ <para>
+ In case of a tie, when two or more groups have the same
+ number of nodes, then the group containing the primary
+ node (backend node having the youngest node id) gets the
+ precedence.
+ </para>
+ </note>
+
+ <para>
+ Default is off.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-replicate-select" xreflabel="replicate_select">
+ <term><varname>replicate_select</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>replicate_select</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> enables the
+ SELECT query replication mode. i.e. The SELECT queries are sent
+ to all backend nodes.
+ </para>
+
+ <table id="replicate-select-affect-table">
+ <title>replicate_select with <xref linkend="guc-load-balance-mode"> affects on SELECT routing</title>
+ <tgroup cols="6" align="center">
+ <colspec colname="_1" colwidth="1*">
+ <colspec colname="_2" colwidth="1*">
+ <colspec colname="_3" colwidth="1*">
+ <colspec colname="_4" colwidth="1*">
+ <colspec colname="_5" colwidth="1*">
+ <colspec colname="_6" colwidth="1*">
+
+ <tbody>
+ <row>
+ <entry>replicate_select is true</entry>
+ <entry align="center">Y</entry>
+ <entry align="center" nameend="_6" namest="_3">N</entry>
+ </row>
+
+ <row>
+ <entry>load_balance_mode is true</entry>
+ <entry>ANY</entry>
+ <entry align="center" nameend="_5" namest="_3">Y</entry>
+ <entry align="center">N</entry>
+ </row>
+
+ <row>
+ <entry>SELECT is inside a transaction block</entry>
+ <entry align="center">ANY</entry>
+ <entry nameend="_4" namest="_3" align="center"> Y </entry>
+ <entry align="center">N</entry>
+ <entry align="center">ANY</entry>
+ </row>
+
+ <row>
+ <entry>
+ Transaction isolation level is SERIALIZABLE and
+ the transaction has issued a write query
+ </entry>
+ <entry align="center">ANY</entry>
+ <entry align="center">Y</entry>
+ <entry align="center">N</entry>
+ <entry align="center">ANY</entry>
+ <entry align="center">ANY</entry>
+ </row>
+
+ <row>
+ <entry>
+ results(R:replication, M: send only to main, L: load balance)
+ </entry>
+ <entry align="center">R</entry>
+ <entry align="center">M</entry>
+ <entry align="center">L</entry>
+ <entry align="center">L</entry>
+ <entry align="center">M</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ Default is off.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-insert-lock" xreflabel="insert_lock">
+ <term><varname>insert_lock</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>insert_lock</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> will
+ automatically lock the table
+ on <productname>PostgreSQL</productname> before an INSERT
+ statement is issued for that.
+ </para>
+
+ <para>
+ When replicating a table with SERIAL data type, the SERIAL
+ column value may get different values on the different
+ backends. The workaround to this problem is to explicitly
+ lock the table before issuing the INSERT.
+ </para>
+ <para>
+ So for automatically locking the
+ table <productname>Pgpool-II</productname> do the
+ following transformation:
+ <programlisting>
+ INSERT INTO ...
+ </programlisting>
+ to
+ <programlisting>
+ BEGIN;
+ LOCK TABLE ...
+ INSERT INTO ...
+ COMMIT;
+ </programlisting>
+ </para>
+ <caution>
+ <para>
+ This approach severely degrades the transactions'
+ parallelism
+ </para>
+ </caution>
+
+ <para>
+ <productname>Pgpool-II</productname> <emphasis>V2.2</emphasis>
+ or later, automatically detects whether the table has a
+ SERIAL columns or not, so it never locks the table if it
+ doesn't have the SERIAL columns.
+ </para>
+
+ <para>
+ <productname>Pgpool-II</productname> <emphasis>V3.0</emphasis> until
+ <productname>Pgpool-II</productname> <emphasis>V3.0.4</emphasis>
+ uses a row lock against the sequence relation, rather than
+ table lock. This is intended to minimize lock conflict
+ with <acronym>VACUUM</acronym> (including autovacuum).
+ However this can lead to another problem. After
+ transaction wraparound happens, row locking against the
+ sequence relation causes PostgreSQL internal error (more
+ precisely, access error on pg_clog, which keeps
+ transaction status). To prevent
+ this, <productname>PostgreSQL</productname> core
+ developers decided to disallow row locking against
+ sequences and this broke
+ the <productname>Pgpool-II</productname>, of course (the
+ "fixed" version of PostgreSQL was released as 9.0.5,
+ 8.4.9, 8.3.16 and 8.2.22).
+ </para>
+
+ <para>
+ <productname>Pgpool-II</productname> <emphasis>V3.0.5</emphasis>
+ or later uses a row lock
+ against <literal>pgpool_catalog.insert_lock</literal>
+ table because new PostgreSQL disallows a row lock against
+ the sequence relation. So creating insert_lock table in
+ all databases which are accessed via
+ <productname>Pgpool-II</productname> beforehand is
+ required. See <xref linkend="create-installlock-table">
+ for more details. If does not exist insert_lock
+ table, <productname>Pgpool-II</productname> locks the
+ insert target table. This behavior is same
+ as <productname>Pgpool-II</productname> <emphasis>V2.2</emphasis>
+ and <emphasis>V2.3</emphasis> series.
+ </para>
+ <para>
+ If you want to use <varname>insert_lock</varname> which is
+ compatible with older releases, you can specify lock
+ method by configure script.
+ See <xref linkend="install-pgpool"> for more details.
+ </para>
+
+ <para>
+ For fine (per statement) control:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ set insert_lock to true, and add /*NO INSERT LOCK*/ at
+ the beginning of an INSERT statement for which you do
+ not want to acquire the table lock.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ set insert_lock to false, and add /*INSERT LOCK*/ at
+ the beginning of an INSERT statement for which you
+ want to acquire the table lock.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ <note>
+ <para>
+ If insert_lock is enabled, the regression tests for
+ PostgreSQL 8.0 gets fail in transactions, privileges,
+ rules, and alter_table.
+ </para>
+ <para>
+ The reason for this is
+ that <productname>Pgpool-II</productname> tries to LOCK
+ the VIEW for the rule test, and it produces the below
+ error message:
+ <programlisting>
+ ! ERROR: current transaction is aborted, commands ignored until
+ end of transaction block
+ </programlisting>
+ For example, the transactions test tries an INSERT into
+ a table which does not exist,
+ and <productname>Pgpool-II</productname>
+ causes <productname>PostgreSQL</productname> to acquire
+ the lock for the table. Of cause this results in an
+ error. The transaction will be aborted, and the
+ following INSERT statement produces the above error
+ message.
+ </para>
+ </note>
+ <para>
+ Default is off.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-lobj-lock-table" xreflabel="lobj_lock_table">
+ <term><varname>lobj_lock_table</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>lobj_lock_table</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a table name used for large object replication control.
+ If it is specified, <productname>Pgpool-II</productname> will lock
+ the table specified by <varname>lobj_lock_table</varname> and generate
+ a large object id by looking into <literal>pg_largeobject</literal>
+ system catalog and then call <literal>lo_create</literal> to create
+ the large object.
+ This procedure guarantees that <productname>Pgpool-II</productname>
+ will get the same large object id in all DB nodes in replication mode.
+ </para>
+ <note>
+ <para>
+ <productname>PostgreSQL</productname> 8.0 and older does
+ not have <literal>lo_create</literal>, so this feature
+ does not work with PostgreSQL 8.0 and older versions.
+ </para>
+ </note>
+ <para>
+ A call to the <literal>libpq</literal>
+ function <literal>lo_creat()</literal> triggers this
+ feature. Also large object creation
+ through <acronym>Java</acronym> API
+ (<acronym>JDBC</acronym> driver), <acronym>PHP</acronym>
+ API (<literal>pg_lo_create</literal>, or similar API in
+ PHP library such as PDO), and this same API in various
+ programming languages are known to use a similar protocol,
+ and thus should work.
+ </para>
+
+ <para>
+ This feature does not works with following operations on large objects.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ All APIs using <literal>lo_create</literal>, <literal>lo_import_with_oid</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>lo_import</literal> function in backend called in SELECT.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>lo_create</literal> function in backend called in SELECT.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>
+ All <productname>PostgreSQL</productname> users must
+ have a write access
+ on <varname>lobj_lock_table</varname> and it can be
+ created in any schema.
+ </para>
+ </note>
+
+ <para>
+ Example to create a large object lock table:
+ <programlisting>
+ CREATE TABLE public.my_lock_table ();
+ GRANT ALL ON public.my_lock_table TO PUBLIC;
+ </programlisting>
+ </para>
+ <para>
+ Default is <literal>''</literal>(empty), which disables the feature.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="guc-snapshot-isolation-mode" xreflabel="snapshot_isolation_mode">
+ <title>Snapshot isolation mode</title>
+
+ <para>
+ This mode is similar to the native replication mode except it adds
+ the visibility consistency among nodes. The implementation is based
+ on a research paper <xref linkend="mishima2009">.
+ To enable this mode, use 'snapshot_isolation' for
+ <varname>backend_clustering_mode</varname>.
+ <programlisting>
+backend_clustering_mode = 'snapshot_isolation'
+ </programlisting>
+ For example, you can avoid following inconsistency among nodes caused by the
+ visibility inconsistency. Here S1 and S2 denotes sessions, while N1
+ and N2 denotes the PostgreSQL server 1 and 2 respectively.
+ <programlisting>
+S1/N1: BEGIN;
+S1/N2: BEGIN;
+S1/N1: UPDATE t1 SET i = i + 1; -- i = 1
+S1/N2: UPDATE t1 SET i = i + 1; -- i = 1
+S1/N1: COMMIT;
+S2/N1: BEGIN;
+S2/N2: BEGIN;
+S2/N2: DELETE FROM t1 WHERE i = 1; -- delete 1 row since S1/N2 is not committed yet
+S2/N1: DELETE FROM t1 WHERE i = 1; -- delete no row since S1/N1 is committed and i is not 1 anymore
+S1/N2: COMMIT;
+S2/N1: COMMIT;
+S2/N2: COMMIT;
+ </programlisting>
+ In the snapshot isolation mode, the result will be either one of
+ them below and it never damages the data consistency among database
+ nodes.
+ <programlisting>
+S1/N1: BEGIN;
+S1/N2: BEGIN;
+S1/N1: UPDATE t1 SET i = i + 1; -- i = 1
+S1/N2: UPDATE t1 SET i = i + 1; -- i = 1
+S2/N1: BEGIN;
+S2/N2: BEGIN;
+S1/N1: COMMIT;
+S1/N2: COMMIT;
+S2/N1: DELETE FROM t1 WHERE i = 1; -- delete no row since S1/N1 is committed and i is not 1 anymore
+S2/N2: DELETE FROM t1 WHERE i = 1; -- delete no row since S1/N2 is committed and i is not 1 anymore
+S2/N1: COMMIT;
+S2/N2: COMMIT;
+ </programlisting>
+
+ <programlisting>
+S1/N1: BEGIN;
+S1/N2: BEGIN;
+S1/N1: UPDATE t1 SET i = i + 1; -- i = 1
+S1/N2: UPDATE t1 SET i = i + 1; -- i = 1
+S2/N1: BEGIN;
+S2/N2: BEGIN;
+S2/N1: DELETE FROM t1 WHERE i = 1; -- delete 1 row since S1/N1 is not committed yet
+S2/N2: DELETE FROM t1 WHERE i = 1; -- delete 1 row since S1/N2 is not committed yet
+S1/N1: COMMIT;
+S1/N2: COMMIT;
+S2/N1: COMMIT;
+S2/N2: COMMIT;
+ </programlisting>
+
+ Please note that there are some limitations in this mode and
+ currently (in <productname>Pgpool-II</productname> 4.2) this mode
+ is regarded as "experimental implementation. Be warned that careful
+ testings are required before you implement this in a production
+ system.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ It is necessary to set the transaction isolation level to
+ REPEATABLE READ. That means you need to set it in
+ <filename>postgresql.conf</filename> like this:
+ <programlisting>
+default_transaction_isolation = 'repeatable read'
+ </programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Consistent visibility in SERIAL data type and sequences are not
+ guaranteed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="guc-raw-mode" xreflabel="raw_mode">
+ <title>Raw mode</title>
+ <para>
+ In this mode, <productname>Pgpool-II</> does not care about the database synchronization.
+ It's user's responsibility to make the whole system does a meaningful thing.
+ Load balancing is <emphasis>not</emphasis> possible in the mode.
+ To enable this mode, use 'raw' for <varname>backend_clustering_mode</varname>.
+ <programlisting>
+backend_clustering_mode = 'raw'
+ </programlisting>
+ </para>
+ </sect2>
+
+</sect1>
+
+<sect1 id="runtime-config-backend-settings">
+ <title>Backend Settings</title>
+
+ <sect2 id="runtime-config-backend-connection-settings">
+ <title>Backend Connection Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-backend-hostname" xreflabel="backend_hostname">
+ <term><varname>backend_hostname</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_hostname</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_hostname</varname> specifies the
+ <productname>PostgreSQL</productname> backend to be
+ connected to. It is used
+ by <productname>Pgpool-II</productname> to communicate
+ with the server.
+ </para>
+
+ <para>
+ For TCP/IP communication, this parameter can take a
+ hostname or an IP address. If this begins with a
+ slash(<literal>/</literal>), it specifies Unix-domain
+ communication rather than TCP/IP; the value is the name of
+ the directory in which the socket file is stored. The
+ default behavior when backend_hostname is empty
+ (<literal>''</literal>) is to connect to a Unix-domain
+ socket in <filename>/tmp</filename>.
+ </para>
+
+ <para>
+ Multiple backends can be specified by adding a number at the
+ end of the parameter name (e.g.backend_hostname0). This
+ number is referred to as "DB node ID", and it starts from
+ 0. The backend which was given the DB node ID of 0 will be
+ called "main node". When multiple backends are defined, the
+ service can be continued even if the main node is down (not
+ true in some modes). In this case, the youngest DB node ID
+ alive will be the new main node.
+ </para>
+
+ <para>
+ Please note that the DB node which has id 0 has no special
+ meaning if operated in streaming replication mode. Rather,
+ you should care about if the DB node is the "primary node" or
+ not. See <xref linkend="runtime-config-load-balancing">,
+ <xref linkend="runtime-config-failover">,
+ <xref linkend="runtime-streaming-replication-check">
+ for more details.
+ </para>
+
+ <para>
+ If you plan to use only
+ one <productname>PostgreSQL</productname> server, specify
+ it by backend_hostname0.
+ </para>
+
+ <para>
+ New nodes can be added by adding parameter rows and
+ reloading a configuration file. However, the existing
+ values cannot be updated, so you must
+ restart <productname>Pgpool-II</productname> in that case.
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry id="guc-backend-port" xreflabel="backend_port">
+ <term><varname>backend_port</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>backend_port</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_port</varname> specifies the port number
+ of the backends. Multiple backends can be specified by
+ adding a number at the end of the parameter name
+ (e.g. backend_port0). If you plan to use only one
+ <productname>PostgreSQL</productname> server, specify it by backend_port0.
+ </para>
+ <para>
+ New backend ports can be added by adding parameter rows
+ and reloading a configuration file. However, the existing
+ values cannot be updated, so you must
+ restart <productname>Pgpool-II</productname> in that case.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-backend-weight" xreflabel="backend_weight">
+ <term><varname>backend_weight</varname> (<type>floating point</type>)
+ <indexterm>
+ <primary><varname>backend_weight</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_weight</varname> specifies the load balance
+ ratio of the backends. It may be set to any integer or
+ floating point value greater than or equal to zero.
+ Multiple backends can be specified by
+ adding a number at the end of the parameter name
+ (e.g. backend_weight0). If you plan to use only one
+ PostgreSQL server, specify it by backend_weight0.
+ </para>
+ <para>
+ New <varname>backend_weight</varname> can be added in this parameter by
+ reloading a configuration file. However, this will take
+ effect only for new established client sessions.
+ <productname>Pgpool-II</productname> <emphasis>V2.2.6</emphasis>, <emphasis>V2.3</emphasis>
+ or later allows updating the values by reloading a
+ configuration file. This is useful if you want to prevent
+ any query sent to standbys to perform some administrative
+ work in streaming replication mode, logical replication mode and slony mode.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-config-backend-data">
+ <title>Backend Data Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-backend-data-directory" xreflabel="backend_data_directory">
+ <term><varname>backend_data_directory</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_data_directory</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_data_directory</varname> specifies the
+ database cluster directory of the backend. Multiple backends can be
+ specified by adding a number at the end of the parameter
+ name (e.g. backend_data_directory0). If you plan to use
+ only one PostgreSQL server, specify it by
+ backend_data_directory0.
+ </para>
+ <para>
+ New <varname>backend data_directory</varname> can be added by adding parameter rows and reloading a
+ configuration file. However, the existing values cannot be updated, so
+ you must restart <productname>Pgpool-II</productname> in
+ that case.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-backend-flag" xreflabel="backend_flag">
+ <term><varname>backend_flag</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_flag</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_flag</varname> controls various backend
+ behavior. Multiple backends can be specified by adding a
+ number at the end of the parameter name
+ (e.g. backend_flag0). If you plan to use only one
+ PostgreSQL server, specify it by backend_flag0.
+ </para>
+ <para>
+ New backend flags can be added by adding parameter rows and reloading a
+ configuration file. Currently followings are allowed. Multiple flags can
+ be specified by using "|".
+ </para>
+
+ <table id="backend-flag-table">
+ <title>Backend flags</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Flag</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>ALLOW_TO_FAILOVER</literal></entry>
+ <entry>Allow to failover or detaching backend. This
+ is the default. You cannot specify with
+ DISALLOW_TO_FAILOVER at a same time.</entry>
+ </row>
+ <row>
+ <entry><literal>DISALLOW_TO_FAILOVER</literal></entry>
+ <entry>Disallow to failover or detaching backend
+ This is useful when you protect backend by
+ using HA (High Availability) softwares such as
+ <productname>Heartbeat</productname>
+ or <productname>Pacemaker</productname>. You cannot specify with
+ ALLOW_TO_FAILOVER at a same time.
+ </entry>
+ </row>
+
+ <row>
+ <entry><literal>ALWAYS_PRIMARY</literal></entry>
+ <entry>This is only useful in streaming replication
+ mode. See <xref linkend="running-mode"> about
+ streaming replication mode. If this flag is set to
+ one of
+ backends, <productname>Pgpool-II</productname> will
+ not find the primary node by inspecting
+ backend. Instead, always regard the node which the
+ flag is set as the primary node. This is useful for
+ systems including <productname>Amazon Aurora for
+ PostgreSQL Compatibility</productname> which has
+ fixed primary server name. See <xref linkend="example-Aurora">
+ for an example settings.
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-backend-application-name" xreflabel="backend_application_name">
+ <term><varname>backend_application_name</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_application_name</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_application_name</varname> specifies the
+ application name of walsender, which receives WAL log
+ from primary node. Thus in other than streaming
+ replication mode, this parameter does not need to be set.
+ Also this parameter is required to if you want to show
+ "replication_state" and "replication_sync_state" column
+ in <xref linkend="SQL-SHOW-POOL-NODES"> command.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 00 — Successful Completion</></entry>
+</row>
+
+<row>
+ <entry><literal>00000</literal></entry>
+ <entry><symbol>successful_completion</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 01 — Warning</></entry>
+</row>
+
+<row>
+ <entry><literal>01000</literal></entry>
+ <entry><symbol>warning</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>0100C</literal></entry>
+ <entry><symbol>dynamic_result_sets_returned</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>01008</literal></entry>
+ <entry><symbol>implicit_zero_bit_padding</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>01003</literal></entry>
+ <entry><symbol>null_value_eliminated_in_set_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>01007</literal></entry>
+ <entry><symbol>privilege_not_granted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>01006</literal></entry>
+ <entry><symbol>privilege_not_revoked</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>01004</literal></entry>
+ <entry><symbol>string_data_right_truncation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>01P01</literal></entry>
+ <entry><symbol>deprecated_feature</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 02 — No Data (this is also a warning class per the SQL standard)</></entry>
+</row>
+
+<row>
+ <entry><literal>02000</literal></entry>
+ <entry><symbol>no_data</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>02001</literal></entry>
+ <entry><symbol>no_additional_dynamic_result_sets_returned</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 03 — SQL Statement Not Yet Complete</></entry>
+</row>
+
+<row>
+ <entry><literal>03000</literal></entry>
+ <entry><symbol>sql_statement_not_yet_complete</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 08 — Connection Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>08000</literal></entry>
+ <entry><symbol>connection_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>08003</literal></entry>
+ <entry><symbol>connection_does_not_exist</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>08006</literal></entry>
+ <entry><symbol>connection_failure</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>08001</literal></entry>
+ <entry><symbol>sqlclient_unable_to_establish_sqlconnection</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>08004</literal></entry>
+ <entry><symbol>sqlserver_rejected_establishment_of_sqlconnection</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>08007</literal></entry>
+ <entry><symbol>transaction_resolution_unknown</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>08P01</literal></entry>
+ <entry><symbol>protocol_violation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 09 — Triggered Action Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>09000</literal></entry>
+ <entry><symbol>triggered_action_exception</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 0A — Feature Not Supported</></entry>
+</row>
+
+<row>
+ <entry><literal>0A000</literal></entry>
+ <entry><symbol>feature_not_supported</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 0B — Invalid Transaction Initiation</></entry>
+</row>
+
+<row>
+ <entry><literal>0B000</literal></entry>
+ <entry><symbol>invalid_transaction_initiation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 0F — Locator Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>0F000</literal></entry>
+ <entry><symbol>locator_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>0F001</literal></entry>
+ <entry><symbol>invalid_locator_specification</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 0L — Invalid Grantor</></entry>
+</row>
+
+<row>
+ <entry><literal>0L000</literal></entry>
+ <entry><symbol>invalid_grantor</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>0LP01</literal></entry>
+ <entry><symbol>invalid_grant_operation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 0P — Invalid Role Specification</></entry>
+</row>
+
+<row>
+ <entry><literal>0P000</literal></entry>
+ <entry><symbol>invalid_role_specification</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 0Z — Diagnostics Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>0Z000</literal></entry>
+ <entry><symbol>diagnostics_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>0Z002</literal></entry>
+ <entry><symbol>stacked_diagnostics_accessed_without_active_handler</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 20 — Case Not Found</></entry>
+</row>
+
+<row>
+ <entry><literal>20000</literal></entry>
+ <entry><symbol>case_not_found</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 21 — Cardinality Violation</></entry>
+</row>
+
+<row>
+ <entry><literal>21000</literal></entry>
+ <entry><symbol>cardinality_violation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 22 — Data Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>22000</literal></entry>
+ <entry><symbol>data_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2202E</literal></entry>
+ <entry><symbol>array_subscript_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22021</literal></entry>
+ <entry><symbol>character_not_in_repertoire</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22008</literal></entry>
+ <entry><symbol>datetime_field_overflow</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22012</literal></entry>
+ <entry><symbol>division_by_zero</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22005</literal></entry>
+ <entry><symbol>error_in_assignment</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200B</literal></entry>
+ <entry><symbol>escape_character_conflict</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22022</literal></entry>
+ <entry><symbol>indicator_overflow</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22015</literal></entry>
+ <entry><symbol>interval_field_overflow</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2201E</literal></entry>
+ <entry><symbol>invalid_argument_for_logarithm</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22014</literal></entry>
+ <entry><symbol>invalid_argument_for_ntile_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22016</literal></entry>
+ <entry><symbol>invalid_argument_for_nth_value_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2201F</literal></entry>
+ <entry><symbol>invalid_argument_for_power_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2201G</literal></entry>
+ <entry><symbol>invalid_argument_for_width_bucket_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22018</literal></entry>
+ <entry><symbol>invalid_character_value_for_cast</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22007</literal></entry>
+ <entry><symbol>invalid_datetime_format</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22019</literal></entry>
+ <entry><symbol>invalid_escape_character</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200D</literal></entry>
+ <entry><symbol>invalid_escape_octet</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22025</literal></entry>
+ <entry><symbol>invalid_escape_sequence</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22P06</literal></entry>
+ <entry><symbol>nonstandard_use_of_escape_character</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22010</literal></entry>
+ <entry><symbol>invalid_indicator_parameter_value</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22023</literal></entry>
+ <entry><symbol>invalid_parameter_value</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2201B</literal></entry>
+ <entry><symbol>invalid_regular_expression</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2201W</literal></entry>
+ <entry><symbol>invalid_row_count_in_limit_clause</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2201X</literal></entry>
+ <entry><symbol>invalid_row_count_in_result_offset_clause</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22009</literal></entry>
+ <entry><symbol>invalid_time_zone_displacement_value</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200C</literal></entry>
+ <entry><symbol>invalid_use_of_escape_character</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200G</literal></entry>
+ <entry><symbol>most_specific_type_mismatch</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22004</literal></entry>
+ <entry><symbol>null_value_not_allowed</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22002</literal></entry>
+ <entry><symbol>null_value_no_indicator_parameter</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22003</literal></entry>
+ <entry><symbol>numeric_value_out_of_range</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22026</literal></entry>
+ <entry><symbol>string_data_length_mismatch</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22001</literal></entry>
+ <entry><symbol>string_data_right_truncation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22011</literal></entry>
+ <entry><symbol>substring_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22027</literal></entry>
+ <entry><symbol>trim_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22024</literal></entry>
+ <entry><symbol>unterminated_c_string</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200F</literal></entry>
+ <entry><symbol>zero_length_character_string</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22P01</literal></entry>
+ <entry><symbol>floating_point_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22P02</literal></entry>
+ <entry><symbol>invalid_text_representation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22P03</literal></entry>
+ <entry><symbol>invalid_binary_representation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22P04</literal></entry>
+ <entry><symbol>bad_copy_file_format</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>22P05</literal></entry>
+ <entry><symbol>untranslatable_character</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200L</literal></entry>
+ <entry><symbol>not_an_xml_document</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200M</literal></entry>
+ <entry><symbol>invalid_xml_document</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200N</literal></entry>
+ <entry><symbol>invalid_xml_content</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200S</literal></entry>
+ <entry><symbol>invalid_xml_comment</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2200T</literal></entry>
+ <entry><symbol>invalid_xml_processing_instruction</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 23 — Integrity Constraint Violation</></entry>
+</row>
+
+<row>
+ <entry><literal>23000</literal></entry>
+ <entry><symbol>integrity_constraint_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>23001</literal></entry>
+ <entry><symbol>restrict_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>23502</literal></entry>
+ <entry><symbol>not_null_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>23503</literal></entry>
+ <entry><symbol>foreign_key_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>23505</literal></entry>
+ <entry><symbol>unique_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>23514</literal></entry>
+ <entry><symbol>check_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>23P01</literal></entry>
+ <entry><symbol>exclusion_violation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 24 — Invalid Cursor State</></entry>
+</row>
+
+<row>
+ <entry><literal>24000</literal></entry>
+ <entry><symbol>invalid_cursor_state</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 25 — Invalid Transaction State</></entry>
+</row>
+
+<row>
+ <entry><literal>25000</literal></entry>
+ <entry><symbol>invalid_transaction_state</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25001</literal></entry>
+ <entry><symbol>active_sql_transaction</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25002</literal></entry>
+ <entry><symbol>branch_transaction_already_active</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25008</literal></entry>
+ <entry><symbol>held_cursor_requires_same_isolation_level</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25003</literal></entry>
+ <entry><symbol>inappropriate_access_mode_for_branch_transaction</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25004</literal></entry>
+ <entry><symbol>inappropriate_isolation_level_for_branch_transaction</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25005</literal></entry>
+ <entry><symbol>no_active_sql_transaction_for_branch_transaction</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25006</literal></entry>
+ <entry><symbol>read_only_sql_transaction</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25007</literal></entry>
+ <entry><symbol>schema_and_data_statement_mixing_not_supported</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25P01</literal></entry>
+ <entry><symbol>no_active_sql_transaction</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>25P02</literal></entry>
+ <entry><symbol>in_failed_sql_transaction</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 26 — Invalid SQL Statement Name</></entry>
+</row>
+
+<row>
+ <entry><literal>26000</literal></entry>
+ <entry><symbol>invalid_sql_statement_name</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 27 — Triggered Data Change Violation</></entry>
+</row>
+
+<row>
+ <entry><literal>27000</literal></entry>
+ <entry><symbol>triggered_data_change_violation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 28 — Invalid Authorization Specification</></entry>
+</row>
+
+<row>
+ <entry><literal>28000</literal></entry>
+ <entry><symbol>invalid_authorization_specification</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>28P01</literal></entry>
+ <entry><symbol>invalid_password</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 2B — Dependent Privilege Descriptors Still Exist</></entry>
+</row>
+
+<row>
+ <entry><literal>2B000</literal></entry>
+ <entry><symbol>dependent_privilege_descriptors_still_exist</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2BP01</literal></entry>
+ <entry><symbol>dependent_objects_still_exist</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 2D — Invalid Transaction Termination</></entry>
+</row>
+
+<row>
+ <entry><literal>2D000</literal></entry>
+ <entry><symbol>invalid_transaction_termination</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 2F — SQL Routine Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>2F000</literal></entry>
+ <entry><symbol>sql_routine_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2F005</literal></entry>
+ <entry><symbol>function_executed_no_return_statement</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2F002</literal></entry>
+ <entry><symbol>modifying_sql_data_not_permitted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2F003</literal></entry>
+ <entry><symbol>prohibited_sql_statement_attempted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>2F004</literal></entry>
+ <entry><symbol>reading_sql_data_not_permitted</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 34 — Invalid Cursor Name</></entry>
+</row>
+
+<row>
+ <entry><literal>34000</literal></entry>
+ <entry><symbol>invalid_cursor_name</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 38 — External Routine Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>38000</literal></entry>
+ <entry><symbol>external_routine_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>38001</literal></entry>
+ <entry><symbol>containing_sql_not_permitted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>38002</literal></entry>
+ <entry><symbol>modifying_sql_data_not_permitted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>38003</literal></entry>
+ <entry><symbol>prohibited_sql_statement_attempted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>38004</literal></entry>
+ <entry><symbol>reading_sql_data_not_permitted</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 39 — External Routine Invocation Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>39000</literal></entry>
+ <entry><symbol>external_routine_invocation_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>39001</literal></entry>
+ <entry><symbol>invalid_sqlstate_returned</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>39004</literal></entry>
+ <entry><symbol>null_value_not_allowed</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>39P01</literal></entry>
+ <entry><symbol>trigger_protocol_violated</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>39P02</literal></entry>
+ <entry><symbol>srf_protocol_violated</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 3B — Savepoint Exception</></entry>
+</row>
+
+<row>
+ <entry><literal>3B000</literal></entry>
+ <entry><symbol>savepoint_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>3B001</literal></entry>
+ <entry><symbol>invalid_savepoint_specification</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 3D — Invalid Catalog Name</></entry>
+</row>
+
+<row>
+ <entry><literal>3D000</literal></entry>
+ <entry><symbol>invalid_catalog_name</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 3F — Invalid Schema Name</></entry>
+</row>
+
+<row>
+ <entry><literal>3F000</literal></entry>
+ <entry><symbol>invalid_schema_name</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 40 — Transaction Rollback</></entry>
+</row>
+
+<row>
+ <entry><literal>40000</literal></entry>
+ <entry><symbol>transaction_rollback</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>40002</literal></entry>
+ <entry><symbol>transaction_integrity_constraint_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>40001</literal></entry>
+ <entry><symbol>serialization_failure</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>40003</literal></entry>
+ <entry><symbol>statement_completion_unknown</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>40P01</literal></entry>
+ <entry><symbol>deadlock_detected</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 42 — Syntax Error or Access Rule Violation</></entry>
+</row>
+
+<row>
+ <entry><literal>42000</literal></entry>
+ <entry><symbol>syntax_error_or_access_rule_violation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42601</literal></entry>
+ <entry><symbol>syntax_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42501</literal></entry>
+ <entry><symbol>insufficient_privilege</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42846</literal></entry>
+ <entry><symbol>cannot_coerce</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42803</literal></entry>
+ <entry><symbol>grouping_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P20</literal></entry>
+ <entry><symbol>windowing_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P19</literal></entry>
+ <entry><symbol>invalid_recursion</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42830</literal></entry>
+ <entry><symbol>invalid_foreign_key</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42602</literal></entry>
+ <entry><symbol>invalid_name</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42622</literal></entry>
+ <entry><symbol>name_too_long</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42939</literal></entry>
+ <entry><symbol>reserved_name</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42804</literal></entry>
+ <entry><symbol>datatype_mismatch</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P18</literal></entry>
+ <entry><symbol>indeterminate_datatype</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P21</literal></entry>
+ <entry><symbol>collation_mismatch</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P22</literal></entry>
+ <entry><symbol>indeterminate_collation</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42809</literal></entry>
+ <entry><symbol>wrong_object_type</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42703</literal></entry>
+ <entry><symbol>undefined_column</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42883</literal></entry>
+ <entry><symbol>undefined_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P01</literal></entry>
+ <entry><symbol>undefined_table</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P02</literal></entry>
+ <entry><symbol>undefined_parameter</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42704</literal></entry>
+ <entry><symbol>undefined_object</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42701</literal></entry>
+ <entry><symbol>duplicate_column</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P03</literal></entry>
+ <entry><symbol>duplicate_cursor</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P04</literal></entry>
+ <entry><symbol>duplicate_database</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42723</literal></entry>
+ <entry><symbol>duplicate_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P05</literal></entry>
+ <entry><symbol>duplicate_prepared_statement</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P06</literal></entry>
+ <entry><symbol>duplicate_schema</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P07</literal></entry>
+ <entry><symbol>duplicate_table</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42712</literal></entry>
+ <entry><symbol>duplicate_alias</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42710</literal></entry>
+ <entry><symbol>duplicate_object</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42702</literal></entry>
+ <entry><symbol>ambiguous_column</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42725</literal></entry>
+ <entry><symbol>ambiguous_function</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P08</literal></entry>
+ <entry><symbol>ambiguous_parameter</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P09</literal></entry>
+ <entry><symbol>ambiguous_alias</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P10</literal></entry>
+ <entry><symbol>invalid_column_reference</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42611</literal></entry>
+ <entry><symbol>invalid_column_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P11</literal></entry>
+ <entry><symbol>invalid_cursor_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P12</literal></entry>
+ <entry><symbol>invalid_database_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P13</literal></entry>
+ <entry><symbol>invalid_function_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P14</literal></entry>
+ <entry><symbol>invalid_prepared_statement_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P15</literal></entry>
+ <entry><symbol>invalid_schema_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P16</literal></entry>
+ <entry><symbol>invalid_table_definition</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>42P17</literal></entry>
+ <entry><symbol>invalid_object_definition</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 44 — WITH CHECK OPTION Violation</></entry>
+</row>
+
+<row>
+ <entry><literal>44000</literal></entry>
+ <entry><symbol>with_check_option_violation</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 53 — Insufficient Resources</></entry>
+</row>
+
+<row>
+ <entry><literal>53000</literal></entry>
+ <entry><symbol>insufficient_resources</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>53100</literal></entry>
+ <entry><symbol>disk_full</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>53200</literal></entry>
+ <entry><symbol>out_of_memory</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>53300</literal></entry>
+ <entry><symbol>too_many_connections</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>53400</literal></entry>
+ <entry><symbol>configuration_limit_exceeded</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 54 — Program Limit Exceeded</></entry>
+</row>
+
+<row>
+ <entry><literal>54000</literal></entry>
+ <entry><symbol>program_limit_exceeded</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>54001</literal></entry>
+ <entry><symbol>statement_too_complex</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>54011</literal></entry>
+ <entry><symbol>too_many_columns</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>54023</literal></entry>
+ <entry><symbol>too_many_arguments</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 55 — Object Not In Prerequisite State</></entry>
+</row>
+
+<row>
+ <entry><literal>55000</literal></entry>
+ <entry><symbol>object_not_in_prerequisite_state</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>55006</literal></entry>
+ <entry><symbol>object_in_use</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>55P02</literal></entry>
+ <entry><symbol>cant_change_runtime_param</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>55P03</literal></entry>
+ <entry><symbol>lock_not_available</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 57 — Operator Intervention</></entry>
+</row>
+
+<row>
+ <entry><literal>57000</literal></entry>
+ <entry><symbol>operator_intervention</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>57014</literal></entry>
+ <entry><symbol>query_canceled</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>57P01</literal></entry>
+ <entry><symbol>admin_shutdown</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>57P02</literal></entry>
+ <entry><symbol>crash_shutdown</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>57P03</literal></entry>
+ <entry><symbol>cannot_connect_now</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>57P04</literal></entry>
+ <entry><symbol>database_dropped</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class 58 — System Error (errors external to <productname>PostgreSQL</> itself)</></entry>
+</row>
+
+<row>
+ <entry><literal>58000</literal></entry>
+ <entry><symbol>system_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>58030</literal></entry>
+ <entry><symbol>io_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>58P01</literal></entry>
+ <entry><symbol>undefined_file</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>58P02</literal></entry>
+ <entry><symbol>duplicate_file</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class F0 — Configuration File Error</></entry>
+</row>
+
+<row>
+ <entry><literal>F0000</literal></entry>
+ <entry><symbol>config_file_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>F0001</literal></entry>
+ <entry><symbol>lock_file_exists</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class HV — Foreign Data Wrapper Error (SQL/MED)</></entry>
+</row>
+
+<row>
+ <entry><literal>HV000</literal></entry>
+ <entry><symbol>fdw_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV005</literal></entry>
+ <entry><symbol>fdw_column_name_not_found</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV002</literal></entry>
+ <entry><symbol>fdw_dynamic_parameter_value_needed</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV010</literal></entry>
+ <entry><symbol>fdw_function_sequence_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV021</literal></entry>
+ <entry><symbol>fdw_inconsistent_descriptor_information</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV024</literal></entry>
+ <entry><symbol>fdw_invalid_attribute_value</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV007</literal></entry>
+ <entry><symbol>fdw_invalid_column_name</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV008</literal></entry>
+ <entry><symbol>fdw_invalid_column_number</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV004</literal></entry>
+ <entry><symbol>fdw_invalid_data_type</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV006</literal></entry>
+ <entry><symbol>fdw_invalid_data_type_descriptors</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV091</literal></entry>
+ <entry><symbol>fdw_invalid_descriptor_field_identifier</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00B</literal></entry>
+ <entry><symbol>fdw_invalid_handle</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00C</literal></entry>
+ <entry><symbol>fdw_invalid_option_index</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00D</literal></entry>
+ <entry><symbol>fdw_invalid_option_name</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV090</literal></entry>
+ <entry><symbol>fdw_invalid_string_length_or_buffer_length</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00A</literal></entry>
+ <entry><symbol>fdw_invalid_string_format</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV009</literal></entry>
+ <entry><symbol>fdw_invalid_use_of_null_pointer</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV014</literal></entry>
+ <entry><symbol>fdw_too_many_handles</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV001</literal></entry>
+ <entry><symbol>fdw_out_of_memory</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00P</literal></entry>
+ <entry><symbol>fdw_no_schemas</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00J</literal></entry>
+ <entry><symbol>fdw_option_name_not_found</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00K</literal></entry>
+ <entry><symbol>fdw_reply_handle</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00Q</literal></entry>
+ <entry><symbol>fdw_schema_not_found</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00R</literal></entry>
+ <entry><symbol>fdw_table_not_found</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00L</literal></entry>
+ <entry><symbol>fdw_unable_to_create_execution</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00M</literal></entry>
+ <entry><symbol>fdw_unable_to_create_reply</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>HV00N</literal></entry>
+ <entry><symbol>fdw_unable_to_establish_connection</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class P0 — PL/pgSQL Error</></entry>
+</row>
+
+<row>
+ <entry><literal>P0000</literal></entry>
+ <entry><symbol>plpgsql_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>P0001</literal></entry>
+ <entry><symbol>raise_exception</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>P0002</literal></entry>
+ <entry><symbol>no_data_found</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>P0003</literal></entry>
+ <entry><symbol>too_many_rows</symbol></entry>
+</row>
+
+
+<row>
+ <entry spanname="span12"><emphasis role="bold">Class XX — Internal Error</></entry>
+</row>
+
+<row>
+ <entry><literal>XX000</literal></entry>
+ <entry><symbol>internal_error</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>XX001</literal></entry>
+ <entry><symbol>data_corrupted</symbol></entry>
+</row>
+
+<row>
+ <entry><literal>XX002</literal></entry>
+ <entry><symbol>index_corrupted</symbol></entry>
+</row>
--- /dev/null
+<!-- doc/src/sgml/example-AWS.sgml -->
+
+<sect1 id="example-AWS">
+ <title>AWS Configuration Example</title>
+
+ <para>
+ This tutorial explains the simple way to try "Watchdog"
+ on <ulink url="https://aws.amazon.com/">AWS</ulink> and using
+ the <ulink url="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html">
+ Elastic IP Address</ulink> as the Virtual IP for the high availability solution.
+ <note>
+ <para>
+ You can use watchdog with <productname>
+ Pgpool-II</productname> in any mode: replication mode,
+ native replication mode and raw mode.
+ </para>
+ </note>
+ </para>
+
+ <sect2 id="example-AWS-setup">
+ <title>AWS Setup</title>
+ <para>
+ For this example, we will use two node <productname>
+ Pgpool-II</productname> watchdog cluster. So we will set up two
+ Linux Amazon EC2 instances and one Elastic IP address.
+ So for this example, do the following steps:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Launch two Linux Amazon EC2 instances. For this example, we name these
+ instances as "instance-1" and "instance-2"
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Configure the security group for the instances and allow inbound traffic
+ on ports used by pgpool-II and watchdog.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Install the <productname>Pgpool-II</productname> on both instances.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Allocate an Elastic IP address.
+ For this example, we will use "35.163.178.3" as an Elastic IP address"
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+ <sect2 id="example-AWS-pgpool-config">
+ <title><productname>Pgpool-II</productname> configurations</title>
+ <para>
+ Mostly the <productname>Pgpool-II</productname> configurations for this
+ example will be same as in the <xref linkend="example-cluster">, except the
+ <xref linkend="guc-delegate-ip"> which we will not set in this example instead
+ we will use <xref linkend="guc-wd-escalation-command"> and
+ <xref linkend="guc-wd-de-escalation-command"> to switch the
+ Elastic IP address to the leader/Active <productname>Pgpool-II</productname> node.
+ </para>
+ <programlisting>
+use_watchdog = on
+delegate_IP = ''
+...
+wd_escalation_command = '$path_to_script/aws-escalation.sh'
+wd_de_escalation_command = '$path_to_script/aws-de-escalation.sh'
+ </programlisting>
+ </sect2>
+
+ <sect2 id="example-AWS-pgpool-aws-escalation-instance">
+ <title>escalation and de-escalation Scripts</title>
+ <para>
+ Create the aws-escalation.sh and aws-de-escalation.sh scripts on both
+ instances and point the <xref linkend="guc-wd-escalation-command"> and
+ <xref linkend="guc-wd-de-escalation-command"> to the respective scripts.
+ </para>
+
+ <note>
+ <para>
+ You may need to configure the AWS CLI first on all AWS instances
+ to enable the execution of commands used by wd-escalation.sh and wd-de-escalation.sh.
+ See <ulink url="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html">configure AWS CLI</ulink>
+ </para>
+ </note>
+
+ <sect3 id="example-AWS-pgpool-aws-escalation-script">
+ <title>escalation script</title>
+
+ <para>
+ This script will be executed by the watchdog
+ to assign the Elastic IP on the instance when the watchdog becomes the active/leader node.
+ Change the INSTANCE_ID and ELASTIC_IP values as per your AWS setup values.
+ </para>
+ <para>
+ <emphasis>aws-escalation.sh:</emphasis>
+ <programlisting>
+ #! /bin/sh
+
+ ELASTIC_IP=35.163.178.3
+ # replace it with the Elastic IP address you
+ # allocated from the aws console
+ INSTANCE_ID=i-0a9b64e449b17ed4b
+ # replace it with the instance id of the Instance
+ # this script is installed on
+
+ echo "Assigning Elastic IP $ELASTIC_IP to the instance $INSTANCE_ID"
+ # bring up the Elastic IP
+ aws ec2 associate-address --instance-id $INSTANCE_ID --public-ip $ELASTIC_IP
+
+ exit 0
+ </programlisting>
+
+ </para>
+ </sect3>
+
+ <sect3 id="example-AWS-pgpool-aws-de-escalation-script">
+ <title>de-escalation script</title>
+
+ <para>
+ This script will be executed by watchdog
+ to remove the Elastic IP from the instance when the watchdog resign from the active/leader node.
+ </para>
+ <para>
+ <emphasis>aws-de-escalation.sh:</emphasis>
+ <programlisting>
+ #! /bin/sh
+
+ ELASTIC_IP=35.163.178.3
+ # replace it with the Elastic IP address you
+ # allocated from the aws console
+
+ echo "disassociating the Elastic IP $ELASTIC_IP from the instance"
+ # bring down the Elastic IP
+ aws ec2 disassociate-address --public-ip $ELASTIC_IP
+ exit 0
+ </programlisting>
+ </para>
+ </sect3>
+
+ <bibliography>
+ <title>AWS Command References</title>
+
+ <biblioentry>
+ <biblioset relation="article">
+ <title><ulink url="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html">Configure AWS CLI</ulink></title>
+ </biblioset>
+ <biblioset relation="book">
+ <title>AWS Documentation: Configuring the AWS Command Line Interface</title>
+ </biblioset>
+ </biblioentry>
+
+ <biblioentry>
+ <biblioset relation="article">
+ <title><ulink url="http://docs.aws.amazon.com/cli/latest/reference/ec2/associate-address.html">associate-address</ulink></title>
+ </biblioset>
+ <biblioset relation="book">
+ <title>AWS Documentation: associate-address reference</title>
+ </biblioset>
+ </biblioentry>
+
+ <biblioentry>
+ <biblioset relation="article">
+ <title><ulink url="http://docs.aws.amazon.com/cli/latest/reference/ec2/disassociate-address.html">disassociate-address</ulink></title>
+ </biblioset>
+ <biblioset relation="book">
+ <title>AWS Documentation: disassociate-address reference</title>
+ </biblioset>
+ </biblioentry>
+
+ </bibliography>
+ </sect2>
+
+ <sect2 id="example-AWS-try">
+ <title>Try it out</title>
+ <para>
+ Start <productname>Pgpool-II</productname> on each server with "-n" switch
+ and redirect log messages to the pgpool.log file.
+ The log message of leader/active <productname>Pgpool-II</productname> node
+ will show the message of Elastic IP assignment.
+ <programlisting>
+ LOG: I am the cluster leader node. Starting escalation process
+ LOG: escalation process started with PID:23543
+ LOG: watchdog: escalation started
+ <emphasis>
+ Assigning Elastic IP 35.163.178.3 to the instance i-0a9b64e449b17ed4b
+ {
+ "AssociationId": "eipassoc-39853c42"
+ }
+ </emphasis>
+ LOG: watchdog escalation successful
+ LOG: watchdog escalation process with pid: 23543 exit with SUCCESS.
+ </programlisting>
+ </para>
+
+ <para>
+ Confirm to ping to the Elastic IP address.
+ <programlisting>
+ [user@someserver]$ ping 35.163.178.3
+ PING 35.163.178.3 (35.163.178.3) 56(84) bytes of data.
+ 64 bytes from 35.163.178.3: icmp_seq=1 ttl=64 time=0.328 ms
+ 64 bytes from 35.163.178.3: icmp_seq=2 ttl=64 time=0.264 ms
+ 64 bytes from 35.163.178.3: icmp_seq=3 ttl=64 time=0.412 ms
+ </programlisting>
+ </para>
+
+ <para>
+ Try to connect <productname>PostgreSQL</productname> by "psql -h ELASTIC_IP -p port".
+ <programlisting>
+ [user@someserver]$ psql -h 35.163.178.3 -p 9999 -l
+ </programlisting>
+ </para>
+ </sect2>
+
+ <sect2 id="example-AWS-vip-switch">
+ <title>Switching Elastic IP</title>
+ <para>
+ To confirm if the Standby server acquires the Elastic IP when the
+ Active server becomes unavailable, Stop the <productname>Pgpool-II</productname>
+ on the Active server. Then, the Standby server should start using the Elastic IP address,
+ And the <productname>Pgpool-II</productname> log will show the below messages.
+
+ <programlisting>
+ <emphasis>
+ LOG: remote node "172.31.2.94:9999 [Linux ip-172-31-2-94]" is shutting down
+ LOG: watchdog cluster has lost the coordinator node
+ </emphasis>
+ LOG: watchdog node state changed from [STANDBY] to [JOINING]
+ LOG: watchdog node state changed from [JOINING] to [INITIALIZING]
+ LOG: I am the only alive node in the watchdog cluster
+ HINT: skipping stand for coordinator state
+ LOG: watchdog node state changed from [INITIALIZING] to [LEADER]
+ LOG: I am announcing my self as leader/coordinator watchdog node
+ LOG: I am the cluster leader node
+ DETAIL: our declare coordinator message is accepted by all nodes
+ LOG: I am the cluster leader node. Starting escalation process
+ LOG: escalation process started with PID:23543
+ LOG: watchdog: escalation started
+ <emphasis>
+ Assigning Elastic IP 35.163.178.3 to the instance i-0dd3e60734a6ebe14
+ {
+ "AssociationId": "eipassoc-39853c42"
+ }
+ </emphasis>
+ LOG: watchdog escalation successful
+ LOG: watchdog escalation process with pid: 61581 exit with SUCCESS.
+ </programlisting>
+
+ Confirm to ping to the Elastic IP address again.
+
+ <programlisting>
+ [user@someserver]$ ping 35.163.178.3
+ PING 35.163.178.3 (35.163.178.3) 56(84) bytes of data.
+ 64 bytes from 35.163.178.3: icmp_seq=1 ttl=64 time=0.328 ms
+ 64 bytes from 35.163.178.3: icmp_seq=2 ttl=64 time=0.264 ms
+ 64 bytes from 35.163.178.3: icmp_seq=3 ttl=64 time=0.412 ms
+ </programlisting>
+ </para>
+ <para>
+ Try to connect <productname>PostgreSQL</productname> by "psql -h ELASTIC_IP -p port".
+ <programlisting>
+ [user@someserver]$ psql -h 35.163.178.3 -p 9999 -l
+ </programlisting>
+ </para>
+ </sect2>
+</sect1>
--- /dev/null
+<sect1 id="example-Aurora">
+ <title>Aurora Configuration Example</title>
+
+ <para>
+ <productname>Amazon Aurora for PostgreSQL
+ Compatibility</productname> (Aurora) is a managed service for
+ <productname>PostgreSQL</productname>. From user's point of
+ view, <productname>Aurora</productname> can be regarded as a
+ streaming replication cluster with some exceptions. First,
+ fail over and online recovery are managed
+ by <productname>Aurora</productname>. So you don't need to
+ set <xref linkend="guc-failover-command">, <xref linkend="guc-follow-primary-command">,
+ and recovery related parameters. In this section we explain
+ how to set up <productname>Pgpool-II</productname> for Aurora.
+ </para>
+
+ <sect2 id="example-Aurora-config">
+ <title>Setting pgpool.conf for Aurora</title>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Create <filename>pgpool.conf</filename>
+ from <filename>pgpool.conf.sample-stream</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Set <xref linkend="guc-sr-check-period"> to 0 to
+ disable streaming replication delay checking. This
+ is because <productname>Aurora</productname> does
+ not provide necessary functions to check the
+ replication delay.
+ </para>
+ <programlisting>
+sr_check_period = 0
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Enable <xref linkend="guc-enable-pool-hba"> to on so
+ that md5 authentication is enabled
+ (<productname>Aurora</productname> always use md5
+ authentication).
+ </para>
+ <programlisting>
+enable_pool_hba = on
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Create <filename>pool_password</filename>. See <xref linkend="auth-md5">
+ for more details.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Set <xref linkend="guc-backend-hostname">0 for the Aurora cluster endpoint.
+ Set <xref linkend="guc-backend-hostname">1 for the Aurora reader endpoint.
+ Set appropriate <xref linkend="guc-backend-weight"> as usual.
+ You don't need to set <xref linkend="guc-backend-data-directory">.
+ </para>
+ <programlisting>
+backend_hostname0 = 'cluster endpoint'
+backend_hostname1 = 'reader endpoint'
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Set <varname>ALWAYS_PRIMARY</varname> flag to
+ the <xref linkend="guc-backend-flag">
+ for <xref linkend="guc-backend-hostname">0.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Because failover is managed by Aurora, set <varname>DISALLOW_TO_FAILOVER</varname> flag to
+ the <xref linkend="guc-backend-flag">
+ for <xref linkend="guc-backend-hostname">0 and <xref linkend="guc-backend-hostname">1.
+ </para>
+ <programlisting>
+backend_flag0 = 'ALWAYS_MASTER|DISALLOW_TO_FAILOVER'
+backend_flag1 = 'DISALLOW_TO_FAILOVER'
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Set <xref linkend="guc-health-check-period"> to 0 to disable health checking.
+ </para>
+ <programlisting>
+health_check_period = 0
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Disable <xref linkend="guc-failover-on-backend-error">
+ to avoid failover when connecting to the backend or
+ detecting errors on backend side while executing
+ queries for the same reasons above.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+</sect1>
--- /dev/null
+<sect1 id="example-Kubernetes">
+ <title><productname>Pgpool-II</productname> on Kubernetes</title>
+ <para>
+ This section explains how to run <productname>Pgpool-II</productname> to achieve
+ read query load balancing and connection pooling on Kubernetes.
+ </para>
+ <sect2 id="example-Kubernetes-intro">
+ <title>Introduction</title>
+ <para>
+ Because <productname>PostgreSQL</productname> is a stateful application and managing
+ <productname>PostgreSQL</productname> has very specific requirements (e.g. backup,
+ recovery, automatic failover, etc), the built-in functionality of <productname>Kubernetes</productname>
+ can't handle these tasks. Therefore, an Operator that extends the functionality of the Kubernetes to create
+ and manage PostgreSQL is required.
+ </para>
+ <para>
+ There are several PostgreSQL operators, such as
+ <ulink url="https://github.com/CrunchyData/postgres-operator">Crunchy PostgreSQL Operator</ulink>,
+ <ulink url="https://github.com/zalando/postgres-operator">Zalando PostgreSQL Operator</ulink> and
+ <ulink url="https://github.com/kubedb/operator">KubeDB</ulink>.
+ However, these operators don't provide query load balancing functionality.
+ </para>
+ <para>
+ This section explains how to combine PostgreSQL Operator with Pgpool-II to deploy a PostgreSQL cluster
+ with query load balancing and connection pooling capability on Kubernetes. Pgpool-II can be combined with
+ any of the PostgreSQL operators mentioned above.
+ </para>
+ </sect2>
+
+ <sect2 id="example-Kubernetes-architecture">
+ <title>Architecture</title>
+ <para>
+ <figure>
+ <title>Architecture</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="pgpool_on_k8s.gif">
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </para>
+ </sect2>
+
+ <sect2 id="example-Kubernetes-pre-setup">
+ <title>Prerequisites</title>
+ <para>
+ Before you start the configuration process, please check the following prerequisites.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Make sure you have a <productname>Kubernetes</productname> cluster, and <command>kubectl</command> is installed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ PostgreSQL Operator and a PostgreSQL cluster are installed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="example-Kubernetes-deploy-pgpool">
+ <title>Deploy Pgpool-II</title>
+ <para>
+ Deploy Pgpool-II pod that contains a Pgpool-II container and a
+ <ulink url="https://github.com/pgpool/pgpool2_exporter">Pgpool-II Exporter</ulink> container.
+ </para>
+ <programlisting>
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: pgpool
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: pgpool
+ template:
+ metadata:
+ labels:
+ app: pgpool
+ spec:
+ containers:
+ - name: pgpool
+ image: pgpool/pgpool:4.2
+ ...
+ - name: pgpool-stats
+ image: pgpool/pgpool2_exporter:1.0
+ ...
+ </programlisting>
+ <para>
+ <productname>Pgpool-II</productname>'s health check, automatic failover, Watchdog and online recovery features
+ aren't required on <productname>Kubernetes</productname>. You need to only enable load balancing and connection
+ pooling.
+ </para>
+ <para>
+ The Pgpool-II pod should work with the minimal configuration below:
+ </para>
+ <programlisting>
+backend_hostname0='primary service name'
+backend_hostname1='replica service name'
+backend_port0='5432'
+backend_port1='5432'
+backend_flag0='ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER'
+backend_flag1='DISALLOW_TO_FAILOVER'
+
+sr_check_period = 10
+sr_check_user='PostgreSQL user name'
+
+load_balance_mode = on
+connection_cache = on
+listen_addresses = '*'
+ </programlisting>
+ <para>
+ There are two ways you can configure Pgpool-II.
+ <orderedlist>
+ <listitem>
+ <para>
+ Using environment variables
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Using a <ulink url="https://kubernetes.io/docs/concepts/configuration/configmap/">ConfigMap</ulink>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ You may need to configure client authentication and more parameters in a production environment.
+ In a production environment, we recommend using a ConfigMap to configure Pgpool-II's
+ config files, i.e. pgpool.conf, pcp.conf, pool_passwd and pool_hba.conf.
+ </para>
+ <para>
+ The following sections explain how to configure and deploy Pgpool-II pod using environment
+ variables and ConfigMap respectively. You can download the various manifest files used for
+ deploying Pgpool-II from <ulink url="https://github.com/pgpool/pgpool2_on_k8s">here</ulink>.
+ </para>
+
+ <sect3 id="example-Kubernetes-configure-pgpool-env">
+ <title>Configure Pgpool-II using environment variables</title>
+ <para>
+ Kubernetes environment variables can be passed to a container in a pod.
+ You can define environment variables in the deployment manifest to configure Pgpool-II's parameters.
+ <filename>pgpool_deploy.yaml</filename> is an example of a Deployment manifest.
+ You can download <filename>pgpool_deploy.yaml</filename> and specify environment variables in this manifest file.
+ </para>
+ <programlisting>
+$ curl -LO https://raw.githubusercontent.com/pgpool/pgpool2_on_k8s/master/pgpool_deploy.yaml
+ </programlisting>
+ <para>
+ Environment variables starting with <literal>PGPOOL_PARAMS_</literal> can be converted to Pgpool-II's configuration
+ parameters and these values can override the default configurations.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The Pgpool-II container Docker images is build with streaming replication mode.
+ By default, load balancing, connection pooling and streaming replication check is enabled.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Specify <emphasis>only two backend nodes</emphasis>.
+ Specify the Primary Service name to <xref linkend="GUC-BACKEND-HOSTNAME">0.
+ Specify the Replica Service name to <xref linkend="GUC-BACKEND-HOSTNAME">1.
+ Because failover is managed by <productname>Kubernetes</productname>,
+ specify <literal>DISALLOW_TO_FAILOVER</literal> flag to <xref linkend="GUC-BACKEND-FLAG">
+ for both of the two nodes and <literal>ALWAYS_PRIMARY</literal> flag to <xref linkend="GUC-BACKEND-FLAG">0.
+ Configure appropriate <xref linkend="GUC-BACKEND-WEIGHT"> as usual.
+ You don't need to specify <xref linkend="GUC-BACKEND-DATA-DIRECTORY">.
+ </para>
+ <para>
+ For example, the following environment variables defined in manifest,
+ </para>
+ <programlisting>
+env:
+- name: PGPOOL_PARAMS_BACKEND_HOSTNAME0
+ value: "hippo"
+- name: PGPOOL_PARAMS_BACKEND_HOSTNAME1
+ value: "hippo-replica"
+- name: PGPOOL_PARAMS_BACKEND_FLAG0
+ value: "ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER"
+- name: PGPOOL_PARAMS_BACKEND_FLAG1
+ value: "DISALLOW_TO_FAILOVER"
+ </programlisting>
+ <para>
+ will be convert to the following configuration parameters in pgpool.conf.
+ </para>
+ <programlisting>
+backend_hostname0='hippo'
+backend_hostname1='hippo-replica'
+backend_flag0='ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER'
+backend_flag1='DISALLOW_TO_FAILOVER'
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Specify a PostgreSQL user name and password to perform streaming replication check.
+ For the security reasons, we recommend that you specify a encrypted password.
+ </para>
+ <programlisting>
+- name: PGPOOL_PARAMS_SR_CHECK_USER
+ value: "PostgreSQL user name"
+- name: PGPOOL_PARAMS_SR_CHECK_PASSWORD
+ value: "encrypted PostgreSQL user's password"
+ </programlisting>
+ <para>
+ Alternatively, you can create a secret and use this secret as environment variables.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Since health check is performed by <productname>Kubernetes</productname>, Pgpool-II's health check should be disabled.
+ Because the default value is off, we don't need to set this parameter.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ By default, the following environment variables will be set when Pgpool-II container is started.
+ </para>
+ <programlisting>
+export PGPOOL_PARAMS_LISTEN_ADDRESSES=*
+export PGPOOL_PARAMS_SR_CHECK_USER=${POSTGRES_USER:-"postgres"}
+export PGPOOL_PARAMS_SOCKET_DIR=/var/run/postgresql
+export PGPOOL_PARAMS_PCP_SOCKET_DIR=/var/run/postgresql
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </sect3>
+ <sect3 id="example-Kubernetes-configure-pgpool-configmap">
+ <title>Configure Pgpool-II using ConfigMap</title>
+ <para>
+ Alternatively, you can use a Kubernetes <literal>ConfigMap</literal> to store entire configuration files,
+ i.e. pgpool.conf, pcp.conf, pool_passwd and pool_hba.conf.
+ The <literal>ConfigMap</literal> can be mounted to Pgpool-II's container as a volume.
+ </para>
+ <para>
+ You can download the example manifest files that define the <literal>ConfigMap</literal> and <literal>Deployment</literal>
+ from <ulink url="https://github.com/pgpool/pgpool2_on_k8s">repository</ulink>.
+ </para>
+ <programlisting>
+curl -LO https://raw.githubusercontent.com/pgpool/pgpool2_on_k8s/master/pgpool_configmap.yaml
+curl -LO https://raw.githubusercontent.com/pgpool/pgpool2_on_k8s/master/pgpool_deploy_with_mount_configmap.yaml
+ </programlisting>
+ <para>
+ The manifest that defines the <literal>ConfigMap</literal> is in the following format. You can update it based
+ on your configuration preferences.
+ </para>
+ <programlisting>
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: pgpool-config
+ labels:
+ app: pgpool-config
+data:
+ pgpool.conf: |-
+ listen_addresses = '*'
+ port = 9999
+ socket_dir = '/var/run/postgresql'
+ pcp_listen_addresses = '*'
+ pcp_port = 9898
+ pcp_socket_dir = '/var/run/postgresql'
+ backend_hostname0 = 'hippo'
+ backend_port0 = 5432
+ backend_weight0 = 1
+ backend_flag0 = 'ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER'
+ backend_hostname1 = 'hippo-replica'
+ backend_port1 = 5432
+ backend_weight1 = 1
+ backend_flag1 = 'DISALLOW_TO_FAILOVER'
+ sr_check_user = 'postgres'
+ sr_check_period = 10
+ enable_pool_hba = on
+ master_slave_mode = on
+ num_init_children = 32
+ max_pool = 4
+ child_life_time = 300
+ child_max_connections = 0
+ connection_life_time = 0
+ client_idle_limit = 0
+ connection_cache = on
+ load_balance_mode = on
+ pcp.conf: |-
+ postgres:e8a48653851e28c69d0506508fb27fc5
+ pool_passwd: |-
+ postgres:md53175bce1d3201d16594cebf9d7eb3f9d
+ pool_hba.conf: |-
+ local all all trust
+ host all all 127.0.0.1/32 trust
+ host all all ::1/128 trust
+ host all all 0.0.0.0/0 md5
+ </programlisting>
+ <para>
+ First, you need to create the <literal>ConfigMap</literal> before referencing it to <productname>Pgpool-II</productname> pod.
+ </para>
+ <programlisting>
+kubectl apply -f pgpool_configmap.yaml
+ </programlisting>
+ <para>
+ Once you have created the <literal>ConfigMap</literal>, you can deploy <productname>Pgpool-II</productname> pod and
+ mount the <literal>ConfigMap</literal> to Pgpool-II pod as a volume.
+ </para>
+ <programlisting>
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: pgpool
+ ...
+ volumeMounts:
+ - name: pgpool-config
+ mountPath: /usr/local/pgpool-II/etc
+ ...
+ volumes:
+ - name: pgpool-config
+ configMap:
+ name: pgpool-config
+ </programlisting>
+ <para>
+ <filename>pgpool_deploy_with_mount_configmap.yaml</filename> is an example of a Deployment manifest that mounts the
+ created <literal>ConfigMap</literal> to the <productname>Pgpool-II</productname> pod.
+ </para>
+ <programlisting>
+kubectl apply -f pgpool_deploy_with_mount_configmap.yaml
+ </programlisting>
+ <para>
+ After deploying Pgpool-II, you can see the Pgpool-II pod and services using <command>kubectl get pod</command>
+ and <command>kubectl get svc</command> command.
+ </para>
+ </sect3>
+ </sect2>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/example-basic.sgml -->
+<sect1 id="example-basic">
+ <title>Basic Configuration Example</title>
+
+ <sect2 id="example-configs-begin">
+ <title>Let's Begin!</title>
+ <para>
+ First, we must learn how to install and configure <productname>Pgpool-II</productname> and database nodes before using replication.
+ </para>
+
+ <sect3 id="example-configs-begin-installing">
+ <title>Installing <productname>Pgpool-II</productname></title>
+ <para>
+ Installing <productname>Pgpool-II</productname> is very easy.
+ In the directory which you have extracted the source tar ball,
+ execute the following commands.
+ <programlisting>
+ $ ./configure
+ $ make
+ $ make install
+ </programlisting>
+ <command>configure</command> script collects your system information
+ and use it for the compilation procedure. You can pass command
+ line arguments to <command>configure</command> script to change the default behavior,
+ such as the installation directory. <productname>Pgpool-II</productname>
+ will be installed to <literal>/usr/local</literal> directory by default.
+ </para>
+ <para>
+ <command>make</command> command compiles the source code, and
+ <command>make install</command> will install the executables.
+ You must have write permission on the installation directory.
+ In this tutorial, we will install <productname>Pgpool-II
+ </productname> in the default <literal>/usr/local</literal> directory.
+ </para>
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> requires <literal>libpq</literal>
+ library in <productname>PostgreSQL</productname> 7.4 or later (version 3 protocol).
+ </para>
+ </note>
+ <para>
+ If the <command>configure</command> script displays the following error message, the
+ <literal>libpq</literal> library may not be installed, or it is not of version 3
+ <programlisting>
+ configure: error: libpq is not installed or libpq is old
+ </programlisting>
+ If the library is version 3, but the above message is still displayed, your
+ <literal>libpq</literal> library is probably not recognized by the <command>
+ configure</command> script.
+ The <command>configure</command> script searches for <literal>libpq</literal>
+ library under <literal>/usr/local/pgsql</literal>. If you have installed the
+ <productname>PostgreSQL</productname> in a directory other than <literal>/usr/local/pgsql</literal>, use
+ <literal>--with-pgsql</literal>, or <literal>--with-pgsql-includedir</literal>
+ and <literal>--with-pgsql-libdir</literal> command line options when you
+ execute <command>configure</command>.
+ </para>
+ </sect3>
+
+ <sect3 id="example-configs-begin-config-files">
+ <title>Configuration Files</title>
+ <para>
+ <productname>Pgpool-II</productname> configuration parameters are saved in the
+ <literal>pgpool.conf</literal> file. The file is in <literal>"parameter = value"
+ </literal> per line format. When you install <productname>Pgpool-II</productname>,
+ <literal>pgpool.conf.sample</literal> is automatically created.
+ We recommend copying and renaming it to <literal>pgpool.conf</literal>, and edit
+ it as you like.
+ <programlisting>
+ $ cp /usr/local/etc/pgpool.conf.sample /usr/local/etc/pgpool.conf
+ </programlisting>
+ <productname>Pgpool-II</productname> only accepts connections from the localhost
+ using port 9999 by the default. If you wish to receive connections from other hosts,
+ set <xref linkend="guc-listen-addresses"> to <literal>'*'</literal>.
+ <programlisting>
+ listen_addresses = 'localhost'
+ port = 9999
+ </programlisting>
+ We will use the default parameters in this tutorial.
+ </para>
+ </sect3>
+
+ <sect3 id="example-configs-begin-config-pcp">
+ <title>Configuring <acronym>PCP</acronym> Commands</title>
+ <para>
+ <productname>Pgpool-II</productname> has an interface for administrative
+ purpose to retrieve information on database nodes, shutdown
+ <productname>Pgpool-II</productname>, etc. via network. To use
+ <acronym>PCP</acronym> commands, user authentication is required.
+ This authentication is different from <productname>PostgreSQL</productname>'s user authentication.
+ A user name and password need to be defined in the <literal>pcp.conf</literal>
+ file. In the file, a user name and password are listed as a pair on each line,
+ and they are separated by a colon (:). Passwords are encrypted in
+ <literal>md5</literal> hash format.
+
+ <programlisting>
+ postgres:e8a48653851e28c69d0506508fb27fc5
+ </programlisting>
+
+ When you install <productname>Pgpool-II</productname>, <literal>pcp.conf.sample
+ </literal> is automatically created. We recommend copying and renaming it
+ to <literal>pcp.conf</literal>, and edit it.
+ <programlisting>
+ $ cp /usr/local/etc/pcp.conf.sample /usr/local/etc/pcp.conf
+ </programlisting>
+ To encrypt your password into md5 hash format, use the <command>pg_md5</command>
+ command, which is installed as one of <productname>Pgpool-II</productname>'s
+ executables. <command>pg_md5</command> takes text as a command line argument,
+ and displays its md5-hashed text.
+ For example, give <literal>"postgres"</literal> as the command line argument,
+ and <command>pg_md5</command> displays md5-hashed text on its standard output.
+ <programlisting>
+ $ /usr/local/bin/pg_md5 postgres
+ e8a48653851e28c69d0506508fb27fc5
+ </programlisting>
+ PCP commands are executed via network, so the port number must be configured
+ with <xref linkend="guc-pcp-port"> parameter in <literal>pgpool.conf</literal> file.
+ We will use the default 9898 for <xref linkend="guc-pcp-port"> in this tutorial.
+ <programlisting>
+ pcp_port = 9898
+ </programlisting>
+ </para>
+ </sect3>
+
+ <sect3 id="example-configs-prep-db-nodes">
+ <title>Preparing Database Nodes</title>
+ <para>
+ Now, we need to set up backend <productname>PostgreSQL</productname> servers for <productname>Pgpool-II
+ </productname>. These servers can be placed within the same host as
+ <productname>Pgpool-II</productname>, or on separate machines. If you decide
+ to place the servers on the same host, different port numbers must be assigned
+ for each server. If the servers are placed on separate machines,
+ they must be configured properly so that they can accept network
+ connections from <productname>Pgpool-II</productname>.
+
+ <programlisting>
+ backend_hostname0 = 'localhost'
+ backend_port0 = 5432
+ backend_weight0 = 1
+ backend_hostname1 = 'localhost'
+ backend_port1 = 5433
+ backend_weight1 = 1
+ backend_hostname2 = 'localhost'
+ backend_port2 = 5434
+ backend_weight2 = 1
+ </programlisting>
+
+ For <xref linkend="guc-backend-hostname">, <xref linkend="guc-backend-port">,
+ <xref linkend="guc-backend-weight">, set the node's hostname, port number,
+ and ratio for load balancing. At the end of each parameter string,
+ node ID must be specified by adding positive integers starting with 0 (i.e. 0, 1, 2..).
+ </para>
+ <note>
+ <para>
+ <xref linkend="guc-backend-weight"> parameters for all nodes are
+ set to 1, meaning that SELECT queries are equally distributed among
+ three servers.
+ </para>
+ </note>
+ </sect3>
+
+ <sect3 id="example-configs-start-stop-pgpool">
+ <title>Starting/Stopping <productname>Pgpool-II</productname></title>
+ <para>
+ To fire up <productname>Pgpool-II</productname>, execute the following
+ command on a terminal.
+
+ <programlisting>
+ $ pgpool
+ </programlisting>
+
+ The above command, however, prints no log messages because <productname>
+ Pgpool-II</productname> detaches the terminal. If you want to show
+ <productname>Pgpool-II</productname> log messages, you pass <literal>-n</literal>
+ option to <command>pgpool</command> command so <productname>Pgpool-II</productname>
+ is executed as non-daemon process, and the terminal will not be detached.
+ <programlisting>
+ $ pgpool -n &
+ </programlisting>
+
+ The log messages are printed on the terminal, so it is recommended to use the following options.
+ <programlisting>
+ $ pgpool -n -d > /tmp/pgpool.log 2>&1 &
+ </programlisting>
+
+ The <literal>-d</literal> option enables debug messages to be generated.
+ The above command keeps appending log messages to <literal>/tmp/pgpool.log
+ </literal>. If you need to rotate log files, pass the logs to a external
+ command which has log rotation function.
+ For example, you can use <ulink url="https://httpd.apache.org/docs/2.4/programs/rotatelogs.html">
+ <command>rotatelogs</command></ulink> from Apache2:
+ <programlisting>
+ $ pgpool -n 2>&1 | /usr/local/apache2/bin/rotatelogs \
+ -l -f /var/log/pgpool/pgpool.log.%A 86400 &
+ </programlisting>
+
+ This will generate a log file named <literal>"pgpool.log.Thursday"</literal>
+ then rotate it 00:00 at midnight. Rotatelogs adds logs to a file if it already
+ exists. To delete old log files before rotation, you could use cron:
+ <programlisting>
+ 55 23 * * * /usr/bin/find /var/log/pgpool -type f -mtime +5 -exec /bin/rm -f '{}' \;
+ </programlisting>
+
+ Please note that rotatelogs may exist as <literal>/usr/sbin/rotatelogs2</literal>
+ in some distributions. <literal>-f</literal> option generates a log file as soon as
+ <command>rotatelogs</command> starts and is available in apache2 2.2.9 or greater.
+ Also <ulink url="http://www.cronolog.org/">cronolog</ulink> can be used.
+ <programlisting>
+ $ pgpool -n 2>&1 | /usr/sbin/cronolog \
+ --hardlink=/var/log/pgsql/pgpool.log \
+ '/var/log/pgsql/%Y-%m-%d-pgpool.log' &
+ </programlisting>
+
+ To stop <productname>Pgpool-II</productname> execute the following command.
+ <programlisting>
+ $ pgpool stop
+ </programlisting>
+
+ If any client is still connected, <productname>Pgpool-II</productname>
+ waits for it to disconnect, and then terminates itself. Run the following
+ command instead if you want to shutdown <productname>Pgpool-II</productname>
+ forcibly.
+ <programlisting>
+ $ pgpool -m fast stop
+ </programlisting>
+
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="example-configs-replication">
+ <title>Your First Replication</title>
+ <para>
+ Replication (see <xref linkend="guc-replication-mode">) enables
+ the same data to be copied to multiple database nodes.
+ In this section, we'll use three database nodes, which we have already set
+ up in <xref linkend="example-configs-begin">, and takes you step by step to
+ create a database replication system.
+ Sample data to be replicated will be generated by the
+ <ulink url="https://www.postgresql.org/docs/current/static/pgbench.html">
+ <command>pgbench</command></ulink> benchmark program.
+ </para>
+
+ <sect3 id="example-configs-config-replication">
+ <title>Configuring Replication</title>
+ <para>
+ To enable the database replication function, set
+ <xref linkend="guc-replication-mode"> to on in <literal>pgpool.conf</literal> file.
+ <programlisting>
+ replication_mode = true
+ </programlisting>
+ When <xref linkend="guc-replication-mode"> is on, <productname>Pgpool-II</productname>
+ will send a copy of a received query to all the database nodes.
+ In addition, when <xref linkend="guc-load-balance-mode"> is set to true,
+ <productname>Pgpool-II</productname> will distribute <acronym>SELECT</acronym> queries
+ among the database nodes.
+ <programlisting>
+ load_balance_mode = true
+ </programlisting>
+ In this section, we will enable both <xref linkend="guc-replication-mode">
+ and <xref linkend="guc-load-balance-mode">.
+ </para>
+ </sect3>
+
+ <sect3 id="example-configs-checking-replication">
+ <title>Checking Replication</title>
+ <para>
+ To reflect the above changes in <literal>pgpool.conf</literal>,
+ <productname>Pgpool-II</productname> must be restarted.
+ Please refer to "Starting/Stopping <productname>Pgpool-II</productname>"
+ <xref linkend="example-configs-start-stop-pgpool">.
+ After configuring <literal>pgpool.conf</literal> and restarting the
+ <productname>Pgpool-II</productname>, let's try the actual replication
+ and see if everything is working.
+ First, we need to create a database to be replicated. We will name it
+ <literal>"bench_replication"</literal>. This database needs to be created
+ on all the nodes. Use the
+ <ulink url="https://www.postgresql.org/docs/current/static/app-createdb.html">
+ <command>createdb</command></ulink> commands through
+ <productname>Pgpool-II</productname>, and the database will be created
+ on all the nodes.
+ <programlisting>
+ $ createdb -p 9999 bench_replication
+ </programlisting>
+ Then, we'll execute <ulink url="https://www.postgresql.org/docs/current/static/pgbench.html">
+ <command>pgbench</command></ulink> with <literal>-i</literal> option.
+ <literal>-i</literal> option initializes the database with pre-defined tables and data.
+ <programlisting>
+ $ pgbench -i -p 9999 bench_replication
+ </programlisting>
+ The following table is the summary of tables and data, which will be created by
+ <ulink url="https://www.postgresql.org/docs/current/static/pgbench.html">
+ <command>pgbench -i</command></ulink>. If, on all the nodes, the listed tables and
+ data are created, replication is working correctly.
+ </para>
+
+ <table id="example-configs-checking-replication-table">
+ <title>data summary</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Table Name</entry>
+ <entry>Number of Rows</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>pgbench_branches</entry>
+ <entry>1</entry>
+ </row>
+
+ <row>
+ <entry>pgbench_tellers</entry>
+ <entry>10</entry>
+ </row>
+
+ <row>
+ <entry>pgbench_accounts</entry>
+ <entry>100000</entry>
+ </row>
+
+ <row>
+ <entry>pgbench_history</entry>
+ <entry>0</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ Let's use a simple shell script to check the above on all the nodes.
+ The following script will display the number of rows in pgbench_branches,
+ pgbench_tellers, pgbench_accounts, and pgbench_history tables on all the nodes (5432, 5433, 5434).
+ <programlisting>
+ $ for port in 5432 5433 5434; do
+ > echo $port
+ > for table_name in pgbench_branches pgbench_tellers pgbench_accounts pgbench_history; do
+ > echo $table_name
+ > psql -c "SELECT count(*) FROM $table_name" -p $port bench_replication
+ > done
+ > done
+ </programlisting>
+
+ </para>
+ </sect3>
+ </sect2>
+
+</sect1>
--- /dev/null
+<sect1 id="example-cluster">
+ <title><productname>Pgpool-II</productname> + Watchdog Setup Example</title>
+ <para>
+ This section shows an example of streaming replication configuration using
+ <productname>Pgpool-II</productname>. In this example, we use 3
+ <productname>Pgpool-II</productname> servers to manage <productname>PostgreSQL</productname>
+ servers to create a robust cluster system and avoid the single point of failure or split brain.
+ </para>
+ <para>
+ <productname>PostgreSQL</productname> 13 is used in this configuration example.
+ All scripts have been tested with <productname>PostgreSQL</productname> 95 and later.
+ </para>
+ <sect2 id="example-cluster-requirement">
+ <title>Requirements</title>
+ <para>
+ We assume that all the Pgpool-II servers and the <productname>PostgreSQL</productname> servers are in the same subnet.
+ </para>
+ </sect2>
+
+ <sect2 id="example-cluster-structure">
+ <title>Cluster System Configuration</title>
+ <para>
+ We use 3 servers with CentOS 7.4. Let these servers be <literal>server1</literal>,
+ <literal>server2</literal>, <literal>server3</literal>.
+ We install <productname>PostgreSQL</productname> and <productname>Pgpool-II</productname> on each server.
+ </para>
+ <para>
+ <figure>
+ <title>Cluster System Configuration</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="cluster_40.gif">
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </para>
+ <note>
+ <para>
+ The roles of <literal>Active</literal>, <literal>Standby</literal>, <literal>Primary</literal>,
+ <literal>Standby</literal> are not fixed and may be changed by further operations.
+ </para>
+ </note>
+ <table id="example-cluster-table-ip">
+ <title>Hostname and IP address</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Hostname</entry>
+ <entry>IP Address</entry>
+ <entry>Virtual IP</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>server1</entry>
+ <entry>192.168.137.101</entry>
+ <entry morerows="2">192.168.137.150</entry>
+ </row>
+ <row>
+ <entry>server2</entry>
+ <entry>192.168.137.102</entry>
+ </row>
+ <row>
+ <entry>server3</entry>
+ <entry>192.168.137.103</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="example-cluster-table-postgresql-config">
+ <title>PostgreSQL version and Configuration</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Item</entry>
+ <entry>Value</entry>
+ <entry>Detail</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>PostgreSQL Version</entry>
+ <entry>13.0</entry>
+ <entry>-</entry>
+ </row>
+ <row>
+ <entry>port</entry>
+ <entry>5432</entry>
+ <entry>-</entry>
+ </row>
+ <row>
+ <entry>$PGDATA</entry>
+ <entry>/var/lib/pgsql/13/data</entry>
+ <entry>-</entry>
+ </row>
+ <row>
+ <entry>Archive mode</entry>
+ <entry>on</entry>
+ <entry>/var/lib/pgsql/archivedir</entry>
+ </row>
+ <row>
+ <entry>Replication Slots</entry>
+ <entry>Enable</entry>
+ <entry>-</entry>
+ </row>
+ <row>
+ <entry>Start automatically</entry>
+ <entry>Enable</entry>
+ <entry>-</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="example-cluster-table-pgpool-config">
+ <title>Pgpool-II version and Configuration</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Item</entry>
+ <entry>Value</entry>
+ <entry>Detail</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Pgpool-II Version</entry>
+ <entry>4.2.0</entry>
+ <entry>-</entry>
+ </row>
+ <row>
+ <entry morerows='3'>port</entry>
+ <entry>9999</entry>
+ <entry>Pgpool-II accepts connections</entry>
+ </row>
+ <row>
+ <entry>9898</entry>
+ <entry>PCP process accepts connections</entry>
+ </row>
+ <row>
+ <entry>9000</entry>
+ <entry>watchdog accepts connections</entry>
+ </row>
+ <row>
+ <entry>9694</entry>
+ <entry>UDP port for receiving Watchdog's heartbeat signal</entry>
+ </row>
+ <row>
+ <entry>Config file</entry>
+ <entry>/etc/pgpool-II/pgpool.conf</entry>
+ <entry>Pgpool-II config file</entry>
+ </row>
+ <row>
+ <entry>Pgpool-II start user</entry>
+ <entry>postgres (Pgpool-II 4.1 or later)</entry>
+ <entry>Pgpool-II 4.0 or before, the default startup user is root</entry>
+ </row>
+ <row>
+ <entry>Running mode</entry>
+ <entry>streaming replication mode</entry>
+ <entry>-</entry>
+ </row>
+ <row>
+ <entry>Watchdog</entry>
+ <entry>on</entry>
+ <entry>Life check method: heartbeat</entry>
+ </row>
+ <row>
+ <entry>Start automatically</entry>
+ <entry>Enable</entry>
+ <entry>-</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="example-cluster-table-sample-scripts">
+ <title>Various sample scripts included in rpm package</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Feature</entry>
+ <entry>Script</entry>
+ <entry>Detail</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry morerows='1'>Failover</entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/master">/etc/pgpool-II/failover.sh.sample</ulink></entry>
+ <entry>Run by <xref linkend="GUC-FAILOVER-COMMAND"> to perform failover</entry>
+ </row>
+ <row>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/master">/etc/pgpool-II/follow_primary.sh.sample</ulink></entry>
+ <entry>Run by <xref linkend="GUC-FOLLOW-PRIMARY-COMMAND"> to synchronize the Standby with the new Primary after failover.</entry>
+ </row>
+ <row>
+ <entry morerows='1'>Online recovery</entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/master">/etc/pgpool-II/recovery_1st_stage.sample</ulink></entry>
+ <entry>Run by <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> to recovery a Standby node</entry>
+ </row>
+ <row>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/master">/etc/pgpool-II/pgpool_remote_start.sample</ulink></entry>
+ <entry>Run after <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> to start the Standby node</entry>
+ </row>
+ <row>
+ <entry morerows='1'>Watchdog</entry>
+ <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/master">/etc/pgpool-II/escalation.sh.sample</ulink></entry>
+ <entry>Run by <xref linkend="guc-wd-escalation-command"> to switch the Active/Standby Pgpool-II safely</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>
+ The above scripts are included in the RPM package and can be customized as needed.
+ </para>
+ </sect2>
+
+ <sect2 id="example-cluster-installation">
+ <title>Installation</title>
+ <para>
+ In this example, we install <productname>Pgpool-II</productname> 4.2 and <productname>PostgreSQL</productname> 13.0 using RPM packages.
+ </para>
+
+ <para>
+ Install <productname>PostgreSQL</productname> using <productname>PostgreSQL</productname> YUM repository.
+ </para>
+ <programlisting>
+# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+# yum install -y postgresql13-server
+ </programlisting>
+ <para>
+ Install <productname>Pgpool-II</productname> by using Pgpool-II YUM repository.
+ </para>
+ <programlisting>
+# yum install -y http://www.pgpool.net/yum/rpms/4.1/redhat/rhel-7-x86_64/pgpool-II-release-4.1-2.noarch.rpm
+# yum install -y pgpool-II-pg13-*
+ </programlisting>
+ </sect2>
+
+ <sect2 id="example-cluster-pre-setup">
+ <title>Before Starting</title>
+ <para>
+ Before you start the configuration process, please check the following prerequisites.
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Set up <productname>PostgreSQL</productname> streaming replication on the primary server.
+ In this example, we use WAL archiving.
+ </para>
+ <para>
+ First, we create the directory <filename>/var/lib/pgsql/archivedir</filename> to store
+ <acronym>WAL</acronym> segments on all servers. In this example, only Primary node archives
+ <acronym>WAL</acronym> locally.
+ </para>
+ <programlisting>
+[all servers]# su - postgres
+[all servers]$ mkdir /var/lib/pgsql/archivedir
+ </programlisting>
+
+ <para>
+ Then we edit the configuration file <filename>$PGDATA/postgresql.conf</filename>
+ on <literal>server1</literal> (primary) as follows. Enable <literal>wal_log_hints</literal>
+ to use <literal>pg_rewind</literal>.
+ Since the Primary may become a Standby later, we set <varname>hot_standby = on</varname>.
+ </para>
+ <programlisting>
+listen_addresses = '*'
+archive_mode = on
+archive_command = 'cp "%p" "/var/lib/pgsql/archivedir/%f"'
+max_wal_senders = 10
+max_replication_slots = 10
+wal_level = replica
+hot_standby = on
+wal_log_hints = on
+ </programlisting>
+ <para>
+ We use the online recovery functionality of <productname>Pgpool-II</productname> to setup standby server after the primary server is started.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Because of the security reasons, we create a user <literal>repl</literal> solely used
+ for replication purpose, and a user <literal>pgpool</literal> for streaming
+ replication delay check and health check of <productname>Pgpool-II</productname>.
+ </para>
+
+ <table id="example-cluster-user">
+ <title>Users</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>User Name</entry>
+ <entry>Password</entry>
+ <entry>Detail</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>repl</entry>
+ <entry>repl</entry>
+ <entry>PostgreSQL replication user</entry>
+ </row>
+ <row>
+ <entry>pgpool</entry>
+ <entry>pgpool</entry>
+ <entry>Pgpool-II health check (<xref linkend="GUC-HEALTH-CHECK-USER">) and replication delay check (<xref linkend="GUC-SR-CHECK-USER">) user</entry>
+ </row>
+ <row>
+ <entry>postgres</entry>
+ <entry>postgres</entry>
+ <entry>User running online recovery</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <programlisting>
+[server1]# psql -U postgres -p 5432
+postgres=# SET password_encryption = 'scram-sha-256';
+postgres=# CREATE ROLE pgpool WITH LOGIN;
+postgres=# CREATE ROLE repl WITH REPLICATION LOGIN;
+postgres=# \password pgpool
+postgres=# \password repl
+postgres=# \password postgres
+ </programlisting>
+
+ <para>
+ If you want to show "replication_state" and "replication_sync_state" column in
+ <xref linkend="SQL-SHOW-POOL-NODES"> command result, role <literal>pgpool</literal>
+ needs to be PostgreSQL super user or or in <literal>pg_monitor</literal> group
+ (<productname>Pgpool-II</productname> 4.1 or later). Grant <literal>pg_monitor</literal>
+ to <literal>pgpool</literal>:
+ </para>
+ <programlisting>
+GRANT pg_monitor TO pgpool;
+ </programlisting>
+ <note>
+ <para>
+ If you plan to use <xref linkend="guc-detach-false-primary">(<productname>Pgpool-II</productname> 4.0 or later),
+ role "pgpool" needs to be <productname>PostgreSQL</productname> super user or
+ or in "pg_monitor" group to use this feature.
+ </para>
+ </note>
+ <para>
+ Assuming that all the <productname>Pgpool-II</productname> servers and the
+ <productname>PostgreSQL</productname> servers are in the same subnet and edit <filename>pg_hba.conf</filename> to
+ enable <literal>scram-sha-256</literal> authentication method.
+ </para>
+ <programlisting>
+host all all samenet scram-sha-256
+host replication all samenet scram-sha-256
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ To use the automated failover and online recovery of <productname>Pgpool-II</productname>,
+ the settings that allow <emphasis>passwordless</emphasis> SSH to all backend servers
+ between <productname>Pgpool-II</productname> execution user (default root user)
+ and <literal>postgres</literal> user and between <literal>postgres</literal> user
+ and <literal>postgres</literal> user are necessary. Execute the following command on all servers
+ to set up passwordless <literal>SSH</literal>. The generated key file name is <literal>id_rsa_pgpool</literal>.
+ </para>
+ <programlisting>
+[all servers]# cd ~/.ssh
+[all servers]# ssh-keygen -t rsa -f id_rsa_pgpool
+[all servers]# ssh-copy-id -i id_rsa_pgpool.pub postgres@server1
+[all servers]# ssh-copy-id -i id_rsa_pgpool.pub postgres@server2
+[all servers]# ssh-copy-id -i id_rsa_pgpool.pub postgres@server3
+
+[all servers]# su - postgres
+[all servers]$ cd ~/.ssh
+[all servers]$ ssh-keygen -t rsa -f id_rsa_pgpool
+[all servers]$ ssh-copy-id -i id_rsa_pgpool.pub postgres@server1
+[all servers]$ ssh-copy-id -i id_rsa_pgpool.pub postgres@server2
+[all servers]$ ssh-copy-id -i id_rsa_pgpool.pub postgres@server3
+ </programlisting>
+ <para>
+ After setting, use <command>ssh postgres@serverX -i ~/.ssh/id_rsa_pgpool</command> command to
+ make sure that you can log in without entering a password. Edit <filename>/etc/ssh/sshd_config</filename>
+ if necessary and restart sshd.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To allow <literal>repl</literal> user without specifying password for streaming
+ replication and online recovery, and execute <application>pg_rewind</application>
+ using <literal>postgres</literal>, we create the <filename>.pgpass</filename> file
+ in <literal>postgres</literal> user's home directory and change the permission to
+ <literal>600</literal> on each <productname>PostgreSQL</productname> server.
+ </para>
+ <programlisting>
+[all servers]# su - postgres
+[all servers]$ vi /var/lib/pgsql/.pgpass
+server1:5432:replication:repl:<repl user password>
+server2:5432:replication:repl:<repl user passowrd>
+server3:5432:replication:repl:<repl user passowrd>
+server1:5432:postgres:postgres:<postgres user passowrd>
+server2:5432:postgres:postgres:<postgres user passowrd>
+server3:5432:postgres:postgres:<postgres user passowrd>
+[all servers]$ chmod 600 /var/lib/pgsql/.pgpass
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ When connect to <productname>Pgpool-II</productname> and <productname>PostgreSQL</productname> servers, the target port must be accessible by enabling firewall management softwares. Following is an example for <systemitem>CentOS/RHEL7</systemitem>.
+ </para>
+ <programlisting>
+[all servers]# firewall-cmd --permanent --zone=public --add-service=postgresql
+[all servers]# firewall-cmd --permanent --zone=public --add-port=9999/tcp --add-port=9898/tcp --add-port=9000/tcp --add-port=9694/udp
+[all servers]# firewall-cmd --reload
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ We set <productname>Pgpool-II</productname> to start automatically on all servers.
+ </para>
+ <programlisting>
+[all servers]# systemctl enable pgpool.service
+ </programlisting>
+
+ <note>
+ <para>
+ If you set the auto-start of <productname>Pgpool-II</productname>, you need to change the <xref linkend="guc-search-primary-node-timeout"> to an appropriate value that you can start the <productname>PostgreSQL</productname> after the server has been started.
+ <productname>Pgpool-II</productname> will fail if it can't connect to the <productname>PostgreSQL</productname> on the backend during the <literal>search_primary_node_timeout</literal>.
+ </para>
+ </note>
+
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="example-cluster-pgpool-node-id">
+ <title>Create pgpool_node_id</title>
+ <para>
+ From <productname>Pgpool-II</productname> 4.2, now all configuration parameters are identical on all hosts.
+ If <literal>watchdog</literal> feature is enabled, to distinguish which host is which,
+ a <filename>pgpool_node_id</filename> file is required.
+ You need to create a <filename>pgpool_node_id</filename> file and specify the pgpool (watchdog) node number
+ (e.g. 0, 1, 2 ...) to identify pgpool (watchdog) host.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>server1</literal>
+ </para>
+ <programlisting>
+[server1]# cat /etc/pgpool-II/pgpool_node_id
+0
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>server2</literal>
+ </para>
+ <programlisting>
+[server2]# cat /etc/pgpool-II/pgpool_node_id
+1
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>server3</literal>
+ </para>
+ <programlisting>
+[server3]# cat /etc/pgpool-II/pgpool_node_id
+2
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="example-cluster-pgpool-config">
+ <title><productname>Pgpool-II</productname> Configuration</title>
+ <para>
+ Since from <productname>Pgpool-II</productname> 4.2, all configuration parameters are
+ identical on all hosts, you can edit <filename>pgpool.conf</filename> on any pgpool node
+ and copy the edited <filename>pgpool.conf</filename> file to the other pgpool nodes.
+ </para>
+
+ <sect3 id="example-cluster-pgpool-config-config-file">
+ <title>Clustering mode</title>
+ <para>
+ <productname>Pgpool-II</productname> has several clustering modes. To set the clustering
+ mode, <xref linkend="GUC-BACKEND-CLUSTERING-MODE"> can be used. In this configuration
+ example, streaming replication mode is used.
+ </para>
+ <para>
+ When installing <productname>Pgpool-II</productname> using RPM, all the
+ <productname>Pgpool-II</productname> configuration sample files are in <filename>/etc/pgpool-II</filename>.
+ In this example, we copy the sample configuration file for streaming replication mode.
+ </para>
+ <programlisting>
+# cp -p /etc/pgpool-II/pgpool.conf.sample-stream /etc/pgpool-II/pgpool.conf
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-listen-addresses">
+ <title>listen_addresses</title>
+ <para>
+ To allow Pgpool-II to accept all incoming connections, we set <varname>listen_addresses = '*'</varname>.
+ </para>
+ <programlisting>
+listen_addresses = '*'
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-port">
+ <title>port</title>
+ <para>
+ Specify the port number Pgpool-II listen on.
+ </para>
+ <programlisting>
+port = 9999
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-sr-check">
+ <title>Streaming Replication Check</title>
+ <para>
+ Specify replication delay check user and password in <xref linkend="GUC-SR-CHECK-USER">
+ and <xref linkend="GUC-SR-CHECK-PASSWORD">. In this example, we leave
+ <xref linkend="GUC-SR-CHECK-PASSWORD"> empty, and create the entry in
+ <xref linkend="GUC-POOL-PASSWD">. See <xref linkend="example-cluster-pgpool-config-auth">
+ for how to create the entry in <xref linkend="GUC-POOL-PASSWD">.
+ From <productname>Pgpool-II</productname> 4.0, if these parameters are left blank,
+ <productname>Pgpool-II</productname> will first try to get the password for that
+ specific user from <xref linkend="GUC-POOL-PASSWD"> file before using the empty password.
+ </para>
+ <programlisting>
+sr_check_user = 'pgpool'
+sr_check_password = ''
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-health-check">
+ <title>Health Check</title>
+ <para>
+ Enable health check so that <productname>Pgpool-II</> performs failover. Also, if the network is unstable,
+ the health check fails even though the backend is running properly, failover or degenerate operation may occur.
+ In order to prevent such incorrect detection of health check, we set <varname>health_check_max_retries = 3</varname>.
+ Specify <xref linkend="GUC-HEALTH-CHECK-USER"> and <xref linkend="GUC-HEALTH-CHECK-PASSWORD"> in
+ the same way like <xref linkend="GUC-SR-CHECK-USER"> and <xref linkend="GUC-SR-CHECK-PASSWORD">.
+ </para>
+ <programlisting>
+health_check_period = 5
+ # Health check period
+ # Disabled (0) by default
+health_check_timeout = 30
+ # Health check timeout
+ # 0 means no timeout
+health_check_user = 'pgpool'
+health_check_password = ''
+
+health_check_max_retries = 3
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-backend-settings">
+ <title>Backend Settings</title>
+ <para>
+ Specify the <productname>PostgreSQL</productname> backend information.
+ Multiple backends can be specified by adding a number at the end of the parameter name.
+ </para>
+ <programlisting>
+# - Backend Connection Settings -
+
+backend_hostname0 = 'server1'
+ # Host name or IP address to connect to for backend 0
+backend_port0 = 5432
+ # Port number for backend 0
+backend_weight0 = 1
+ # Weight for backend 0 (only in load balancing mode)
+backend_data_directory0 = '/var/lib/pgsql/13/data'
+ # Data directory for backend 0
+backend_flag0 = 'ALLOW_TO_FAILOVER'
+ # Controls various backend behavior
+ # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
+backend_hostname1 = 'server2'
+backend_port1 = 5432
+backend_weight1 = 1
+backend_data_directory1 = '/var/lib/pgsql/13/data'
+backend_flag1 = 'ALLOW_TO_FAILOVER'
+
+backend_hostname2 = 'server3'
+backend_port2 = 5432
+backend_weight2 = 1
+backend_data_directory2 = '/var/lib/pgsql/13/data'
+backend_flag2 = 'ALLOW_TO_FAILOVER'
+ </programlisting>
+ <para>
+ To show "replication_state" and "replication_sync_state" column in <xref linkend="SQL-SHOW-POOL-NODES">
+ command result, <xref linkend="GUC-BACKEND-APPLICATION-NAME"> parameter is required.
+ Here we specify each backend's hostname in these parameters. (<productname>Pgpool-II</productname> 4.1 or later)
+ </para>
+ <programlisting>
+...
+backend_application_name0 = 'server1'
+...
+backend_application_name1 = 'server2'
+...
+backend_application_name2 = 'server3'
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-failover">
+ <title>Failover configuration</title>
+ <para>
+ Specify failover.sh script to be executed after failover in <varname>failover_command</varname>
+ parameter.
+ If we use 3 PostgreSQL servers, we need to specify follow_primary_command to run after failover on the primary node failover.
+ In case of two PostgreSQL servers, follow_primary_command setting is not necessary.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> replaces the following special characters with the backend specific
+ information while executing the scripts.
+ See <xref linkend="GUC-FAILOVER-COMMAND"> for more details about each character.
+ </para>
+ <programlisting>
+failover_command = '/etc/pgpool-II/failover.sh %d %h %p %D %m %H %M %P %r %R %N %S'
+follow_primary_command = '/etc/pgpool-II/follow_primary.sh %d %h %p %D %m %H %M %P %r %R'
+ </programlisting>
+ <note>
+ <para>
+ <emphasis>%N</emphasis> and <emphasis>%S</emphasis> are added in <productname>Pgpool-II</productname> 4.1.
+ Please note that these characters cannot be specified if using Pgpool-II 4.0 or earlier.
+ </para>
+ </note>
+ <para>
+ Sample scripts <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/master">failover.sh</ulink>
+ and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/master">follow_primary.sh</ulink>
+ are installed in <filename>/etc/pgpool-II/</filename>. Create failover scripts using these sample files.
+ </para>
+ <programlisting>
+[all servers]# cp -p /etc/pgpool-II/failover.sh{.sample,}
+[all servers]# cp -p /etc/pgpool-II/follow_primary.sh{.sample,}
+[all servers]# chown postgres:postgres /etc/pgpool-II/{failover.sh,follow_primary.sh}
+ </programlisting>
+ <para>
+ Basically, it should work if you change <emphasis>PGHOME</emphasis> according to PostgreSQL installation directory.
+ </para>
+ <programlisting>
+[all servers]# vi /etc/pgpool-II/failover.sh
+...
+PGHOME=/usr/pgsql-13
+...
+
+[all servers]# vi /etc/pgpool-II/follow_primary.sh
+...
+PGHOME=/usr/pgsql-13
+...
+ </programlisting>
+
+ <para>
+ Since user authentication is required to use the <literal>PCP</literal> command in
+ <varname>follow_primary_command</varname> script,
+ we need to specify user name and md5 encrypted password in <filename>pcp.conf</filename>
+ in format "<literal>username:encrypted password</literal>".
+ </para>
+ <para>
+ if <literal>pgpool</literal> user is specified in <varname>PCP_USER</varname> in <filename>follow_primary.sh</filename>,
+ </para>
+ <programlisting>
+# cat /etc/pgpool-II/follow_primary.sh
+...
+PCP_USER=pgpool
+...
+ </programlisting>
+ <para>
+ then we use <xref linkend="PG-MD5"> to create the encrypted password entry for <literal>pgpool</literal> user as below:
+ </para>
+ <programlisting>
+[all servers]# echo 'pgpool:'`pg_md5 PCP password` >> /etc/pgpool-II/pcp.conf
+ </programlisting>
+ <para>
+ Since <filename>follow_primary.sh</filename> script must execute PCP command without entering a
+ password, we need to create <filename>.pcppass</filename> in the home directory of
+ <productname>Pgpool-II</productname> startup user (postgres user) on each server.
+ </para>
+ <programlisting>
+[all servers]# su - postgres
+[all servers]$ echo 'localhost:9898:pgpool:<pgpool user password>' > ~/.pcppass
+[all servers]$ chmod 600 ~/.pcppass
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-online-recovery">
+ <title>Pgpool-II Online Recovery Configurations</title>
+ <para>
+ Next, in order to perform online recovery with <productname>Pgpool-II</productname> we specify
+ the <productname>PostgreSQL</productname> user name and online recovery command
+ <command>recovery_1st_stage</command>.
+ Because <emphasis>Superuser</emphasis> privilege in <productname>PostgreSQL</productname>
+ is required for performing online recovery, we specify <literal>postgres</literal> user in <xref linkend="GUC-RECOVERY-USER">.
+ Then, we create <filename>recovery_1st_stage</filename> and <filename>pgpool_remote_start</filename>
+ in database cluster directory of <productname>PostgreSQL</productname> primary server (server1), and add execute permission.
+
+ </para>
+ <programlisting>
+recovery_user = 'postgres'
+ # Online recovery user
+recovery_password = ''
+ # Online recovery password
+
+recovery_1st_stage_command = 'recovery_1st_stage'
+ </programlisting>
+ <para>
+ Online recovery sample scripts<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/master">recovery_1st_stage</ulink>
+ and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/master">pgpool_remote_start</ulink>
+ are installed in <filename>/etc/pgpool-II/</filename>. Copy these files to the data directory of the primary server (server1).
+ </para>
+ <programlisting>
+[server1]# cp -p /etc/pgpool-II/recovery_1st_stage.sample /var/lib/pgsql/13/data/recovery_1st_stage
+[server1]# cp -p /etc/pgpool-II/pgpool_remote_start.sample /var/lib/pgsql/13/data/pgpool_remote_start
+[server1]# chown postgres:postgres /var/lib/pgsql/13/data/{recovery_1st_stage,pgpool_remote_start}
+ </programlisting>
+ <para>
+ Basically, it should work if you change <emphasis>PGHOME</emphasis> according to PostgreSQL installation directory.
+ </para>
+ <programlisting>
+[server1]# vi /var/lib/pgsql/13/data/recovery_1st_stage
+...
+PGHOME=/usr/pgsql-13
+...
+
+[server1]# vi /var/lib/pgsql/13/data/pgpool_remote_start
+...
+PGHOME=/usr/pgsql-13
+...
+ </programlisting>
+
+ <para>
+ In order to use the online recovery functionality, the functions of
+ <function>pgpool_recovery</function>, <function>pgpool_remote_start</function>,
+ <function>pgpool_switch_xlog</function> are required, so we need install
+ <function>pgpool_recovery</function> on template1 of <productname>PostgreSQL</productname> server
+ <literal>server1</literal>.
+ </para>
+ <programlisting>
+[server1]# su - postgres
+[server1]$ psql template1 -c "CREATE EXTENSION pgpool_recovery"
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-auth">
+ <title>Client Authentication Configuration</title>
+ <para>
+ Because in the section <link linkend="EXAMPLE-CLUSTER-PRE-SETUP">Before Starting</link>,
+ we already set <productname>PostgreSQL</productname> authentication method to
+ <acronym>scram-sha-256</acronym>, it is necessary to set a client authentication by
+ <productname>Pgpool-II</productname> to connect to backend nodes.
+ When installing with RPM, the <productname>Pgpool-II</productname> configuration file
+ <filename>pool_hba.conf</filename> is in <filename>/etc/pgpool-II</filename>.
+ By default, pool_hba authentication is disabled, set <varname>enable_pool_hba = on</varname>
+ to enable it.
+ </para>
+ <programlisting>
+enable_pool_hba = on
+ </programlisting>
+ <para>
+ The format of <filename>pool_hba.conf</filename> file follows very closely PostgreSQL's
+ <filename>pg_hba.conf</filename> format. Set <literal>pgpool</literal> and <literal>postgres</literal> user's authentication method to <literal>scram-sha-256</literal>.
+ </para>
+ <programlisting>
+host all pgpool 0.0.0.0/0 scram-sha-256
+host all postgres 0.0.0.0/0 scram-sha-256
+ </programlisting>
+ <note>
+ <para>
+ Please note that in <productname>Pgpool-II</productname> 4.0 only AES encrypted password or clear text password
+ can be specified in <xref linkend="guc-health-check-password">, <xref linkend="guc-sr-check-password">,
+ <xref linkend="guc-wd-lifecheck-password">, <xref linkend="guc-recovery-password"> in <filename>pgpool.conf</filename>.
+ </para>
+ </note>
+ <para>
+ The default password file name for authentication is <xref linkend="GUC-POOL-PASSWD">.
+ To use <literal>scram-sha-256</literal> authentication, the decryption key to decrypt the passwords
+ is required. We create the <literal>.pgpoolkey</literal> file in <productname>Pgpool-II</productname>
+ start user <literal>postgres</literal>'s (<productname>Pgpool-II</productname> 4.1 or later) home directory.
+ (<productname>Pgpool-II</productname> 4.0 or before, by default <productname>Pgpool-II</productname>
+ is started as <literal>root</literal>)
+ <programlisting>
+[all servers]# su - postgres
+[all servers]$ echo 'some string' > ~/.pgpoolkey
+[all servers]$ chmod 600 ~/.pgpoolkey
+ </programlisting>
+ </para>
+ <para>
+ Execute command <command>pg_enc -m -k /path/to/.pgpoolkey -u username -p</command> to register user
+ name and <literal>AES</literal> encrypted password in file <filename>pool_passwd</filename>.
+ If <filename>pool_passwd</filename> doesn't exist yet, it will be created in the same directory as
+ <filename>pgpool.conf</filename>.
+ </para>
+ <programlisting>
+[all servers]# su - postgres
+[all servers]$ pg_enc -m -k ~/.pgpoolkey -u pgpool -p
+db password: [pgpool user's password]
+[all servers]$ pg_enc -m -k ~/.pgpoolkey -u postgres -p
+db password: [postgres user's password]
+
+# cat /etc/pgpool-II/pool_passwd
+pgpool:AESheq2ZMZjynddMWk5sKP/Rw==
+postgres:AESHs/pWL5rtXy2IwuzroHfqg==
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-watchdog">
+ <title>Watchdog Configuration</title>
+ <para>
+ Enable watchdog functionality on <literal>server1</literal>, <literal>server2</literal>, <literal>server3</literal>.
+ </para>
+ <programlisting>
+use_watchdog = on
+ </programlisting>
+ <para>
+ Specify virtual IP address that accepts connections from clients on
+ <literal>server1</literal>, <literal>server2</literal>, <literal>server3</literal>.
+ Ensure that the IP address set to virtual IP isn't used yet.
+ </para>
+ <programlisting>
+delegate_IP = '192.168.137.150'
+ </programlisting>
+
+ <para>
+ To bring up/down the virtual IP and send the ARP requests, we set <xref linkend="GUC-IF-UP-CMD">, <xref linkend="GUC-IF-DOWN-CMD"> and <xref linkend="GUC-ARPING-CMD">.
+ The network interface used in this example is "enp0s8".
+ Since root privilege is required to execute <varname>if_up/down_cmd</varname> or
+ <varname>arping_cmd</varname> command, use setuid on these command or allow
+ <productname>Pgpool-II</productname> startup user, <literal>postgres</literal> user (Pgpool-II 4.1 or later) to run <command>sudo</command> command without a password.
+ </para>
+ <note>
+ <para>
+ If <productname>Pgpool-II</productname> is installed using RPM, the <literal>postgres</literal>
+ user has been configured to run <command>ip/arping</command> via <command>sudo</command> without
+ a password.
+ <programlisting>
+postgres ALL=NOPASSWD: /sbin/ip
+postgres ALL=NOPASSWD: /usr/sbin/arping
+ </programlisting>
+ </para>
+ </note>
+ <para>
+ Here we configure the following parameters to run <varname>if_up/down_cmd</varname> or <varname>arping_cmd</varname> with sudo.
+ </para>
+ <programlisting>
+if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev enp0s8 label enp0s8:0'
+if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev enp0s8'
+arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I enp0s8'
+ </programlisting>
+ <note>
+ <para>
+ If "Defaults requiretty" is set in the <filename>/etc/sudoers</filename>,
+ please ensure that the <productname>pgpool</productname> startup user can execute the <command>if_up_cmd</command>, <command>if_down_cmd</command> and <command>arping_cmd</command> command without a tty.
+ </para>
+ </note>
+ <para>
+ Set <xref linkend="GUC-IF-CMD-PATH"> and <xref linkend="GUC-ARPING-PATH"> according to the
+ command path.
+ If <varname>if_up/down_cmd</varname> or <varname>arping_cmd</varname> starts with "/", these parameters will be ignored.
+ </para>
+ <programlisting>
+if_cmd_path = '/sbin'
+arping_path = '/usr/sbin'
+ </programlisting>
+ <para>
+ Specify all <productname>Pgpool-II</productname> nodes information for configuring watchdog.
+ Specify <varname>pgpool_portX</varname> using the port number specified in <varname>port</varname> in
+ <xref linkend="example-cluster-pgpool-config-port">.
+ </para>
+ <programlisting>
+hostname0 = 'server1'
+ # Host name or IP address of pgpool node
+ # for watchdog connection
+ # (change requires restart)
+wd_port0 = 9000
+ # Port number for watchdog service
+ # (change requires restart)
+pgpool_port0 = 9999
+ # Port number for pgpool
+ # (change requires restart)
+
+hostname1 = 'server2'
+wd_port1 = 9000
+pgpool_port1 = 9999
+
+hostname2 = 'server3'
+wd_port2 = 9000
+pgpool_port2 = 9999
+ </programlisting>
+ <para>
+ Specify the method of lifecheck <xref linkend="guc-wd-lifecheck-method">
+ and the lifecheck interval <xref linkend="guc-wd-interval">.
+ Here, we use <literal>heartbeat</literal> method to perform watchdog lifecheck.
+ </para>
+ <programlisting>
+wd_lifecheck_method = 'heartbeat'
+ # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external')
+ # (change requires restart)
+wd_interval = 10
+ # lifecheck interval (sec) > 0
+ # (change requires restart)
+ </programlisting>
+ <para>
+ Specify all <productname>Pgpool-II</productname> nodes information for sending and receiving heartbeat signal.
+ </para>
+ <programlisting>
+heartbeat_hostname0 = 'server1'
+ # Host name or IP address used
+ # for sending heartbeat signal.
+ # (change requires restart)
+heartbeat_port0 = 9694
+ # Port number used for receiving/sending heartbeat signal
+ # Usually this is the same as heartbeat_portX.
+ # (change requires restart)
+heartbeat_device0 = ''
+ # Name of NIC device (such like 'eth0')
+ # used for sending/receiving heartbeat
+ # signal to/from destination 0.
+ # This works only when this is not empty
+ # and pgpool has root privilege.
+ # (change requires restart)
+
+heartbeat_hostname1 = 'server2'
+heartbeat_port1 = 9694
+heartbeat_device1 = ''
+heartbeat_hostname2 = 'server3'
+heartbeat_port2 = 9694
+heartbeat_device2 = ''
+ </programlisting>
+ <para>
+ If the <xref linkend="guc-wd-lifecheck-method"> is set to <literal>heartbeat</literal>,
+ specify the time to detect a fault <xref linkend="guc-wd-heartbeat-deadtime"> and
+ the interval to send heartbeat signals <xref linkend="guc-wd-heartbeat-deadtime">.
+ </para>
+ <programlisting>
+wd_heartbeat_keepalive = 2
+ # Interval time of sending heartbeat signal (sec)
+ # (change requires restart)
+wd_heartbeat_deadtime = 30
+ # Deadtime interval for heartbeat signal (sec)
+ # (change requires restart)
+ </programlisting>
+
+ <para>
+ When <literal>Watchdog</literal> process is abnormally terminated, the virtual IP may be "up" on both of the old and new active pgpool nodes.
+ To prevent this, configure <xref linkend="guc-wd-escalation-command"> to bring down the virtual IP on other pgpool nodes before bringing up the virtual IP on the new active pgpool node.
+ </para>
+ <programlisting>
+wd_escalation_command = '/etc/pgpool-II/escalation.sh'
+ # Executes this command at escalation on new active pgpool.
+ # (change requires restart)
+ </programlisting>
+ <para>
+ The sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/master">escalation.sh</ulink> is installed in <filename>/etc/pgpool-II/</filename>.
+ </para>
+ <programlisting>
+[all servers]# cp -p /etc/pgpool-II/escalation.sh{.sample,}
+[all servers]# chown postgres:postgres /etc/pgpool-II/escalation.sh
+ </programlisting>
+
+ <para>
+ Basically, it should work if you change the following variables according to your environment.
+ PGPOOL is tha array of the hostname that running Pgpool-II.
+ VIP is the virtual IP address that you set as delegate_IP.
+ DEVICE is the network interface for the virtual IP.
+ </para>
+ <programlisting>
+[all servers]# vi /etc/pgpool-II/escalation.sh
+...
+PGPOOLS=(server1 server2 server3)
+VIP=192.168.137.150
+DEVICE=enp0s8
+...
+ </programlisting>
+
+ <note>
+ <para>
+ If you have even number of watchdog nodes, you need to turn on <xref linkend="guc-enable-consensus-with-half-votes"> parameter.
+ </para>
+ </note>
+ <note>
+ <para>
+ If use_watchdog = on, please make sure the pgpool node number is specified
+ in <filename>pgpool_node_id</filename> file.
+ See <xref linkend="example-cluster-pgpool-node-id"> for details.
+ </para>
+ </note>
+ </sect3>
+
+ <sect3 id="example-cluster-pgpool-config-log">
+ <title>Logging</title>
+ <para>
+ Since Pgpool-II 4.2, the logging collector process has been implemented.
+ In the example, we enable logging collector.
+ </para>
+ <programlisting>
+log_destination = 'stderr'
+logging_collector = on
+log_directory = '/var/log/pgpool_log'
+log_filename = 'pgpool-%Y-%m-%d_%H%M%S.log'
+log_truncate_on_rotation = on
+log_rotation_age = 1d
+log_rotation_size = 10MB
+ </programlisting>
+ <para>
+ Create the log directory on all servers.
+ </para>
+ <programlisting>
+[all servers]# mkdir /var/log/pgpool_log/
+[all servers]# chown postgres:postgres /var/log/pgpool_log/
+ </programlisting>
+
+ <para>
+ The configuration of <filename>pgpool.conf</filename> on server1 is completed. Copy the <filename>pgpool.conf</filename>
+ to other <productname>Pgpool-II</productname> nodes (server2 and server3).
+ </para>
+ <programlisting>
+[server1]# scp -p /etc/pgpool-II/pgpool.conf root@server2:/etc/pgpool-II/pgpool.conf
+[server1]# scp -p /etc/pgpool-II/pgpool.conf root@server3:/etc/pgpool-II/pgpool.conf
+ </programlisting>
+ </sect3>
+ </sect2>
+
+ <sect2 id="example-cluster-pgpool-config-sysconfig">
+ <title>/etc/sysconfig/pgpool Configuration</title>
+ <para>
+ When starting <productname>Pgpool-II</productname>, if the <filename>pgpool_status</filename>
+ file exists, <productname>Pgpool-II</productname> will read the backend status (up/down) from the
+ <filename>pgpool_status</filename> file.
+ </para>
+ <para>
+ If you want to ignore the <filename>pgpool_status</filename> file at startup of
+ <productname>Pgpool-II</productname>, add "- D" to the start option OPTS to
+ <filename>/etc/sysconfig/pgpool</filename>.
+ </para>
+ <programlisting>
+[all servers]# vi /etc/sysconfig/pgpool
+...
+OPTS=" -D -n"
+ </programlisting>
+ </sect2>
+
+ <sect2 id="example-cluster-start-stop">
+ <title>Starting/Stopping Pgpool-II</title>
+ <para>
+ Next we start <productname>Pgpool-II</productname>. Before starting
+ <productname>Pgpool-II</productname>, please start
+ <productname>PostgreSQL</productname> servers first.
+ Also, when stopping <productname>PostgreSQL</productname>, it is necessary to
+ stop Pgpool-II first.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Starting <productname>Pgpool-II</productname>
+ </para>
+ <para>
+ In section <link linkend="EXAMPLE-CLUSTER-PRE-SETUP">Before Starting</link>,
+ we already set the auto-start of <productname>Pgpool-II</productname>. To start
+ <productname>Pgpool-II</productname>, restart the whole system or execute the following command.
+ </para>
+ <programlisting>
+# systemctl start pgpool.service
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Stopping <productname>Pgpool-II</productname>
+ </para>
+ <programlisting>
+# systemctl stop pgpool.service
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="example-cluster-try">
+ <title>How to use</title>
+ <para>
+ Let's start to use <productname>Pgpool-II</productname>.
+ First, let's start <productname>Pgpool-II</productname> on <literal>server1</literal>,
+ <literal>server2</literal>, <literal>server3</literal> by using the following command.
+ </para>
+ <programlisting>
+# systemctl start pgpool.service
+ </programlisting>
+
+ <sect3 id="example-cluster-try-standby">
+ <title>Set up PostgreSQL standby server</title>
+ <para>
+ First, we should set up <productname>PostgreSQL</productname> standby server by
+ using <productname>Pgpool-II</productname> online recovery functionality. Ensure
+ that <filename>recovery_1st_stage</filename> and <filename>pgpool_remote_start</filename>
+ scripts used by <command>pcp_recovery_node</command> command are in database
+ cluster directory of <productname>PostgreSQL</productname> primary server (<literal>server1</literal>).
+ </para>
+ <programlisting>
+# pcp_recovery_node -h 192.168.137.150 -p 9898 -U pgpool -n 1
+Password:
+pcp_recovery_node -- Command Successful
+
+# pcp_recovery_node -h 192.168.137.150 -p 9898 -U pgpool -n 2
+Password:
+pcp_recovery_node -- Command Successful
+ </programlisting>
+ <para>
+ After executing <command>pcp_recovery_node</command> command,
+ verify that <literal>server2</literal> and <literal>server3</literal>
+ are started as <productname>PostgreSQL</productname> standby server.
+ </para>
+ <programlisting>
+# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
+Password for user pgpool
+node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+0 | server1 | 5432 | up | 0.333333 | primary | 0 | false | 0 | | | 2019-08-06 11:13:17
+1 | server2 | 5432 | up | 0.333333 | standby | 0 | true | 0 | streaming | async | 2019-08-06 11:13:25
+2 | server3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:14:20
+(3 rows)
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-try-watchdog">
+ <title>Switching active/standby watchdog</title>
+ <para>
+ Confirm the watchdog status by using <command>pcp_watchdog_info</command>. The <command>Pgpool-II</command> server which is started first run as <literal>LEADER</literal>.
+ </para>
+ <programlisting>
+# pcp_watchdog_info -h 192.168.137.150 -p 9898 -U pgpool
+Password:
+3 YES server1:9999 Linux server1 server1
+
+server1:9999 Linux server1 server1 9999 9000 4 LEADER #The Pgpool-II server started first became "LEADER".
+server2:9999 Linux server2 server2 9999 9000 7 STANDBY #run as standby
+server3:9999 Linux server3 server3 9999 9000 7 STANDBY #run as standby
+ </programlisting>
+ <para>
+ Stop active server <literal>server1</literal>, then <literal>server2</literal> or
+ <literal>server3</literal> will be promoted to active server. To stop
+ <literal>server1</literal>, we can stop <productname>Pgpool-II</productname>
+ service or shutdown the whole system. Here, we stop <productname>Pgpool-II</productname> service.
+ </para>
+ <programlisting>
+[server1]# systemctl stop pgpool.service
+
+# pcp_watchdog_info -p 9898 -h 192.168.137.150 -U pgpool
+Password:
+3 YES server2:9999 Linux server2 server2
+
+server2:9999 Linux server2 server2 9999 9000 4 LEADER #server2 is promoted to LEADER
+server1:9999 Linux server1 server1 9999 9000 10 SHUTDOWN #server1 is stopped
+server3:9999 Linux server3 server3 9999 9000 7 STANDBY #server3 runs as STANDBY
+ </programlisting>
+ <para>
+ Start <productname>Pgpool-II</productname> (<literal>server1</literal>) which we have stopped again,
+ and verify that <literal>server1</literal> runs as a standby.
+ </para>
+ <programlisting>
+[server1]# systemctl start pgpool.service
+
+[server1]# pcp_watchdog_info -p 9898 -h 192.168.137.150 -U pgpool
+Password:
+3 YES server2:9999 Linux server2 server2
+
+server2:9999 Linux server2 server2 9999 9000 4 LEADER
+server1:9999 Linux server1 server1 9999 9000 7 STANDBY
+server3:9999 Linux server3 server3 9999 9000 7 STANDBY
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-try-failover">
+ <title>Failover</title>
+ <para>
+ First, use <command>psql</command> to connect to <productname>PostgreSQL</productname> via virtual IP,
+ and verify the backend information.
+ </para>
+ <programlisting>
+# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
+Password for user pgpool:
+node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+0 | server1 | 5432 | up | 0.333333 | primary | 0 | false | 0 | | | 2019-08-06 11:13:17
+1 | server2 | 5432 | up | 0.333333 | standby | 0 | true | 0 | streaming | async | 2019-08-06 11:13:25
+2 | server3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:14:20
+(3 rows)
+ </programlisting>
+ <para>
+ Next, stop primary <productname>PostgreSQL</productname> server
+ <literal>server1</literal>, and verify automatic failover.
+ </para>
+ <programlisting>
+[server1]$ pg_ctl -D /var/lib/pgsql/13/data -m immediate stop
+ </programlisting>
+ <para>
+ After stopping <productname>PostgreSQL</productname> on <literal>server1</literal>,
+ failover occurs and <productname>PostgreSQL</productname> on
+ <literal>server2</literal> becomes new primary DB.
+ </para>
+ <programlisting>
+# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
+Password for user pgpool:
+node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+0 | server1 | 5432 | down | 0.333333 | standby | 0 | false | 0 | | | 2019-08-06 11:36:03
+1 | server2 | 5432 | up | 0.333333 | primary | 0 | true | 0 | | | 2019-08-06 11:36:03
+2 | server3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:36:15
+(3 rows)
+ </programlisting>
+ <para>
+ <literal>server3</literal> is running as standby of new primary <literal>server2</literal>.
+ </para>
+
+ <programlisting>
+[server3]# psql -h server3 -p 5432 -U pgpool postgres -c "select pg_is_in_recovery()"
+pg_is_in_recovery
+-------------------
+t
+
+[server2]# psql -h server2 -p 5432 -U pgpool postgres -c "select pg_is_in_recovery()"
+pg_is_in_recovery
+-------------------
+f
+
+[server2]# psql -h server2 -p 5432 -U pgpool postgres -c "select * from pg_stat_replication" -x
+-[ RECORD 1 ]----+------------------------------
+pid | 11059
+usesysid | 16392
+usename | repl
+application_name | server3
+client_addr | 192.168.137.103
+client_hostname |
+client_port | 48694
+backend_start | 2019-08-06 11:36:07.479161+09
+backend_xmin |
+state | streaming
+sent_lsn | 0/75000148
+write_lsn | 0/75000148
+flush_lsn | 0/75000148
+replay_lsn | 0/75000148
+write_lag |
+flush_lag |
+replay_lag |
+sync_priority | 0
+sync_state | async
+reply_time | 2019-08-06 11:42:59.823961+09
+ </programlisting>
+ </sect3>
+
+ <sect3 id="example-cluster-try-online-recovery">
+ <title>Online Recovery</title>
+ <para>
+ Here, we use <productname>Pgpool-II</productname> online recovery functionality to
+ restore <literal>server1</literal> (old primary server) as a standby. Before
+ restoring the old primary server, please ensure that
+ <filename>recovery_1st_stage</filename> and <filename>pgpool_remote_start</filename> scripts
+ exist in database cluster directory of current primary server <literal>server2</literal>.
+ </para>
+ <programlisting>
+# pcp_recovery_node -h 192.168.137.150 -p 9898 -U pgpool -n 0
+Password:
+pcp_recovery_node -- Command Successful
+ </programlisting>
+ <para>
+ Then verify that <literal>server1</literal> is started as a standby.
+ </para>
+ <programlisting>
+# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
+Password for user pgpool:
+node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+0 | server1 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:48:05
+1 | server2 | 5432 | up | 0.333333 | primary | 0 | false | 0 | | | 2019-08-06 11:36:03
+2 | server3 | 5432 | up | 0.333333 | standby | 0 | true | 0 | streaming | async | 2019-08-06 11:36:15
+(3 rows)
+ </programlisting>
+ </sect3>
+ </sect2>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/examples.sgml -->
+
+<part id="examples">
+ <title>Examples</title>
+
+ <partintro>
+ <para>
+ Various examples
+ </para>
+ </partintro>
+
+ <chapter id="example-configs">
+ <title>Configuration Examples</title>
+ &example-basic;
+ &example-cluster;
+ &example-AWS;
+ &example-Aurora;
+ &example-Kubernetes;
+ </chapter>
+</part>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-config-failover">
+ <title>Failover and Failback</title>
+
+ <para>
+ <emphasis>Failover</emphasis> means automatically detaching
+ <productname>PostgreSQL</productname>backend node which is not
+ accessible by <productname>Pgpool-II</productname>. This happens
+ automatically regardless the configuration parameter settings and is
+ so called <emphasis>automatic failover</emphasis>
+ process. <productname>Pgpool-II</productname> confirms the
+ inaccessibility of <productname>PostgreSQL</productname> backend node
+ by using following methods:
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Regular health check process
+ (see <xref linkend="runtime-config-health-check"> for more
+ details). The heath check process tries to connect
+ from <productname>Pgpool-II</productname>
+ to <productname>PostgreSQL</productname> node to confirm
+ its healthiness. If it fails to connect, it is possible
+ that there's something wrong with network connection
+ between <productname>Pgpool-II</productname>
+ and <productname>PostgreSQL</productname>,
+ and/or <productname>PostgreSQL</productname> does not work
+ properly. <productname>Pgpool-II</productname> does not
+ distinguish each case and just decides that the
+ particular <productname>PostgreSQL</productname> node is
+ not available if health check fails.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ An error occurs while connecting
+ to <productname>PostgreSQL</productname>, or network level
+ errors occur while communicating with it.
+ <productname>Pgpool-II</productname> will just disconnect
+ the session to client
+ if <xref linkend="guc-failover-on-backend-error"> is off in
+ that case However.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ In the case When clients already connect
+ to <productname>Pgpool-II</productname>
+ and <productname>PostgreSQL</productname> is shutdown
+ (please note that if no client connects
+ to <productname>Pgpool-II</productname> at all, shutting
+ down of <productname>PostgreSQL</productname> does not
+ trigger a failover).
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </para>
+
+ <para>
+ If <xref linkend="guc-failover-command"> is configured and a
+ failover happens, <xref linkend="guc-failover-command"> gets
+ executed. <xref linkend="guc-failover-command"> should be provided
+ by user. From 4.1 an example script for failover command is provided
+ as <filename>failover.sh.sample</filename> which can be a good
+ starting point for you.
+ </para>
+ <para>
+ The major role of failover command is choosing new primary server
+ from existing standby servers and promoting it for example. Another
+ example would be let the administrator know that a failover happens
+ by sending a mail.
+ </para>
+
+ <para>
+ While a failover could happen when a failure occurs, it is
+ possible to trigger it by hand. This is called a <emphasis>switch
+ over</emphasis>. For instance, switching over
+ a <productname>PostgreSQL</productname> to take its backup would
+ be possible. Note that switching over just sets the status to
+ down and never bringing <productname>PostgreSQL</productname>
+ down. A switch over can be triggered by
+ using <xref linkend="PCP-DETACH-NODE"> command.
+ </para>
+
+ <para>
+ A <productname>PostgreSQL</productname> node detached by failover or
+ switch over will never return to the previous state (attached state)
+ automatically in the default setting. Restarting
+ <productname>Pgpool-II</productname> with -D option or running <xref
+ linkend="PCP-ATTACH-NODE"> makes it to the attached state again. It
+ is recommended to confirm the replication_state of <xref
+ linkend="SQL-SHOW-POOL-NODES"> is "streaming" before doing that. The
+ state indicates that the standby server is properly connected to the
+ primary server through streaming replication and both databases are
+ in sync.
+ </para>
+ <para>
+ From 4.1 a new parameter <xref linkend="guc-auto-failback"> can be
+ used to do above automatically. See <xref
+ linkend="guc-auto-failback"> for more details.
+ </para>
+
+ <sect2 id="runtime-config-failover-settings">
+
+ <title>Failover and Failback Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-failover-command" xreflabel="failover_command">
+ <term><varname>failover_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>failover_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a user command to run when a <productname>PostgreSQL</> backend node gets detached.
+ <productname>Pgpool-II</productname> replaces the following special characters
+ with the backend specific information.
+ </para>
+
+ <table id="failover-command-table">
+ <title>failover command options</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Special character</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>%d</entry>
+ <entry>DB node ID of the detached node</entry>
+ </row>
+ <row>
+ <entry>%h</entry>
+ <entry>Hostname of the detached node</entry>
+ </row>
+ <row>
+ <entry>%p</entry>
+ <entry>Port number of the detached node</entry>
+ </row>
+ <row>
+ <entry>%D</entry>
+ <entry>Database cluster directory of the detached node</entry>
+ </row>
+ <row>
+ <entry>%m</entry>
+ <entry>New main node ID</entry>
+ </row>
+ <row>
+ <entry>%H</entry>
+ <entry>Hostname of the new main node</entry>
+ </row>
+ <row>
+ <entry>%M</entry>
+ <entry>Old main node ID</entry>
+ </row>
+ <row>
+ <entry>%P</entry>
+ <entry>Old primary node ID</entry>
+ </row>
+ <row>
+ <entry>%r</entry>
+ <entry>Port number of the new main node</entry>
+ </row>
+ <row>
+ <entry>%R</entry>
+ <entry>Database cluster directory of the new main node</entry>
+ </row>
+ <row>
+ <entry>%N</entry>
+ <entry>Hostname of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
+ </row>
+ <row>
+ <entry>%S</entry>
+ <entry>Port number of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
+ </row>
+ <row>
+ <entry>%%</entry>
+ <entry>'%' character</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>
+ The "main node" refers to a node which has the
+ "youngest (or the smallest) node id" among live the
+ database nodes. In <link linkend="running-mode">streaming
+ replication mode</link>, this may be different from
+ primary node. In <xref linkend="failover-command-table">,
+ %m is the new main node chosen
+ by <productname>Pgpool-II</productname>. It is the node
+ being assigned the youngest (smallest) node id which is
+ alive. For example if you have 3 nodes, namely node 0, 1,
+ 2. Suppose node 1 the primary and all of them are healthy
+ (no down node). If node 1 fails, failover_command is
+ called with %m = 0. And, if all standby nodes are down and primary node
+ failover happens, failover_command is called with %m = -1 and %H,%R,$r = "".
+ </para>
+ </note>
+
+ <note>
+ <para>
+ When a failover is performed,
+ basically <productname>Pgpool-II</productname> kills all
+ its child processes, which will in turn terminate all the
+ active sessions to
+ <productname>Pgpool-II</productname>. After that <productname>Pgpool-II</productname>
+ invokes the <command>failover_command</command> and after the command completion
+ <productname>Pgpool-II</productname> starts new child processes
+ which makes it ready again to accept client connections.
+ </para>
+ <para>
+ However from <productname>Pgpool-II</productname> 3.6, in the
+ steaming replication mode, client sessions will not be
+ disconnected any more when a failover occurs if the session
+ does not use the failed standby server. Please note that if a
+ query is sent while failover is processing, the session will be
+ disconnected. If the primary server goes down, still all
+ sessions will be disconnected. Health check timeout case will
+ also cause the full session disconnection. Other health check
+ error, including retry over case does not trigger full session
+ disconnection.
+ </para>
+ </note>
+
+ <note>
+ <para>
+ You can run <command>psql</command> (or whatever command)
+ against backend to retrieve some information in the
+ script, but you cannot run <command>psql</command> against
+ <productname>Pgpool-II</productname> itself, since the
+ script is called from <productname>Pgpool-II</productname>
+ and it needs to run
+ while <productname>Pgpool-II</productname> is working on
+ failover.
+ </para>
+ </note>
+
+ <para>
+ A complete failover_command example can be found
+ in <xref linkend="example-cluster">.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-failback-command" xreflabel="failback_command">
+ <term><varname>failback_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>failback_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a user command to run when a <productname>PostgreSQL</> backend node gets attached to
+ <productname>Pgpool-II</productname>. <productname>Pgpool-II</productname>
+ replaces the following special characters with the backend specific information.
+ before executing the command.
+ </para>
+
+ <table id="failback-command-table">
+ <title>failback command options</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Special character</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>%d</entry>
+ <entry>DB node ID of the attached node</entry>
+ </row>
+ <row>
+ <entry>%h</entry>
+ <entry>Hostname of the attached node</entry>
+ </row>
+ <row>
+ <entry>%p</entry>
+ <entry>Port number of the attached node</entry>
+ </row>
+ <row>
+ <entry>%D</entry>
+ <entry>Database cluster directory of the attached node</entry>
+ </row>
+ <row>
+ <entry>%M</entry>
+ <entry>Old main node ID</entry>
+ </row>
+ <row>
+ <entry>%m</entry>
+ <entry>New main node ID</entry>
+ </row>
+ <row>
+ <entry>%H</entry>
+ <entry>Hostname of the new main node</entry>
+ </row>
+ <row>
+ <entry>%P</entry>
+ <entry>Old primary node ID</entry>
+ </row>
+ <row>
+ <entry>%r</entry>
+ <entry>Port number of the new main node</entry>
+ </row>
+ <row>
+ <entry>%R</entry>
+ <entry>Database cluster directory of the new main node</entry>
+ </row>
+ <row>
+ <entry>%N</entry>
+ <entry>Hostname of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
+ </row>
+ <row>
+ <entry>%S</entry>
+ <entry>Port number of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
+ </row>
+ <row>
+ <entry>%%</entry>
+ <entry>'%' character</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>
+ You can run <command>psql</command> (or whatever command)
+ against backend to retrieve some information in the
+ script, but you cannot run <command>psql</command> against
+ <productname>Pgpool-II</productname> itself, since the
+ script is called from <productname>Pgpool-II</productname>
+ and it needs to run
+ while <productname>Pgpool-II</productname> is working on
+ failover.
+ </para>
+ </note>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-follow-primary-command" xreflabel="follow_primary_command">
+ <term><varname>follow_primary_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>follow_primary_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies a user command to run after failover on the
+ primary node failover. In case of standby node failover, the
+ command will not be executed. This command also runs if a
+ node promote request is issued by
+ <xref linkend="PCP-PROMOTE-NODE"> command. This works only
+ in streaming replication mode.
+ </para>
+
+ <para>
+ Since the command is executed within a child process forked
+ off by <productname>Pgpool-II</productname> after failover
+ is completed, execution of follow primary command does not
+ block the service
+ of <productname>Pgpool-II</productname>. Here is a pseud
+ code to illustrate how the command is executed:
+ <programlisting>
+for each backend node
+{
+ if (the node is not the new primary)
+ set down node status to shared memory status
+ memorize that follow primary command is needed to execute
+}
+if (we need to executed follow primary command)
+{
+ fork a child process
+ (within the child process)
+
+ for each backend node
+ {
+ if (the node status in shared memory is down)
+ execute follow primary command
+ }
+}
+ </programlisting>
+ </para>
+
+ <para>
+ <productname>Pgpool-II</productname> replaces the following special characters
+ with the backend specific information before executing the command.
+ </para>
+
+ <table id="follow-primary-command-table">
+ <title>follow primary command options</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Special character</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>%d</entry>
+ <entry>DB node ID of the detached node</entry>
+ </row>
+ <row>
+ <entry>%h</entry>
+ <entry>Hostname of the detached node</entry>
+ </row>
+ <row>
+ <entry>%p</entry>
+ <entry>Port number of the detached node</entry>
+ </row>
+ <row>
+ <entry>%D</entry>
+ <entry>Database cluster directory of the detached node</entry>
+ </row>
+ <row>
+ <entry>%m</entry>
+ <entry>New primary node ID</entry>
+ </row>
+ <row>
+ <entry>%H</entry>
+ <entry>Hostname of the new primary node</entry>
+ </row>
+ <row>
+ <entry>%M</entry>
+ <entry>Old main node ID</entry>
+ </row>
+ <row>
+ <entry>%P</entry>
+ <entry>Old primary node ID</entry>
+ </row>
+ <row>
+ <entry>%r</entry>
+ <entry>Port number of the new primary node</entry>
+ </row>
+ <row>
+ <entry>%R</entry>
+ <entry>Database cluster directory of the new primary node</entry>
+ </row>
+ <row>
+ <entry>%N</entry>
+ <entry>Hostname of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
+ </row>
+ <row>
+ <entry>%S</entry>
+ <entry>Port number of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
+ </row>
+ <row>
+ <entry>%%</entry>
+ <entry>'%' character</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>
+ If <varname>follow_primary_command</varname> is not empty, then after failover
+ on the primary node gets completed in Native Replication mode with streaming replication,
+ <productname>Pgpool-II</productname> degenerates all nodes except the new primary
+ and starts new child processes to be ready again to accept connections from the clients.
+ After this, <productname>Pgpool-II</productname> executes the command configured
+ in the <varname>follow_primary_command</varname> for each degenerated backend nodes.
+ </para>
+ </note>
+ <para>
+ Typically <varname>follow_primary_command</varname> command
+ is used to recover the standby from the new primary by calling
+ the pcp_recovery_node command. In
+ the <varname>follow_primary_command</varname>, it is
+ recommended to check whether
+ target <productname>PostgreSQL</productname> node is running
+ or not using pg_ctl since already stopped node usually has a
+ reason to be stopped: for example, it's broken by hardware
+ problems or administrator is maintaining the node. If the
+ node is stopped, skip the node. If the node is running, stop
+ the node first and recovery it. A
+ complete <varname>follow_primary_command</varname> example
+ can be found in <xref linkend="example-cluster">.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-failover-on-backend-error" xreflabel="failover_on_backend_error">
+ <term><varname>failover_on_backend_error</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>failover_on_backend_error</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> considers the reading/writing
+ errors on the PostgreSQL backend connection as the backend node failure and trigger the
+ failover on that node after disconnecting the current session.
+ When this is set to off, <productname>Pgpool-II</productname> only report an error
+ and disconnect the session in case of such errors.
+ </para>
+ <note>
+ <para>
+ It is recommended to turn on the backend health checking
+ (see <xref linkend="runtime-config-health-check">)
+ when <varname>failover_on_backend_error</varname> is set to off.
+ Note, however, that <productname>Pgpool-II</productname> still triggers the
+ failover when it detects the administrative shutdown of
+ <productname>PostgreSQL</> backend server.
+ If you want to avoid a fail over even in this case, you need to specify DISALLOW_TO_FAILOVER on <xref linkend="guc-backend-flag">.
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ <note>
+ <para>
+ Prior to <productname>Pgpool-II</productname> <emphasis>V4.0</emphasis>,
+ this configuration parameter name was <varname>fail</varname><emphasis>_</emphasis><varname>over_on_backend_error</varname>.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-search-primary-node-timeout" xreflabel="search_primary_node_timeout">
+ <term><varname>search_primary_node_timeout</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>search_primary_node_timeout</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the maximum amount of time in seconds to search for the
+ primary node when a failover scenario occurs.
+ <productname>Pgpool-II</productname> will give up looking for the primary
+ node if it is not found with-in this configured time.
+ Default is 300 and Setting this parameter to 0 means keep trying forever.
+ </para>
+ <para>
+ This parameter is only applicable in the streaming replication mode.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-detach-false-primary" xreflabel="detach_false_primary">
+ <term><varname>detach_false_primary</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>detach_false_primary</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ If set to on, detach false primary node. The default is
+ off. This parameter is only valid in streaming replication
+ mode and for <productname>PostgreSQL</productname> 9.6 or
+ after since this feature
+ uses <function>pg_stat_wal_receiver</function>.
+ If <productname>PostgreSQL</productname> 9.5.x or older
+ version is used, no error is raised, just the feature is
+ ignored.
+ </para>
+ <para>
+ If there's no primary node, no checking will be performed.
+ </para>
+ <para>
+ If there's no standby node, and there's only one primary
+ node, no checking will be performed.
+ </para>
+ <para>
+ If there's no standby node, and there's multiple primary
+ nodes, leave the primary node which has the youngest node
+ id and detach rest of primary nodes.
+ </para>
+ <para>
+ If there are one or more primaries and one or more standbys,
+ check the connectivity between primary and standby nodes by
+ using <function>pg_stat_wal_receiver</function>
+ if <productname>PostgreSQL</productname> 9.6 or after. In
+ this case if a primary node connects to all standby nodes,
+ the primary is regarded as "true" primary. Other primaries
+ are regarded as "false" primary and the false primaries will
+ be detached if <varname>detach_false_primary</varname> is
+ true. If no "true" primary is found, nothing will happen.
+ </para>
+ <para>
+ When <productname>Pgpool-II</productname> starts, the
+ checking of false primaries are performed only once in
+ the <productname>Pgpool-II</productname> main
+ process. If <xref linkend="guc-sr-check-period"> is greater
+ than 0, the false primaries checking will be performed at
+ the same timing of streaming replication delay checking.
+ </para>
+
+ <note>
+ <para>
+ <xref linkend="guc-sr-check-user"> must
+ be <productname>PostgreSQL</productname> super user or
+ in "pg_monitor" group to use this feature. To
+ make <xref linkend="guc-sr-check-user"> in pg_monitor
+ group, execute following SQL command
+ by <productname>PostgreSQL</productname> super user
+ (replace "sr_check_user" with the setting
+ of <xref linkend="guc-sr-check-user">):
+ <programlisting>
+ GRANT pg_monitor TO sr_check_user;
+ </programlisting>
+ For <productname>PostgreSQL</productname> 9.6, there's
+ no pg_monitor group
+ and <xref linkend="guc-sr-check-user"> must
+ be <productname>PostgreSQL</productname> super user.
+ </para>
+ </note>
+
+ <para>
+ This parameter is only applicable in the streaming replication mode.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+
+ <para>
+ <figure>
+ <title>Detecting false primaries</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="detach_false_primary.gif">
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-auto-failback" xreflabel="auto_failback">
+ <term><varname>auto_failback</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>auto_failback</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, standby node be automatically failback, if the node status
+ is down but streaming replication works normally. This is useful when
+ standby node is degenerated by pgpool because of the temporary network failure.
+ </para>
+
+ <para>
+ To use this feature, streaming replication check (see <xref linkend="runtime-streaming-replication-check"> for more details)
+ must be enabled, and <productname>PostgreSQL</productname> 9.1 or later
+ is required as backend nodes. This feature uses <function>pg_stat_replication</function>
+ on primary node. The automatic failback is performed on standby node only.
+ Note that failback_command will be executed as well if failback_command is not empty.
+ If you plan to detach standby node for maintenance, set this parameter to off beforehand.
+ Otherwise it's possible that standby node is reattached against your intention.
+ </para>
+ <para>
+ The default is off. This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+
+ <note>
+ <para>
+ <xref linkend="guc-auto-failback"> may not work, when replication slot is used.
+ There is possibility that the streaming replication is stopped, because
+ <xref linkend="guc-failover-command"> is executed and replication slot is deleted by
+ the command.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-auto-failback-interval" xreflabel="auto_failback_interval">
+ <term><varname>auto_failback_interval</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>auto_failback_interval</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the minimum amount of time in seconds for execution interval of auto failback.
+ Next auto failback won't execute until that specified time have passed
+ after previous auto failback. When <productname>Pgpool-II</productname> frequently detect
+ backend down because of network error for example, you may avoid repeating
+ failover and failback by setting this parameter to large enough value.
+ The default is 60. Setting this parameter to 0 means that auto failback don't wait.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-config-failover-in-the-raw-mode">
+
+ <title>Failover in the raw Mode</title>
+
+ <para>
+ Failover can be performed in raw mode if multiple backend servers are defined.
+ <productname>Pgpool-II</> usually accesses the backend specified by
+ <literal>backend_hostname0</> during normal operation. If the
+ <literal>backend_hostname0</> fails for some reason,
+ <productname>Pgpool-II</> tries to access the backend specified by
+ <literal>backend_hostname1</>. If that fails, <productname>Pgpool-II</>
+ tries the <literal>backend_hostname2, 3</> and so on.
+ </para>
+
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/filelist.sgml -->
+
+<!ENTITY history SYSTEM "history.sgml">
+<!ENTITY info SYSTEM "info.sgml">
+<!ENTITY intro SYSTEM "intro.sgml">
+<!ENTITY legal SYSTEM "legal.sgml">
+<!ENTITY notation SYSTEM "notation.sgml">
+<!ENTITY problems SYSTEM "problems.sgml">
+<!ENTITY restrictions SYSTEM "restrictions.sgml">
+
+<!-- tutorial -->
+<!ENTITY advanced SYSTEM "advanced.sgml">
+<!ENTITY query SYSTEM "query.sgml">
+<!ENTITY start SYSTEM "start.sgml">
+
+<!-- administrator's guide -->
+<!ENTITY client-auth SYSTEM "client-auth.sgml">
+<!ENTITY installation SYSTEM "installation.sgml">
+<!ENTITY installation-rpm SYSTEM "installation-rpm.sgml">
+<!ENTITY installation-tips SYSTEM "installation-tips.sgml">
+<!ENTITY maintenance SYSTEM "maintenance.sgml">
+<!ENTITY manage-ag SYSTEM "manage-ag.sgml">
+<!ENTITY monitoring SYSTEM "monitoring.sgml">
+<!ENTITY regress SYSTEM "regress.sgml">
+<!ENTITY recovery-config SYSTEM "recovery-config.sgml">
+<!ENTITY runtime SYSTEM "runtime.sgml">
+<!ENTITY config SYSTEM "config.sgml">
+<!ENTITY connection-settings SYSTEM "connection-settings.sgml">
+<!ENTITY connection-pooling SYSTEM "connection-pooling.sgml">
+<!ENTITY loadbalance SYSTEM "loadbalance.sgml">
+<!ENTITY healthcheck SYSTEM "healthcheck.sgml">
+<!ENTITY failover SYSTEM "failover.sgml">
+<!ENTITY online-recovery SYSTEM "online-recovery.sgml">
+<!ENTITY stream-check SYSTEM "stream-check.sgml">
+<!ENTITY memcache SYSTEM "memcache.sgml">
+<!ENTITY ssl SYSTEM "ssl.sgml">
+<!ENTITY watchdog SYSTEM "watchdog.sgml">
+<!ENTITY performance SYSTEM "performance.sgml">
+<!ENTITY misc-config SYSTEM "misc-config.sgml">
+<!ENTITY config-last SYSTEM "config-last.sgml">
+
+<!ENTITY examples SYSTEM "examples.sgml">
+<!ENTITY example-basic SYSTEM "example-basic.sgml">
+<!ENTITY example-watchdog SYSTEM "example-watchdog.sgml">
+<!ENTITY example-cluster SYSTEM "example-cluster.sgml">
+<!ENTITY example-AWS SYSTEM "example-AWS.sgml">
+<!ENTITY example-Aurora SYSTEM "example-Aurora.sgml">
+<!ENTITY example-Kubernetes SYSTEM "example-Kubernetes.sgml">
+
+<!-- reference pages -->
+<!ENTITY % allfiles SYSTEM "ref/allfiles.sgml">
+%allfiles;
+
+<!-- appendixes -->
+<!ENTITY release SYSTEM "release.sgml">
+<!ENTITY release-4.2 SYSTEM "release-4.2.sgml">
+<!ENTITY release-4.1 SYSTEM "release-4.1.sgml">
+<!ENTITY release-4.0 SYSTEM "release-4.0.sgml">
+<!ENTITY release-3.7 SYSTEM "release-3.7.sgml">
+<!ENTITY release-3.6 SYSTEM "release-3.6.sgml">
+<!ENTITY release-3.5 SYSTEM "release-3.5.sgml">
+<!ENTITY release-3.4 SYSTEM "release-3.4.sgml">
+<!ENTITY release-3.3 SYSTEM "release-3.3.sgml">
+<!ENTITY release-3.2 SYSTEM "release-3.2.sgml">
+<!ENTITY release-3.1 SYSTEM "release-3.1.sgml">
+<!ENTITY release-old SYSTEM "release-old.sgml">
+
+<!-- back matter -->
+<!ENTITY biblio SYSTEM "biblio.sgml">
+<!ENTITY bookindex SYSTEM "bookindex.sgml">
+
+<!--
+ Some parts of the documentation are also source for some plain-text
+ files used during installation. To selectively ignore or include
+ some parts (e.g., external xref's) when generating these files we use
+ these parameter entities. See also standalone-install.sgml.
+ -->
+<!ENTITY % standalone-ignore "INCLUDE">
+<!ENTITY % standalone-include "IGNORE">
+
+<!--
+ By default, no index is included. Use -i include-index on the command line
+ to include it.
+ -->
+<!ENTITY % include-index "IGNORE">
+
+<!--
+ Create empty index element for processing by XSLT stylesheet.
+ -->
+<!ENTITY % include-xslt-index "IGNORE">
--- /dev/null
+#!/bin/sh
+# fixrtf
+
+# doc/src/sgml/fixrtf
+
+# Repair (slightly) damaged RTF generated by jade
+# Applixware wants the s0 stylesheet defined, whereas
+# M$Word does not care about it.
+# (c) 2001, Thomas Lockhart, PostgreSQL Inc.
+
+flist=""
+RPAT=""
+for i in $@ ; do
+ case "$i" in
+ -r|--refentry)
+ RPAT='-e s/\\\keepn/\\\keep/g'
+ ;;
+ -?|--help)
+ echo "$0 [--refentry] <rtf file> ..."
+ exit 0
+ ;;
+ -*)
+ echo "Command $i not recognized"
+ $0 --help
+ exit 1
+ ;;
+ *)
+ flist="$flist $i"
+ esac
+done
+
+if [ "$flist" = "" ] ; then
+ flist=*.rtf
+fi
+
+for f in $flist ; do
+ echo -n "Repairing '$f' ..."
+ if [ -r $f ] ; then
+ (sed -e 's/{\\stylesheet{\\s1/{\\stylesheet{\\s0 Normal 0;}{\\s1/g' $RPAT $f > $f.new \
+ && mv -f $f.new $f \
+ && echo " done") || echo " failed"
+ else
+ echo " file not found"
+ fi
+done
+exit
--- /dev/null
+#!/usr/bin/perl
+#
+# Generate the errcodes-table.sgml file from errcodes.txt
+# Copyright (c) 2000-2016, PostgreSQL Global Development Group
+
+use warnings;
+use strict;
+
+print
+ "<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\n";
+
+open my $errcodes, $ARGV[0] or die;
+
+while (<$errcodes>)
+{
+ chomp;
+
+ # Skip comments
+ next if /^#/;
+ next if /^\s*$/;
+
+ # Emit section headers
+ if (/^Section:/)
+ {
+
+ # Remove the Section: string
+ s/^Section: //;
+
+ # Escape dashes for SGML
+ s/-/—/;
+
+ # Wrap PostgreSQL in <productname/>
+ s/PostgreSQL/<productname>PostgreSQL<\/>/g;
+
+ print "\n\n";
+ print "<row>\n";
+ print "<entry spanname=\"span12\">";
+ print "<emphasis role=\"bold\">$_</></entry>\n";
+ print "</row>\n";
+
+ next;
+ }
+
+ die unless /^([^\s]{5})\s+([EWS])\s+([^\s]+)(?:\s+)?([^\s]+)?/;
+
+ (my $sqlstate, my $type, my $errcode_macro, my $condition_name) =
+ ($1, $2, $3, $4);
+
+ # Skip lines without PL/pgSQL condition names
+ next unless defined($condition_name);
+
+ print "\n";
+ print "<row>\n";
+ print "<entry><literal>$sqlstate</literal></entry>\n";
+ print "<entry><symbol>$condition_name</symbol></entry>\n";
+ print "</row>\n";
+}
+
+close $errcodes;
--- /dev/null
+<!-- doc/src/sgml/healthcheck.sgml -->
+
+<sect1 id="runtime-config-health-check">
+ <title>Health Check</title>
+
+ <para>
+ <productname>Pgpool-II</productname> periodically connects to the configured
+ PostgreSQL backends to detect any error on the servers or networks.
+ This error check procedure is called "health check".
+ If an error is detected, <productname>Pgpool-II</productname> performs failover
+ or degeneration depending on the configurations.
+ <caution>
+ <para>
+ Health check requires one extra connection to each backend node,
+ so <literal>max_connections</literal> in the <filename>postgresql.conf</filename>
+ needs to be adjusted accordingly.
+ </para>
+ </caution>
+ </para>
+
+ <para>
+ The health check process collects various statistics data such as
+ number of health check count in total. To inspect the statistics
+ data, use <xref linkend="SQL-SHOW-POOL-HEALTH-CHECK-STATS">
+ command. Please note that the data is stored in the shared memory
+ area and it will be initialized upon
+ <productname>Pgpool-II</productname> starting up.
+ </para>
+
+ <para>
+ Following parameter names can also have numeric suffix at the end
+ of each name. The suffix corresponds to backend id, which is
+ defined in backend information, such
+ as <xref linkend="guc-backend-hostname">.
+ example, <varname>health_check_timeout0</varname> is applied to
+ backend 0's <varname>health_check_timeout</varname> value.
+ </para>
+ <para>
+ If there's no parameter with suffix, the value for the backend
+ is taken from the parameter name which does not have a suffix. In
+ this sense, parameter names without suffix work like "global
+ variables".
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-health-check-timeout" xreflabel="health_check_timeout">
+ <term><varname>health_check_timeout</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>health_check_timeout</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the timeout in seconds to give up connecting to the backend
+ <productname>PostgreSQL</> if the TCP connect does not succeed within this time.
+ </para>
+ <para>
+ This parameter serves to prevent the health check from waiting for a
+ long time when the network cable is unplugged.
+ Default value is 20. Setting it to 0, disables the timeout (waits until TCP/IP timeout).
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-health-check-period" xreflabel="health_check_period">
+ <term><varname>health_check_period</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>health_check_period</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the interval between the health checks in seconds.
+ Default is 0, which means health check is disabled.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-health-check-user" xreflabel="health_check_user">
+ <term><varname>health_check_user</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>health_check_user</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the <productname>PostgreSQL</> user name to perform health check.
+ The same user must exist in all the <productname>PostgreSQL</> backends.
+ Otherwise, health check causes an error.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-health-check-password" xreflabel="health_check_password">
+ <term><varname>health_check_password</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>health_check_password</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the password for the <productname>PostgreSQL</> user name configured in
+ <xref linkend="guc-health-check-user"> to perform health check.
+ The user and password must be same in all the <productname>PostgreSQL</> backends.
+ Otherwise, health check results in an error.
+ </para>
+ <para>
+ If <varname>health_check_password</varname> is left blank <productname>Pgpool-II</productname>
+ will first try to get the password for <xref linkend="guc-health-check-user"> from
+ <xref linkend="guc-pool-passwd"> file before using the empty password.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> accepts following forms
+ of password in either <varname>health_check_password</varname>
+ or <xref linkend="guc-pool-passwd"> file:
+ <variablelist>
+
+ <varlistentry>
+ <term>AES256-CBC encrypted password</term>
+ <listitem>
+ <para>
+ Most secure and recommended way to store password. The
+ password string must be prefixed
+ with <literal>AES</literal>.
+ You can use <xref linkend="PG-ENC"> utility to create the correctly formatted
+ <literal>AES</literal> encrypted password strings.
+ <productname>Pgpool-II</productname> will require a valid decryption key at the
+ startup to use the encrypted passwords.
+ see <xref linkend="auth-aes-decryption-key"> for more details on providing the
+ decryption key to <productname>Pgpool-II</productname>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>MD5 hashed password</term>
+ <listitem>
+ <para>
+ Not so secure as AES256, but still better than clear
+ text password. The password string must be prefixed
+ with <literal>MD5</literal>. Note that the backend
+ must set up MD5 authentication as well. You can
+ use <xref linkend="PG-MD5"> utility to create the
+ correctly formatted
+ <literal>MD5</literal> hashed password strings.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Plain text password</term>
+ <listitem>
+ <para>
+ Not encrypted, clear text password. You should avoid
+ to use this if possible. The password string must be
+ prefixed with <literal>TEXT</literal>. For example if
+ you want to set <literal>mypass</literal> as a
+ password, you should
+ specify <literal>TEXTmypass</literal> in the password
+ field. In the absence of a valid
+ prefix, <productname>Pgpool-II</productname> will
+ considered the string as a plain text password.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-health-check-database" xreflabel="health_check_database">
+ <term><varname>health_check_database</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>health_check_database</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the PostgreSQL database name to perform health check.
+ The default is <literal>''</literal>(empty), which tries <literal>"postgres"</literal>
+ database first, then <literal>"template1"</literal> database until it succeeds
+ </para>
+ <para>
+ <varname>health_check_database</varname> was introduced in
+ <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-health-check-max-retries" xreflabel="health_check_max_retries">
+ <term><varname>health_check_max_retries</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>health_check_max_retries</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the maximum number of retries to do before giving up and
+ initiating failover when health check fails.
+ <tip>
+ <para>
+ This setting can be useful in spotty networks, when it is expected that
+ health checks will fail occasionally even when the primary node is fine.
+ </para>
+ </tip>
+ <tip>
+ <para>
+ It is advised that <xref linkend="guc-failover-on-backend-error"> must be disabled,
+ if you want to enable <varname>health_check_max_retries</>.
+ </para>
+ </tip>
+ Default is 0, which means do not retry.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-health-check-retry-delay" xreflabel="health_check_retry_delay">
+ <term><varname>health_check_retry_delay</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>health_check_retry_delay</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the amount of time in seconds to sleep between failed
+ health check retries (not used unless <xref linkend="guc-health-check-max-retries"> is > 0).
+ If 0, then retries are immediate without delay.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-connect-timeout" xreflabel="connect_timeout">
+ <term><varname>connect_timeout</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>connect_timeout</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the amount of time in milliseconds before giving up connecting
+ to backend using <function>connect()</> system call.
+ Default is 10000 ms (10 second). The flaky network user may want to increase the value.
+ 0 means no timeout.
+ <note>
+ <para>
+ <varname>connect_timeout</varname> value is not only used for a health check,
+ but also for creating ordinary connection pools.
+ </para>
+ </note>
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/history.sgml -->
+
+<sect1 id="history">
+ <!--
+ <title>A Brief History of <productname>Pgpool-II</productname></title>
+ -->
+ <title><productname>Pgpool-II</productname>简史</title>
+
+ <indexterm zone="history">
+ <primary>history</primary>
+ <secondary>of Pgpool-II</secondary>
+ </indexterm>
+ <para>
+ <productname>Pgpool-II</productname> started its life as a personal
+ project by Tatsuo Ishii. In the project it was just a simple
+ connection pooling software. So the
+ name <productname>Pgpool</productname> came from the fact. The
+ first version was in public in 2003.
+ </para>
+ <para>
+ In 2004, <productname>Pgpool</productname> 1.0 was released with
+ the native replication feature (SQL statement based
+ replication). In the same year 2.0 was released with load
+ balancing, and support for version 3 frontend/backend protocol. In
+ 2005, automated fail over and master slave mode support were added.
+ </para>
+ <para>
+ In 2006, <productname>Pgpool</productname>
+ became <productname>Pgpool-II</productname>. The first release 1.0
+ eliminated many of restrictions
+ in <productname>Pgpool</productname>, for example the number
+ of <productname>PostgreSQL</productname> servers was up to 2 in
+ <productname>Pgpool</productname>. Also many new features such as
+ parallel query mode and PCP commands (PCP stands for "Pgpool
+ Control Protocol") were added. Probably the most important change
+ made between <productname>Pgpool</productname>
+ and <productname>Pgpool-II</productname> was that the project was
+ changed from a personal project to a group project owned by the
+ Pgpool Development Group.
+ </para>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/info.sgml -->
+
+<sect1 id="resources">
+ <!--
+ <title>Further Information</title>
+ -->
+ <title>进一步的信息</title>
+
+ <para>
+ Besides the documentation, that is, this book, there are other
+ resources about <productname>Pgpool-II</productname>:
+
+ <variablelist>
+
+ <varlistentry>
+ <term>Web Site</term>
+ <listitem>
+ <para>
+ The <productname>Pgpool-II</productname>
+ <ulink url="http://pgpool.net">web site</ulink> is a central place providing official information regarding
+ <productname>Pgpool-II</productname>: downloads, documentation, FAQ, mailing list archives and more.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Mailing Lists</term>
+ <listitem>
+ <para>
+ The mailing lists are a good place to have your questions
+ answered, to share experiences with other users, and to contact
+ the developers. Consult the <productname>Pgpool-II</> web site
+ for details.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Yourself!</term>
+ <listitem>
+ <para>
+ <productname>pgpool-II</productname> is an open-source project.
+ As such, it depends on the user community for ongoing support.
+ As you begin to use <productname>Pgpool-II</productname>, you
+ will rely on others for help, either through the documentation
+ or through the mailing lists. Consider contributing your
+ knowledge back. Read the mailing lists and answer questions. If
+ you learn something which is not in the documentation, write it
+ up and contribute it. If you add features to the code,
+ contribute them.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/installation-rpm.sgml -->
+
+ <sect1 id="install-rpm">
+ <title>Installation from RPM</title>
+ <para>
+ This chapter describes the installation
+ of <productname>Pgpool-II</productname> from RPM. If you are
+ going to install from the source code, please
+ check <xref linkend="install-source">.
+ </para>
+
+ <sect2 id="installing-rpm">
+ <title>Installing RPM</title>
+ <para>
+ <productname>Pgpool-II</productname> official RPMs can be
+ obtained from
+ <ulink url="https://www.pgpool.net/yum">https://www.pgpool.net/yum</ulink>.
+ </para>
+
+ <para>
+ For RHEL and its derivatives do following once:
+ <programlisting>
+ yum install https://www.pgpool.net/yum/rpms/4.1/redhat/rhel-7-x86_64/pgpool-II-release-4.1-2.noarch.rpm
+ </programlisting>
+ Then:
+ <programlisting>
+ yum install pgpool-II-pg12
+ </programlisting>
+
+ <literal>pg12</literal> means <literal>PostgreSQL
+ 12</literal>. <productname>Pgpool-II</productname>
+ needs <productname>PostgreSQL</productname>'s library and
+ extensions directory. Since the directory paths are different in
+ the particular <productname>PostgreSQL</productname> versions,
+ You must choose appropriate RPM for
+ your <productname>PostgreSQL</productname> rpm installation. We
+ also assume you are
+ using <ulink url="https://www.postgresql.org/download/linux/redhat/"><productname>PostgreSQL</productname>
+ community rpms</ulink>.
+
+ Optionally you can install:
+ <programlisting>
+ yum install pgpool-II-pg12-debuginfo
+ </programlisting>
+ which makes it easier to retrieve debugging symbols from the core
+ or the backtrace. We recommend to install it.
+
+ There is an optional package for developers.
+ <programlisting>
+ yum install pgpool-II-pg12-devel
+ </programlisting>
+ This installs header files which developers are interested in.
+ </para>
+
+ <para>
+ On all the <productname>PostgreSQL</productname> servers you need
+ to install:
+ <programlisting>
+ yum install pgpool-II-pg12-extensions
+ </programlisting>
+
+ </para>
+ </sect2>
+
+ <sect2 id="configure-rpm">
+ <title>Configuration with RPM</title>
+ <para>
+ All the <productname>Pgpool-II</productname> configuration files
+ live in <filename>/etc/pgpool-II</filename>. Please refer
+ to <xref linkend="configuring-pgpool"> to see how to set up
+ configuration files.
+ </para>
+ </sect2>
+
+ <sect2 id="start-rpm">
+ <title>Starting/stopping Pgpool-II</title>
+ <para>
+ On RHEL7/CentOS 7, do this once.
+ Do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
+ <programlisting>
+ systemctl enable pgpool.service
+ </programlisting>
+
+ After this, restart the whole system or do this. Please note that
+ <productname>PostgreSQL</productname> servers must have been started
+ before this.
+
+ <programlisting>
+ systemctl start pgpool.service
+ </programlisting>
+
+ To stop <productname>Pgpool-II</productname>, do this once.
+ <productname>Pgpool-II</productname> must need to stop, before <productname>PostgreSQL</productname> is stopped.
+ <programlisting>
+ systemctl stop pgpool.service
+ </programlisting>
+
+ After this, you can stop <productname>PostgreSQL</productname>
+ servers.
+ </para>
+ <para>
+ On RHEL6/CentOS 6, do this once.
+
+ <programlisting>
+ chkconfig pgpool on
+ </programlisting>
+
+ After this, restart the whole system or:
+
+ <programlisting>
+ service start pgpool
+ </programlisting>
+
+ Please note that <productname>PostgreSQL</productname> servers
+ must have been started before this.
+
+ To stop <productname>Pgpool-II</productname>:
+ <programlisting>
+ service stop pgpool
+ </programlisting>
+
+ After this, you can stop <productname>PostgreSQL</productname>
+ servers.
+ </para>
+
+ </sect2>
+
+ </sect1>
--- /dev/null
+<!-- doc/src/sgml/installation-tips.sgml -->
+
+ <sect1 id="installation-tips">
+ <title>Tips for Installation</title>
+ <para>
+ This chapter gathers random tips for installing <productname>Pgpool-II</productname>.
+ </para>
+
+ <sect2 id="firewall">
+ <title>Firewalls</title>
+ <para>
+ When <productname>Pgpool-II</productname> connects to
+ other <productname>Pgpool-II</productname> servers
+ or <productname>PostgreSQL</productname> servers, the target port
+ must be accessible by enabling firewall management softwares.
+ </para>
+
+ <para>
+ First, allow to access port that <productname>Pgpool-II</productname> use.
+
+ In the example below, let <link linkend="guc-port">Pgpool-II listen
+ port number</link> be 9999, <link linkend="guc-pcp-port">PCP listen
+ port number</link> be 9898, <link linkend="guc-wd-port">watchdog
+ listen port number</link> be 9000 and <link
+ linkend="guc-heartbeat-port">heartbeat listen port number</link> be
+ 9694. Notice that only heartbeat port uses UDP and others use TCP.
+
+ <programlisting>
+ firewall-cmd --permanent --zone=public --add-port=9999/tcp --add-port=9898/tcp --add-port=9000/tcp
+ firewall-cmd --permanent --zone=public --add-port=9694/udp
+ firewall-cmd --reload
+ </programlisting>
+ </para>
+
+ <para>
+ Here is an example for CentOS/RHEL7 when access
+ to <productname>PostgreSQL</productname> is required.
+
+ <programlisting>
+ firewall-cmd --permanent --zone=public --add-service=postgresql
+ firewall-cmd --reload
+ </programlisting>
+ "postgresql" is the service name assigned
+ to <productname>PostgreSQL</productname>. The list of service
+ names can be obtained by:
+ <programlisting>
+ firewall-cmd --get-services
+ </programlisting>
+ Note that you can define your own service name in
+ /usr/lib/firewalld/services/.
+ </para>
+
+ <para>
+ If <productname>PostgreSQL</productname> is listening on 11002
+ port, rather than the standard 5432 port, you can do:
+ <programlisting>
+ firewall-cmd --zone=public --remove-service=popstgresql --permanent
+ firewall-cmd --zone=public --add-port=11002/tcp --permanent
+ firewall-cmd --reload
+ </programlisting>
+ </para>
+
+ </sect2>
+
+ </sect1>
--- /dev/null
+<!-- doc/src/sgml/installation.sgml -->
+
+ <chapter id="installation">
+ <title>Installation of <productname>Pgpool-II</productname></title>
+
+ <indexterm zone="installation">
+ <primary>installation</primary>
+ </indexterm>
+
+ <sect1 id="planning">
+ <title>Planning</title>
+ <para>
+ Since <productname>Pgpool-II</productname> is a tool to manage
+ <productname>PostgreSQL</productname>, we need to decide how to
+ deploy them first. In addition, it is possible to have multiple
+ number of <productname>Pgpool-II</productname> installations to
+ enhance the availability of <productname>Pgpool-II</productname>
+ itself. We need to plan how many installations of
+ <productname>Pgpool-II</productname> is required before hand. In
+ this chapter we first discuss the running mode of
+ <productname>PostgreSQL</productname> then the deployment of
+ <productname>Pgpool-II</productname>.
+ </para>
+
+ <sect2 id="planning-postgresql">
+ <title>Clustering mode of PostgreSQL</title>
+ <para>
+ It is possible to have more than or equal to one installation of
+ <productname>PostgreSQL</productname>, it is common to have more
+ than 2 installations of it because if there's only one
+ installation, the whole database system goes down if the
+ <productname>PostgreSQL</productname> is not available. When we
+ use two or more <productname>PostgreSQL</productname> servers, it
+ is necessary to sync the databases in some way. We call the
+ methods of syncing databases as "clustering running mode". The
+ most popular mode ever used is "streaming replication mode".
+ Unless there's necessity to have special consideration, it is
+ recommended to use the streaming replication mode. See <xref
+ linkend="running-mode"> for more details of running mode.
+ </para>
+ <para>
+ The next thing we need to consider is how many
+ <productname>PostgreSQL</productname> installations we want. If
+ there are two, we can continue to operate the database
+ system. However it is not uncommon to use more than two
+ <productname>PostgreSQL</productname> if you want to employ read
+ query load balancing by running multiple read quires on multiple
+ servers. <productname>Pgpool-II</productname> provides rich
+ variety of options to tune load balancing. See <xref
+ linkend="runtime-config-load-balancing"> for more details.
+ </para>
+ <para>
+ Since it is possible to add <productname>PostgreSQL</productname>
+ servers later on in <productname>Pgpool-II</productname>, two
+ <productname>PostgreSQL</productname> can be a good starter for
+ you.
+ </para>
+ </sect2>
+
+ <sect2 id="planning-pgpool">
+ <title>Deployment of Pgpool-II</title>
+ <para>
+ Although it is possible to use only one
+ <productname>Pgpool-II</productname>, we recommend to use more
+ than 1 <productname>Pgpool-II</productname> to avoid whole
+ database unavailability due to the
+ <productname>Pgpool-II</productname> being down. Multiple
+ <productname>Pgpool-II</productname> work together and monitor
+ each other. One of them is called "leader" and it has a virtual
+ IP. Clients do not need to aware that there are multiple
+ <productname>Pgpool-II</productname> because they always access
+ the same VIP. (See <xref linkend="tutorial-watchdog-intro"> for
+ watchdog). If one of <productname>Pgpool-II</productname> goes
+ down, other <productname>Pgpool-II</productname> takes over the
+ leader role.
+ </para>
+ <para>
+ Since it is not allowed to have multiple leader, watchdog votes to
+ decide a new leader. If there are even number of
+ <productname>Pgpool-II</productname>, it is impossible to decide
+ the new leader by voting. Thus we recommend to deploy
+ <productname>Pgpool-II</productname> in more than 3 odd numbers.
+ </para>
+ <para>
+ Please note that it is possible to have
+ <productname>Pgpool-II</productname> and
+ <productname>PostgreSQL</productname> on a same server. For
+ example you can have only three servers to run both
+ <productname>Pgpool-II</productname> and
+ <productname>PostgreSQL</productname> on each of it.
+ </para>
+ <para>
+ You can find a production level detailed example using three
+ <productname>Pgpool-II</productname> and two
+ <productname>PostgreSQL</productname> in streaming replication
+ mode in <xref linkend="example-cluster"> for those who want to
+ have a production level <productname>Pgpool-II</productname>
+ installation today.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="install-source">
+ <title>Installation of Pgpool-II</title>
+ <para>
+ This chapter describes the installation
+ of <productname>Pgpool-II</productname>. First, installation from
+ source code distribution is explained. Then installation from RPM
+ packages is explained.
+ </para>
+ </sect1>
+
+ <sect1 id="install-requirements">
+ <title>Requirements</title>
+
+ <para>
+ In general, a modern Unix-compatible platform should be able to run
+ <productname>Pgpool-II</>. Windows is not supported.
+ </para>
+
+ <para>
+ The following software packages are required for building
+ <productname>Pgpool-II</>:
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>make</primary>
+ </indexterm>
+
+ <acronym>GNU</> <application>make</> version 3.80 or newer is required; other
+ <application>make</> programs or older <acronym>GNU</> <application>make</> versions will <emphasis>not</> work.
+ (<acronym>GNU</> <application>make</> is sometimes installed under
+ the name <filename>gmake</filename>.) To test for <acronym>GNU</acronym>
+ <application>make</application> enter:
+ <screen>
+ <userinput>make --version</userinput>
+ </screen>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ You need an <acronym>ISO</>/<acronym>ANSI</> C compiler (at least
+ C89-compliant). Recent
+ versions of <productname>GCC</> are recommended, but
+ <productname>Pgpool-II</> is known to build using a wide variety
+ of compilers from different vendors.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <application>tar</> is required to unpack the source
+ distribution, in addition to <application>gzip</>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Several packages of <productname>PostgreSQL</productname> are required to
+ install <productname>Pgpool-II</productname>. You install postgresql-libs
+ and postgresql-devel packages from rpm.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ If you are building from a <productname>Git</productname> tree instead of
+ using a released source package, or if you want to do server development,
+ you also need the following packages:
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>flex</primary>
+ </indexterm>
+ <indexterm>
+ <primary>lex</primary>
+ </indexterm>
+ <indexterm>
+ <primary>bison</primary>
+ </indexterm>
+ <indexterm>
+ <primary>yacc</primary>
+ </indexterm>
+
+ <application>Flex</> and <application>Bison</>
+ are needed to build from a Git checkout, or if you changed the actual
+ scanner and parser definition files. If you need them, be sure
+ to get <application>Flex</> 2.5.31 or later and
+ <application>Bison</> 1.875 or later. Other <application>lex</>
+ and <application>yacc</> programs cannot be used.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+
+ <para>
+ If you need to get a <acronym>GNU</acronym> package, you can find
+ it at your local <acronym>GNU</acronym> mirror site (see <ulink
+ url="http://www.gnu.org/order/ftp.html"></>
+ for a list) or at <ulink
+ url="ftp://ftp.gnu.org/gnu/"></ulink>.
+ </para>
+
+ <para>
+ Also check that you have sufficient disk space. You will need about
+ 40 MB for the source tree during compilation and about 20 MB for
+ the installation directory. If you are going to
+ run the regression tests you will temporarily need up to an extra
+ 4 GB. Use the <command>df</command> command to check free disk
+ space.
+ </para>
+ </sect1>
+
+ <sect1 id="install-getsource">
+ <title>Getting The Source</title>
+
+ <para>
+ The <productname>Pgpool-II</> &version; sources can be obtained
+ from the download section of our
+ website: <ulink url="http://www.pgpool.net"></ulink>. You should
+ get a file
+ named <filename>pgpool-II-&version;.tar.gz</filename>. After you
+ have obtained the file, unpack it:
+ <screen>
+ <userinput>tar xf pgpool-II-&version;.tar.gz</userinput>
+ </screen>
+ This will create a directory
+ <filename>pgpool-II-&version;</filename> under the current directory
+ with the <productname>Pgpool-II</> sources.
+ Change into that directory for the rest
+ of the installation procedure.
+ </para>
+
+ </sect1>
+
+ <sect1 id="install-pgpool">
+ <title>Installing Pgpool-II</title>
+ <para>
+ After extracting the source tarball, execute the <filename>configure</> script.
+ <programlisting>
+ ./configure
+ </programlisting>
+ </para>
+
+ <para>
+ You can customize the build and installation process by supplying one
+ or more of the following command line options to
+ <filename>configure</filename>:
+ </para>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>--prefix=path</option></term>
+ <listitem>
+ <para>
+ Specifies the top directory where <productname>Pgpool-II</> binaries and related
+ files like docs will be installed in. Default value is <filename>/usr/local</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--with-pgsql=path</option></term>
+ <listitem>
+ <para>
+ Specifies the top directory where <productname>PostgreSQL</>'s client libraries are
+ installed. Default value is the path provided by <command>pg_config</command> command.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--with-openssl</option></term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> binaries will be built
+ with <productname>OpenSSL</productname>
+ support. <productname>OpenSSL</productname> support is
+ disabled by default.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--enable-sequence-lock</option></term>
+ <listitem>
+ <para>
+ Use insert_lock compatible
+ with <productname>Pgpool-II</productname> 3.0 series
+ (until 3.0.4). <productname>Pgpool-II</productname> locks
+ against a row in the sequence
+ table. <productname>PostgreSQL</productname> 8.2 or later
+ which was released after June 2011 cannot use this lock
+ method.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--enable-table-lock</option></term>
+ <listitem>
+ <para>
+ Use insert_lock compatible
+ with <productname>Pgpool-II</productname> 2.2 and 2.3
+ series. <productname>Pgpool-II</productname> locks
+ against the insert target table. This lock method is
+ deprecated because it causes a lock conflict
+ with <command>VACUUM</command>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--with-memcached=path</option></term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> binaries will use <productname>memcached</productname> for in
+ memory query cache. You have to
+ install <ulink url="http://libmemcached.org/libMemcached.html">libmemcached</ulink>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--with-pam</option></term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> binaries will be built with PAM authentication support.
+ PAM authentication support is disabled by default.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ <para>
+ <programlisting>
+ make
+ make install
+ </programlisting>
+ This will install <productname>Pgpool-II</>. (If you use <productname>Solaris</> or <productname>FreeBSD</>, replace <command>make</> with <command>gmake</>)
+ </para>
+
+ </sect1>
+
+ <sect1 id="install-pgpool-recovery">
+ <title>Installing pgpool_recovery</title>
+ <para>
+ <productname>Pgpool-II</productname> need function of <function>pgpool_recovery</function>,
+ <function>pgpool_remote_start</function> and <function>pgpool_switch_xlog</function>,
+ when you use the online recovery that describes latter.
+ Also pgpoolAdmin of management tool, stop, restart or reload a
+ <productname>PostgreSQL</productname> on the screen by use <function>pgpool_pgctl</function>.
+ It is enough, if these function installed in template1 first. These
+ function do not needed that install in all databases.
+ </para>
+
+ <para>
+ This is required in all <productname>Pgpool-II</productname>
+ installation.
+ <programlisting>
+ $ cd pgpool-II-&version/src/sql/pgpool-recovery
+ $ make
+ $ make install
+ </programlisting>
+ After this:
+ <programlisting>
+ $ psql template1
+ =# CREATE EXTENSION pgpool_recovery;
+ </programlisting>
+
+ or
+ <programlisting>
+ $ psql -f pgpool-recovery.sql template1
+ </programlisting>
+
+ </para>
+
+ <para>
+ With <productname>Pgpool-II</productname> 3.3 or later, you need
+ to tweak <filename>postgresql.conf</filename>. Suppose the path
+ to <command>pg_ctl</command>
+ is <filename>/usr/local/pgsql/bin/pg_ctl</filename>. Then you
+ add following to <filename>postgresql.conf</filename>.
+
+ <programlisting>
+ pgpool.pg_ctl = '/usr/local/pgsql/bin/pg_ctl'
+ </programlisting>
+
+ Probably you want to execute following after this:
+ <programlisting>
+ $ pg_ctl reload -D /usr/local/pgsql/data
+ </programlisting>
+
+ </para>
+ </sect1>
+
+ <sect1 id="install-pgpool-regclass">
+ <title>Installing pgpool-regclass</title>
+ <para>
+ If you are using <productname>PostgreSQL</productname> 9.4 or
+ later, you can skip this section.
+ </para>
+
+ <para>
+ If you are using <productname>PostgreSQL</productname> 8.0
+ to <productname>PostgreSQL</productname> 9.3, installing
+ <function>pgpool_regclass</function> function on
+ all <productname>PostgreSQL</productname> to be accessed by
+ <productname>Pgpool-II</productname> is strongly recommended, as
+ it is used internally by <productname>Pgpool-II</productname>.
+ Without this, handling of duplicate table names in different
+ schema might cause trouble (temporary tables aren't a problem).
+ If you are using <productname>PostgreSQL</productname> 9.4 or
+ later, installing <function>pgpool_regclass</function> is not
+ necessary since an equivalent (<function>to_regclass</function>)
+ is included in the <productname>PostgreSQL</productname> core.
+ </para>
+
+ <para>
+ <programlisting>
+ $ cd pgpool-II-&version/src/sql/pgpool-regclass
+ $ make
+ $ make install
+ </programlisting>
+ After this:
+
+ <programlisting>
+ $ psql template1
+ =# CREATE EXTENSION pgpool_regclass;
+ </programlisting>
+
+ or
+
+ <programlisting>
+ $ psql -f pgpool-regclass.sql template1
+ </programlisting>
+
+ Executing <command>CREATE EXTENSION</command>
+ or <filename>pgpool-regclass.sql</filename> should be performed
+ on every databases accessed
+ via <productname>Pgpool-II</productname>. However, you do not need to
+ do this for a database created after the execution of
+ <command>CREATE EXTENSION</command> or
+ <command>psql -f pgpool-regclass.sql template1</command>,
+ as this template database will be cloned to create new databases.
+ </para>
+
+ </sect1>
+
+ <sect1 id="create-installlock-table">
+ <title>Creating insert_lock table</title>
+
+ <para>
+ If you are not going to use the native replication mode, you can skip this section.
+ </para>
+
+ <para>
+ If you plan to use native replication mode and insert_lock,
+ creating <structname>pgpool_catalog.insert_lock</structname>
+ table for mutual exclusion is strongly recommended. Without
+ this, insert_lock works so far. However in that
+ case <productname>Pgpool-II</productname> locks against the
+ insert target table. This behavior is same
+ table lock conflicts with <command>VACUUM</command>, so <command>INSERT</command>
+ processing may be thereby kept waiting for a long time.
+
+ <programlisting>
+ $ cd pgpool-II-&version/src/sql
+ $ psql -f insert_lock.sql template1
+ </programlisting>
+
+ </para>
+
+ <para>
+ Executing <filename>insert_lock.sql</filename> should be
+ performed on every databases accessed
+ via <productname>Pgpool-II</productname>. You do not need to
+ do this for a database created after the execution of
+ <command>psql -f insert_lock.sql template1</command>, as this
+ template database will be cloned to create new databases.
+ </para>
+ </sect1>
+
+ <sect1 id="install-docs">
+ <title>Compiling and installing documents</title>
+
+ <sect2 id="install-docs-tool-sets">
+ <title>Tool Sets</title>
+
+ <para>
+ <productname>Pgpool-II</productname> documents are written in
+ SGML (more precisely, DocBook, which is a language implemented
+ using SGML). To generate readable HTML documents, you need to
+ compile them using docbook tools. To install Docbook tools on
+ RHEL or similar systems, use:
+ <programlisting>
+ yum install docbook-dtds docbook-style-dsssl docbook-style-xsl libxslt openjade
+ </programlisting>
+ </para>
+ </sect2>
+
+ <sect2 id="install-docs-make">
+ <title>Compiling docs</title>
+ <para>
+ Once the tool sets are installed on the system, you can compile the docs:
+ <programlisting>
+ $ cd doc
+ $ make
+ $ cd ..
+ $ cd doc.ja
+ $ make
+ </programlisting>
+ You will see English HTML docs under doc/src/sgml/html, and online docs under sgml/man[1-8].
+ Japanese docs can be found under doc.ja/src/sgml/html, and online docs under sgml/man[1-8].
+ </para>
+ </sect2>
+ </sect1>
+
+ &installation-rpm;
+
+ &installation-tips;
+
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/intro.sgml -->
+
+<preface id="preface">
+ <!--
+ <title>Preface</title>
+ -->
+ <title>前言</title>
+
+ <para>
+ This book is the official documentation of
+ <productname>Pgpool-II</productname>. It has been written by the
+ <productname>Pgpool-II</productname> developers and other
+ volunteers in parallel to the development of the
+ <productname>Pgpool-II</productname> software. It describes all
+ the functionality that the current version of
+ <productname>Pgpool-II</productname> officially supports.
+ </para>
+
+ <para>
+ To make the large amount of information about
+ <productname>Pgpool-II</productname> manageable, this book has been
+ organized in several parts. Each part is targeted at a different
+ class of users, or at users in different stages of their
+ <productname>Pgpool-II</productname> experience:
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <xref linkend="tutorial"> is an informal introduction for new users.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <xref linkend="admin"> describes the installation and
+ administration of the server. Everyone who runs a
+ <productname>Pgpool-II</productname> server, be it for private
+ use or for others, should read this part.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <xref linkend="examples"> explains several configuration examples
+ so that users can choose the starting point of their actual systems.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <xref linkend="reference"> contains reference information about
+ SQL commands, client and server programs. This part supports
+ the other parts with structured information sorted by command or
+ program.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <xref linkend="appendixes"> is an appendix information such as release notes.
+ </para>
+ </listitem>
+
+ <!--
+ <listitem>
+ <para>
+ <xref linkend="internals"> contains assorted information that might be of
+ use to <productname>PostgreSQL</> developers.
+ </para>
+ </listitem>
+ -->
+
+ </itemizedlist>
+ </para>
+
+ <sect1 id="intro-whatis">
+ <!--
+ <title> What is <productname>Pgpool-II</productname>?</title>
+ -->
+ <title>什么是<productname>Pgpool-II</productname>?</title>
+ <para>
+ <productname>Pgpool-II</productname> is a proxy software that sits
+ between <productname>PostgreSQL</productname> servers and a
+ <productname>PostgreSQL</productname> database client. It provides
+ the following features:
+
+ <variablelist>
+
+ <varlistentry>
+ <term>Connection Pooling</term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> maintains established
+ connections to the <productname>PostgreSQL</productname>
+ servers, and reuses them whenever a new connection with the
+ same properties (i.e. user name, database, protocol version, and other connection parameters if any)
+ comes in. It reduces the connection overhead, and improves
+ system's overall throughput.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Load Balancing</term>
+ <listitem>
+ <para>
+ If a database is replicated (because running in either
+ replication mode or native replication mode), performing a SELECT
+ query on any server will return the same result. <productname>Pgpool-II</productname>
+ takes advantage of the replication feature in order to reduce
+ the load on each PostgreSQL server. It does that by
+ distributing SELECT queries among available servers, improving
+ the system's overall throughput. In an ideal scenario, read
+ performance could improve proportionally to the number of
+ PostgreSQL servers. Load balancing works best in a scenario
+ where there are a lot of users executing many read-only
+ queries at the same time.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Automated fail over</term>
+ <listitem>
+ <para>
+ If one of the database servers goes down or becomes unreachable,
+ <productname>Pgpool-II</productname> will detach it and will continue operations by using the rest
+ of database servers. There are some sophisticated features that
+ help the automated failover including timeouts and retries.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Online Recovery</term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> can perform online recovery of database
+ node by executing one command. When the online recovery is used with the
+ automated fail over, a detached node by fail over is possible to attach as
+ standby node automatically. It is possible to synchronize and attach new
+ <productname>PostgreSQL</productname> server too.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Replication</term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> can manage
+ multiple <productname>PostgreSQL</productname>
+ servers. Activating the replication feature makes it possible
+ to create a real time backup on 2 or
+ more <productname>PostgreSQL</productname> clusters, so that
+ the service can continue without interruption if one of those
+ clusters fails. <productname>Pgpool-II</productname> has
+ built-in replication (native replication). However user can
+ use external replication features including streaming
+ replication of <productname>PostgreSQL</productname>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Limiting Exceeding Connections</term>
+ <listitem>
+ <para>
+ There is a limit on the maximum number of concurrent
+ connections with <productname>PostgreSQL</productname>, and
+ new connections are rejected when this number is
+ reached. Raising this maximum number of connections, however,
+ increases resource consumption and has a negative impact on
+ overall system
+ performance. <productname>Pgpool-II</productname> also has a
+ limit on the maximum number of connections, but extra
+ connections will be queued instead of returning an error
+ immediately. However, you can configure to return an error
+ when the connection limit is exceeded (4.1 or later).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Watchdog</term>
+ <listitem>
+ <para>
+ Watchdog can coordinate multiple <productname>Pgpool-II</productname>,
+ create a robust cluster system and avoid the single point of failure or split brain.
+ To avoid the split brain, you need at least 3 <productname>Pgpool-II</productname> nodes.
+ Watchdog can perform lifecheck against other <productname>pgpool-II</productname> nodes,
+ to detect a fault of <productname>Pgpool-II</productname>.
+ If active <productname>Pgpool-II</productname> goes down, standby
+ <productname>Pgpool-II</productname> can be promoted to active, and take over Virtual IP.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>In Memory Query Cache</term>
+ <listitem>
+ <para>
+ In memory query cache allows to save a pair of SELECT statement and its result.
+ If an identical SELECTs comes in, <productname>Pgpool-II</productname> returns the
+ value from cache. Since no SQL parsing nor access to <productname>PostgreSQL</productname>
+ are involved, using in memory cache is extremely fast. On the other hand, it might
+ be slower than the normal path in some cases, because it adds some overhead of storing cache data.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </para>
+
+ <para>
+ <productname>Pgpool-II</productname> speaks PostgreSQL's backend
+ and frontend protocol, and relays messages between a backend and a
+ frontend. Therefore, a database application (frontend) thinks
+ that <productname>Pgpool-II</productname> is the
+ actual <productname>PostgreSQL</productname> server, and the
+ server (backend) sees <productname>Pgpool-II</productname> as one
+ of its clients. Because
+ <productname>Pgpool-II</productname> is transparent to both the server and the client, an
+ existing database application can be used with <productname>Pgpool-II</productname> almost
+ without a change to its source code.
+ </para>
+
+ <para>
+ <productname>Pgpool-II</productname> works on Linux, Solaris,
+ FreeBSD, and most of the UNIX-like architectures. Windows is not
+ supported. Supported PostgreSQL server's versions are 7.4 and
+ higher. You must also make
+ sure that all of your <productname>PostgreSQL</productname>
+ servers are using the same major version. In addition to this, we
+ do not recommend mixing
+ different <productname>PostgreSQL</productname> installation with
+ different build options: including supporting SSL or not, to use
+ --disable-integer-datetimes or not, different block size. These
+ might affect part of functionality
+ of <productname>Pgpool-II</productname>. The difference of
+ <productname>PostgreSQL</productname> minor versions is not
+ usually a problem. However we do not test every occurrence of
+ minor versions and we recommend to use exact same minor version of
+ <productname>PostgreSQL</productname>.
+ </para>
+
+ <para>
+ There are some restrictions to using SQL via <productname>Pgpool-II</productname>.
+ See <link linkend="restrictions">Restrictions</link> for more details.
+ </para>
+
+ </sect1>
+
+ &history;
+ ¬ation;
+ &info;
+ &restrictions;
+ &problems;
+
+</preface>
--- /dev/null
+% doc/src/sgml/jadetex.cfg
+%
+% This file redefines \FlowObjectSetup and some related macros to greatly
+% reduce the number of control sequence names created, and also to avoid
+% creation of many useless hyperlink anchors (bookmarks) in PDF files.
+%
+% The original coding of \FlowObjectSetup defined a control sequence x@LABEL
+% for pretty nearly every flow object in the file, whether that object was
+% cross-referenced or not. Worse yet, it created a hyperlink anchor for
+% every such object, which not only bloated the output PDF with useless
+% anchors but consumed an additional control sequence name per anchor.
+% This results in overrunning TeX's limited-size string pool.
+%
+% To fix, extend \PageLabel's already-existing mechanism whereby a p@LABEL
+% control sequence is filled in only for labels that are referenced by at
+% least one \Pageref call. We now also fill in p@LABEL for labels that are
+% referenced by a \Link. Then, we can drop x@LABEL entirely, and use p@LABEL
+% to control emission of both a hyperlink anchor and a page-number label.
+% Now, both of those things are emitted for all and only the flow objects
+% that have either a hyperlink reference or a page-number reference.
+% We consume about one control sequence name per flow object plus one per
+% referenced object, which is a lot better than three per flow object.
+%
+% (With a more invasive patch, we could track the need for an anchor and a
+% page-number label separately, but that would probably require two control
+% sequences for every flow object. Besides, many objects that have one kind
+% of reference will have the other one too; that's certainly true for objects
+% referenced in either the TOC or the index, for example.)
+%
+%
+% In addition to checking p@LABEL not x@LABEL, this version of \FlowObjectSetup
+% is fixed to clear \Label and \Element whether or not it emits an anchor
+% and page label. Failure to do that seems to explain some pre-existing bugs
+% in which certain SGML constructs weren't correctly cross-referenced.
+%
+\def\FlowObjectSetup#1{%
+\ifDoFOBSet
+ \ifLabelElements
+ \ifx\Label\@empty\let\Label\Element\fi
+ \fi
+ \ifx\Label\@empty\else
+ \expandafter\ifx\csname p@\Label\endcsname\relax
+ \else
+ \bgroup
+ \ifNestedLink
+ \else
+ \hyper@anchorstart{\Label}\hyper@anchorend
+ \PageLabel{\Label}%
+ \fi
+ \egroup
+ \fi
+ \let\Label\@empty
+ \let\Element\@empty
+ \fi
+\fi
+}
+%
+% Adjust \PageLabel so that the p@NAME control sequence acquires a correct
+% value immediately; this seems to be needed to avoid scenarios wherein
+% additional TeX runs are needed to reach a stable state of the .aux file.
+%
+\def\PageLabel#1{%
+ \@bsphack
+ \expandafter\ifx\csname p@#1\endcsname\relax
+ \else
+ \protected@write\@auxout{}%
+ {\string\pagelabel{#1}{\thepage}}%
+ % Ensure the p@NAME control sequence acquires correct value immediately
+ \expandafter\xdef\csname p@#1\endcsname{\thepage}%
+ \fi
+ \@esphack}
+%
+% In \Link, add code to emit an aux-file entry if the p@NAME sequence isn't
+% defined. Much as in \@Setref, this ensures we'll process the referenced
+% item correctly on the next TeX run.
+%
+\def\Link#1{%
+ \begingroup
+ \SetupICs{#1}%
+ \ifx\Label\@empty\let\Label\Element\fi
+% \typeout{Made a Link at \the\inputlineno, to \Label}%
+ \hyper@linkstart{\LinkType}{\Label}%
+ \NestedLinktrue
+ % If p@NAME control sequence isn't defined, emit dummy def to aux file
+ % so it will get defined properly on next run, much as in \@Setref
+ \expandafter\ifx\csname p@\Label\endcsname\relax
+ \immediate\write\@mainaux{\string\pagelabel{\Label}{qqq}}%
+ \fi
+}
--- /dev/null
+<!-- doc/src/sgml/legal.sgml -->
+
+<date>2020</date>
+
+<copyright>
+ <year>2003-2020</year>
+ <holder>The Pgpool Global Development Group</holder>
+</copyright>
+
+<legalnotice id="legalnotice">
+ <title>Legal Notice</title>
+
+ <para>
+ <productname>Pgpool and Pgpool-II</productname> are Copyright © 2003-2020
+ by the Pgpool Global Development Group.
+ </para>
+
+ <para>
+ <productname>PostgreSQL</productname> are Copyright © 1996-2020
+ by the PostgreSQL Global Development Group.
+ </para>
+
+ <para>
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose, without fee, and without a
+ written agreement is hereby granted, provided that the above
+ copyright notice and this paragraph and the following two paragraphs
+ appear in all copies.
+ </para>
+
+ <para>
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
+ PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS
+ SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA
+ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ </para>
+
+ <para>
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+ PROVIDED HEREUNDER IS ON AN <quote>AS-IS</quote> BASIS, AND THE UNIVERSITY OF
+ CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ </para>
+
+</legalnotice>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-config-load-balancing">
+ <title>Load Balancing</title>
+
+ <para>
+ <productname>Pgpool-II</productname> load balancing of SELECT queries
+ works with any clustering mode except raw mode. When enabled
+ <productname>Pgpool-II</productname> sends the writing queries to the
+ <acronym>primary node</acronym> in Native Replication mode, all of the
+ backend nodes in Replication mode, and other queries get load
+ balanced among all backend nodes. To which node the load
+ balancing mechanism sends read queries is decided at the session
+ start time and will not be changed until the session ends unless <xref linkend="guc-statement-level-load-balance"> is specified. However
+ there are some exceptions. See below for more details.
+ </para>
+ <note>
+ <para>
+ Queries which are sent to primary node or replicated because they cannot be balanced are
+ also accounted for in the load balancing algorithm.
+ </para>
+ </note>
+ <note>
+ <para>
+ If you don't want a query that qualifies for the load balancing to be
+ load balanced by <productname>Pgpool-II</productname>, you can put
+ arbitrary comment(<emphasis>/*NO LOAD BALANCE*/</emphasis> is usually used)
+ before the <acronym>SELECT</acronym> statement. This will disable the
+ load balance of the particular query and <productname>Pgpool-II</productname>
+ will send it to the main node (the primary node in Native Replication mode).
+ </para>
+ </note>
+
+ <note>
+ <para>
+ You can check which DB node is assigned as the load balancing
+ node by using <xref linkend="sql-show-pool-nodes">.
+ </para>
+ </note>
+
+ <sect2 id="runtime-config-load-balancing-condition">
+ <title>Condition for Load Balancing</title>
+
+ <para>
+ For a query to be load balanced, all the following requirements
+ must be met:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <productname>PostgreSQL</> version 7.4 or later
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ either in replication mode or native replication mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the query must not be in an explicitly declared transaction
+ (i.e. not in a BEGIN ~ END block)
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ However, if following conditions are met, load balance is possible
+ even if in an explicit transaction
+ <itemizedlist>
+ <listitem>
+ <para>
+ transaction isolation level is not SERIALIZABLE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ transaction has not issued a write query yet (until a write
+ query is issued, load balance is possible. Here "write query"
+ means non SELECT DML or DDL. <EMPHASIS>Before <productname>Pgpool-II</> 4.1</>,
+ SELECTs having write functions as specified in write or
+ read_only function list is not regarded as a write query.)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If write and read_only function list is empty, SELECT having
+ functions which are not volatile is regarded as a read only query.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ it's not SELECT INTO
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ it's not SELECT FOR UPDATE nor FOR SHARE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ it starts with "SELECT" or one of COPY TO STDOUT, EXPLAIN,
+ EXPLAIN ANALYZE SELECT... <xref linkend="guc-ignore-leading-white-space"> = <literal>true</>
+ will ignore leading white space.
+ (Except for SELECTs using writing functions specified in <xref linkend="guc-write-function-list"> or
+ <xref linkend="guc-read-only-function-list">)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ in native replication mode, in addition to above, following conditions must be met:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ does not use temporary tables
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ does not use unlogged tables
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ does not use system catalogs
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <note>
+ <para>
+ You could suppress load balancing by inserting arbitrary
+ comments just in front of the SELECT query:
+ </para>
+ <programlisting>
+ /*REPLICATION*/ SELECT ...
+ </programlisting>
+ <para>
+ If you want to use comments without suppressing load balancing, you can set
+ <xref linkend="guc-allow-sql-comments"> to on.
+ Please refer to <xref linkend="guc-replicate-select"> as well.
+ </para>
+ </note>
+
+ <note>
+ <para>
+ The JDBC driver has an autocommit option. If the autocommit is false,
+ the JDBC driver sends "BEGIN" and "COMMIT" by itself. In this case
+ the same restriction above regarding load balancing will be applied.
+ </para>
+ </note>
+
+ </sect2>
+
+ <sect2 id="runtime-config-writing-queries-may-affect-load-balancing">
+
+ <title>Writing queries may affect Load Balancing</title>
+ <para>
+ In general, read queries are load balanced if certain conditions
+ are met. However, writing queries may affect the load
+ balancing. Here "writing queries" mean all the queries except
+ below:
+ </para>
+
+ <para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ SELECT/WITH without writing functions.
+ Volatile functions are regarded writing functions.
+ You can define your own writing functions by using <xref linkend="guc-write-function-list">
+ or <xref linkend="guc-read-only-function-list">.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ SELECT/WITH without FOR UPDATE/SHARE
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ WITH without DML statements
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ COPY TO STDOUT
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ EXPLAIN
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ EXPLAIN ANALYZE and the query is SELECT not including writing functions
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ SHOW
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+
+ <para>
+ If writing queries appear, succeeding read queries may not be
+ load balanced. i.e. sent to primary node (in streaming
+ replication mode) or main node (in other mode) depending on the
+ setting of <xref linkend="guc-disable-load-balance-on-write">.
+ </para>
+ </sect2>
+
+ <sect2 id="runtime-config-load-balancing-in-streaming-replication">
+
+ <title>Load Balancing in Streaming Replication</title>
+
+ <para>
+ While using Streaming replication and Hot Standby, it is important to
+ determine which query can be sent to the primary or the standby,
+ and which one should not be sent to the standby.
+ <productname>Pgpool-II</>'s Streaming Replication mode carefully
+ takes care of this.
+ </para>
+
+ <para>
+ We distinguish which query should be sent to which node by looking
+ at the query itself.
+ <itemizedlist>
+ <listitem>
+ <para>
+ These queries should be sent to the primary node only
+ <itemizedlist>
+ <listitem>
+ <para>
+ INSERT, UPDATE, DELETE, COPY FROM, TRUNCATE, CREATE, DROP, ALTER, COMMENT
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SELECT ... FOR SHARE | UPDATE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SELECT in transaction isolation level SERIALIZABLE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ LOCK command more strict than ROW EXCLUSIVE MODE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ DECLARE, FETCH, CLOSE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SHOW
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Some transactional commands:
+ <itemizedlist>
+ <listitem>
+ <para>
+ BEGIN READ WRITE, START TRANSACTION READ WRITE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SET TRANSACTION READ WRITE, SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SET transaction_read_only = off
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Two phase commit commands: PREPARE TRANSACTION, COMMIT PREPARED, ROLLBACK PREPARED
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ LISTEN, UNLISTEN, NOTIFY
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ VACUUM
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Some sequence functions (nextval and setval)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Large objects creation commands
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Multi-statement queries (multiple SQL commands on single line)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ These queries can be sent to both the primary node and the standby node.
+ If load balancing is enabled, these types of queries can be sent to the standby node.
+ However, if delay_threshold is set and the replication delay is higher than
+ <xref linkend="guc-delay-threshold">, queries are sent to the primary node.
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ SELECT not listed above
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ COPY TO STDOUT
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ EXPLAIN
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ EXPLAIN ANALYZE and the query is SELECT not including writing functions
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ SHOW
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ These queries are sent to both the primary node and the standby node
+ <itemizedlist>
+ <listitem>
+ <para>
+ SET
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ DISCARD
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ DEALLOCATE ALL
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In an explicit transaction:
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Transaction starting commands such as BEGIN are sent to both the primary node
+ and the standby node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Following SELECT and some other queries that can be sent to both
+ primary or standby are executed in the transaction or on the standby node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Commands which cannot be executed on the standby such as INSERT are sent
+ to the primary.
+ After one of these commands, even SELECTs are sent to the primary node,
+ This is because these SELECTs might want to see the result of an INSERT immediately.
+ This behavior continues until the transaction closes or aborts.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In the extended protocol, it is possible to determine if the query can
+ be sent to standby or not in load balance mode while parsing the query.
+ The rules are the same as for the non extended protocol.
+ For example, INSERTs are sent to the primary node.
+ Following bind, describe and execute will be sent to the primary node as well.
+ </para>
+
+ <note>
+ <para>
+ If the parse of a SELECT statement is sent to the standby node due to load
+ balancing, and then a DML statement, such as an INSERT, is sent to <productname>Pgpool-II</>,
+ then the parsed SELECT will have to be executed on the primary node.
+ Therefore, we re-parse the SELECT on the primary node.
+ </para>
+ </note>
+
+ <para>
+ Lastly, queries that <productname>Pgpool-II</>'s parser thinks to be an
+ error are sent to the primary node.
+ </para>
+ </sect2>
+
+ <sect2 id="runtime-config-load-balancing-settings">
+
+ <title>Load Balancing Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-load-balance-mode" xreflabel="load_balance_mode">
+ <term><varname>load_balance_mode</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>load_balance_mode</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> enables the
+ load balancing on incoming <acronym>SELECT</acronym> queries.
+ i.e. <acronym>SELECT</acronym> queries from the clients gets distributed to
+ the configured <productname>PostgreSQL</> backends.
+ Default is off.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ignore-leading-white-space" xreflabel="ignore_leading_white_space">
+ <term><varname>ignore_leading_white_space</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>ignore_leading_white_space</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> ignores the
+ white spaces at the beginning of SQL queries in load balancing.
+ It is useful if used with APIs like DBI/DBD:Pg which adds
+ white spaces against the user's intention.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-read-only-function-list" xreflabel="read_only_function_list">
+ <term><varname>read_only_function_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>read_only_function_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a comma separated list of function names that
+ <emphasis>DO NOT</emphasis> update the database. SELECTs including
+ functions <emphasis>not specified </emphasis> in this list are not load balanced.
+ These are replicated among all the DB nodes in Replication mode,
+ sent to the primary node only in other mode.
+ </para>
+ <para>
+ You can use regular expression to match function names,
+ to which <literal>^</> and <literal>$</> are automatically added.
+ </para>
+
+ <example id="example-read-only-function-list-1">
+ <title>Using regular expression</title>
+ <para>
+ If you have prefixed all your read only function
+ with 'get_' or 'select_', You can
+ set the <xref linkend="guc-read-only-function-list"> like below:
+ <programlisting>
+ read_only_function_list = 'get_.*,select_.*'
+ </programlisting>
+ </para>
+ </example>
+
+ <note>
+ <para>
+ If the queries can refer to the function with and without the schema
+ qualification then you must add both entries (with and without
+ schema name) in the list.
+ <programlisting>
+ #For example:
+ #If the queries sometime use "f1()" and other times "public.f1()"
+ #to refer the function f1 then the read_only_function_list
+ #would be configured as follows.
+
+ read_only_function_list = "f1,public.f1"
+
+ </programlisting>
+
+ </para>
+ </note>
+
+ <note>
+ <para>
+ If this parameter and <xref linkend="guc-write-function-list">
+ is empty string, function's volatile proper will be checked. If
+ the property is volatile, the function is regarded as a writing
+ function. This is convenient and recommended way. However this
+ requires one extra query against system catalog for the first
+ time (in the next time cached query result is used and no extra
+ query will be sent). If you don't want to send such query, you
+ can keep on using this parameter.
+ </para>
+ </note>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-write-function-list" xreflabel="write_function_list">
+ <term><varname>write_function_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>write_function_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a comma separated list of function names that
+ <emphasis>DO</emphasis> update the database.
+ SELECTs including functions <emphasis>specified</emphasis> in this list are
+ not load balanced.
+ These are replicated among all the DB nodes in Replication mode,
+ sent to the primary node only in other mode.
+ </para>
+ <para>
+ You can use regular expression to match function names,
+ to which <literal>^</> and <literal>$</> are automatically added.
+ </para>
+
+ <example id="example-write-function-list-1">
+ <title>Using regular expression</title>
+ <para>
+ If you have prefixed all your updating functions
+ with 'set_', 'update_', 'delete_' or 'insert_', You can
+ set the <xref linkend="guc-write-function-list"> like below:
+ <programlisting>
+ write_function_list = 'nextval,setval,set_.*,update_.*,delete_.*,insert_.*'
+ </programlisting>
+ </para>
+ </example>
+
+ <note>
+ <para>
+ If the queries can refer the function with and without the schema
+ qualification then you must add both entries(with and without
+ schema name) in the list.
+ <programlisting>
+ #For example:
+ #If the queries sometime use "f1()" and other times "public.f1()"
+ #to refer the function f1 then the write_function_list
+ #would be configured as follows.
+
+ write_function_list = "f1,public.f1"
+
+ </programlisting>
+
+ </para>
+ </note>
+
+ <note>
+ <para>
+ <xref linkend="guc-write-function-list"> and <xref linkend="guc-read-only-function-list">
+ are mutually exclusive and only one of the two lists can be set in the configuration.
+ </para>
+ </note>
+
+ <example id="example-write-function-list-2">
+ <title>Configuring using <literal>nextval()</literal> and <literal>setval()</literal> to land on proper backend</title>
+ <para>
+ Prior to <productname>Pgpool-II</productname><emphasis>V3.0</emphasis>,
+ <literal>nextval()</literal> and <literal>setval()</literal> were known as functions writing to the database.
+ You can configure this by setting <xref linkend="guc-write-function-list">
+ and <xref linkend="guc-read-only-function-list"> as follows
+ <programlisting>
+ read_only_function_list = ''
+ write_function_list = 'nextval,setval,lastval,currval'
+ </programlisting>
+ </para>
+ </example>
+
+ <note>
+ <para>
+ <productname>PostgreSQL</> also contains <literal>lastval()</literal> and
+ <literal>currval()</literal> in addition to
+ <literal>nextval()</literal> and <literal>setval()</literal>.
+ Though <literal>lastval()</literal> and <literal>currval()</literal>
+ are not writing function type, but it is advised to treat
+ <literal>lastval()</literal> and <literal>currval()</literal>
+ as writing functions to avoid errors which occur when
+ these functions are accidentally load balanced.
+ </para>
+ </note>
+
+ <note>
+ <para>
+ If this parameter and <xref linkend="guc-read-only-function-list">
+ is empty string, function's volatile proper will be checked. If
+ the property is volatile, the function is regarded as a writing
+ function. This is convenient and recommended way. However this
+ requires one extra query against system catalog for the first
+ time (in the next time cached query result is used and no extra
+ query will be sent). If you don't want to send such query, you
+ can keep on using this parameter.
+ </para>
+ </note>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-primary-routing-query-pattern-list" xreflabel="primary_routing_query_pattern_list">
+ <term><varname>primary_routing_query_pattern_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>primary_routing_query_pattern_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a semicolon separated list of SQL patterns that
+ should be sent to primary node.
+ SQL that matched patterns specified in this list are
+ not load balanced.
+ Other than Only Native Replication mode is supported.
+ </para>
+ <para>
+ You can use regular expression to match SQL patterns,
+ to which <literal>^</> and <literal>$</> are automatically added.
+ When using special characters in regular expressions
+ (such as "'", ";", "*", "(", ")", "|", "+", ".", "\", "?", "^", "$",
+ "{","}", "{" or "}", etc.)
+ in SQL patterns, you need to escape them by using "\".
+ SQL pattern specified in this parameter is case-insensitive.
+ </para>
+
+ <example id="example-primary-routing-query-pattern-list-1">
+ <title>Using regular expression</title>
+ <para>
+ If the following SQL should be sent to the primary node only, You can
+ set the <xref linkend="guc-primary-routing-query-pattern-list"> like below:
+ <itemizedlist>
+ <listitem>
+ <para>
+ SELECT * FROM table_name1;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SELECT col1, col2 FROM table_name2 WHERE col1 LIKE '%a%';
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SQL including table_name3
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <programlisting>
+ primary_routing_query_pattern_list = 'SELECT \* FROM table_name1\;;SELECT col1, col2 FROM table_name2 WHERE col1 LIKE \'%a%\'\;;.*table_name3.*'
+ </programlisting>
+ </para>
+ </example>
+
+ <note>
+ <para>
+ If SQL matches both <xref linkend="guc-write-function-list"> and
+ <xref linkend="guc-read-only-function-list">, <xref linkend="guc-read-only-function-list">
+ setting is ignored and the SQL should be sent only to the primary node.
+ </para>
+ </note>
+ <para>
+ Depending on the SQL patterns, performance might be 1-2% lower when using this feature.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-database-redirect-preference-list" xreflabel="database_redirect_preference_list">
+ <term><varname>database_redirect_preference_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>database_redirect_preference_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the list of <replaceable>"database-name:node id(ratio)"</replaceable> pairs
+ to send <acronym>SELECT</acronym> queries to a particular backend
+ node for a particular database connection at a specified load balance ratio.
+ The load balance ratio specifies a value between 0 and 1. The default is 1.0.
+ </para>
+ <para>
+ For example, by specifying "test:1(0.5)", <productname>Pgpool-II</productname>
+ will redirect 50% <acronym>SELECT</acronym> queries to the backend node of ID 1 for
+ the connection to "test" database.
+ You can specify multiple <replaceable>"database name:node id"</replaceable> pair by separating them
+ using comma (,).
+ </para>
+ <para>
+ Regular expressions are also accepted for database name.
+ You can use special keywords as <replaceable>node id</replaceable>.
+ If <emphasis>"primary"</emphasis> is specified, queries are sent to the primary node, and
+ if <emphasis>"standby"</emphasis> is specified, one of the standby nodes are selected randomly
+ based on weights (<xref linkend="guc-backend-weight">).
+ </para>
+
+ <example id="example-database-redirect-list">
+ <title>Using database_redirect_preference_list</title>
+ <para>
+ If you want to configure the following <acronym>SELECT</acronym> query routing rules:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Route all <acronym>SELECT</acronym> queries on <literal>postgres</literal>
+ database to the primary backend node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Route 30% <acronym>SELECT</acronym> queries on <literal>mydb0</literal> or on
+ <literal>mydb1</literal> databases to backend node of ID.
+ The other 70% <acronym>SELECT</acronym> queries will be sent to other backend nodes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Route all <acronym>SELECT</acronym> queries on <literal>mydb2</literal>
+ database to standby backend nodes.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ <para>
+ then the <xref linkend="guc-database-redirect-preference-list"> will be configured as follows:
+ <programlisting>
+ database_redirect_preference_list = 'postgres:primary,mydb[01]:1(0.3),mydb2:standby'
+ </programlisting>
+ </para>
+ </example>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-app-name-redirect-preference-list" xreflabel="app_name_redirect_preference_list">
+ <term><varname>app_name_redirect_preference_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>app_name_redirect_preference_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the list of <replaceable>"application-name:node id(ratio)"</replaceable> pairs
+ to send <acronym>SELECT</acronym> queries to a particular backend
+ node for a particular client application connection at a specified load balance ratio.
+ </para>
+
+ <note>
+ <para>
+ In <productname>PostgreSQL</> <emphasis>V9.0</> or later the "Application name" is a name specified
+ by a client when it connects to database.
+ </para>
+ </note>
+
+ <para>
+ For example, application name of <command>psql</command> command is
+ <literal>"psql"</literal>.
+ </para>
+
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> recognizes the application name
+ only specified in the start-up packet.
+ Although a client can provide the application name
+ later in the session, but that does not get considered by the
+ <productname>Pgpool-II</productname> for query routing.
+ </para>
+ </note>
+
+ <para>
+ The notion of <xref linkend="guc-app-name-redirect-preference-list">
+ is same as the <xref linkend="guc-database-redirect-preference-list">
+ thus you can also use the regular expressions for application names.
+ Similarly special keyword <emphasis>"primary"</emphasis> indicates the primary node and
+ <emphasis>"standby"</emphasis> indicates one of standby nodes.
+ The load balance weight specifies a value between 0 and 1. The default is 1.0.
+ </para>
+
+ <example id="example-app-name-redirect-list">
+ <title>Using app-name_redirect_preference_list</title>
+ <para>
+ If you want to configure the following <acronym>SELECT</acronym> query routing rules:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Route all <acronym>SELECT</acronym> from <literal>psql</literal>
+ client to the primary backend node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Route 30% <acronym>SELECT</acronym> queries from <literal>myapp1</literal>
+ client to backend node of ID 1. The other 70% SELECT queries will be sent to other backend nodes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Route all <acronym>SELECT</acronym> queries from <literal>myapp2</literal>
+ client to standby backend nodes.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ <para>
+ then the <xref linkend="guc-app-name-redirect-preference-list"> will be configured as follows:
+ <programlisting>
+ app_name_redirect_preference_list = 'psql:primary,myapp1:1(0.3),myapp2:standby'
+ </programlisting>
+ </para>
+ </example>
+
+ <note>
+ <para>
+ <xref linkend="guc-app-name-redirect-preference-list"> takes precedence
+ over the <xref linkend="guc-database-redirect-preference-list">.
+ </para>
+ <para>
+ For example, if you set
+ <literal>database_redirect_preference_list = 'postgres:standby(1.0)'</literal> and
+ <literal>app_name_redirect_preference_list = 'myapp1:primary(1.0)'</literal>,
+ all SELECT from application myapp1 on postgres database will be sent to primary backend node.
+ </para>
+ </note>
+
+ <note>
+ <para>
+ By specifying of <xref linkend="guc-app-name-redirect-preference-list"> and
+ <xref linkend="guc-database-redirect-preference-list">, when multiple database
+ names and application names are matched, the first setting will be used.
+ </para>
+ <para>
+ For example, if you set
+ <literal>database_redirect_preference_list = 'postgres:primary,postgres:standby'</literal>,
+ <literal>"postgres: primary"</literal> will be used.
+ </para>
+ </note>
+
+ <caution>
+ <para>
+ <acronym>JDBC</acronym> driver PostgreSQL-9.3 and earlier versions
+ does not send the application name in the startup packet even if
+ the application name is specified using the <acronym>JDBC</acronym>
+ driver option <literal>"ApplicationName"</literal> and
+ <literal>"assumeMinServerVersion=9.0"</literal>.
+ So if you want to use the <xref linkend="guc-app-name-redirect-preference-list">
+ feature through <acronym>JDBC</acronym>, Use PostgreSQL-9.4 or later version of the driver.
+ </para>
+ </caution>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-allow-sql-comments" xreflabel="allow_sql_comments">
+ <term><varname>allow_sql_comments</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>allow_sql_comments</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> ignore the
+ <acronym>SQL</acronym> comments when identifying if the load balance
+ or query cache is possible on the query.
+ When this parameter is set to off, the <acronym>SQL</acronym> comments
+ on the query could effectively prevent the query from being
+ load balanced or cached (pre <productname>Pgpool-II</productname>
+ <emphasis>V3.4</emphasis> behavior).
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-disable-load-balance-on-write" xreflabel="disable_load_balance_on_write">
+ <term><varname>disable_load_balance_on_write</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>disable_load_balance_on_write</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specify load balance behavior after write queries appear.
+ This parameter is especially useful in streaming replication
+ mode. When write queries are sent to primary server, the
+ changes are applied to standby servers but there's a time
+ lag. So if a client read the same row right after the write
+ query, the client may not see the latest value of the
+ row. If that's the problem, clients should always read data
+ from the primary server. However this effectively disables
+ load balancing, which leads to lesser performance. This
+ parameter allows a fine tuning for the trade off between
+ not-clustering-aware applications compatibility and
+ performance.
+ </para>
+ <para>
+ If this parameter is set to <varname>off</varname>, read
+ queries are load balanced even if write queries appear. This
+ gives the best load balance performance but clients may see
+ older data. This is useful for an environment where
+ PostgreSQL parameter synchronous_commit = 'remote_apply', or
+ in the native replication mode, since there's no replication
+ delay in such environments.
+ </para>
+ <para>
+ If this parameter is set to <varname>transaction</varname>
+ and write queries appear in an explicit transaction,
+ subsequent read queries are not load balanced until the
+ transaction ends. Please note that read queries not in an
+ explicit transaction are not affected by the parameter. This
+ setting gives the best balance in most cases and you should
+ start from this. This is the default and same behavior in
+ <productname>Pgpool-II 3.7</productname> or before.
+ </para>
+ <para>
+ If this parameter is set
+ to <varname>trans_transaction</varname> and write queries
+ appear in an explicit transaction, subsequent read queries
+ are not load balanced in the transaction and subsequent
+ explicit transaction until the session ends. So this
+ parameter is safer for older applications but give lesser
+ performance than <varname>transaction</varname>. Please note
+ that read queries not in an explicit transaction are not
+ affected by the parameter.
+ </para>
+
+ <para>
+ If this parameter is set to <varname>always</varname> and
+ write queries appear, subsequent read queries are not load
+ balanced until the session ends regardless they are in
+ explicit transactions or not. This gives the highest
+ compatibility with not-clustering-aware applications and the
+ lowest performance.
+ </para>
+
+ <para>
+ If this parameter is set to <varname>dml_adaptive</varname> <productname>Pgpool-II</>
+ keep track of each TABLE referenced in the WRITE statements within
+ the explicit transactions and will not load balances the subsequent
+ READ queries if the TABLE they are reading from is previously modified
+ inside the same transaction.
+ Dependent functions, triggers, and views on the tables can be configured
+ using <xref linkend="guc-dml-adaptive-object-relationship-list">
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-dml-adaptive-object-relationship-list" xreflabel="dml_adaptive_object_relationship_list">
+ <term><varname>dml_adaptive_object_relationship_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>dml_adaptive_object_relationship_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ To prevent load balancing of READ dependent objects, you may specify the object name
+ followed by a colon(<literal>:</>) and then a comma(<literal>,</>) separated list of dependent object names.
+ <replaceable>"[object]:[dependent-object]"</replaceable>
+ In an explicit transaction block after a WRITE statement has been issues, this will prevent
+ load balancing of any READ statements containing references of dependent object(s).
+ <example id="example-dml-adaptive-object-relationship-list-1">
+ <title>Configuring dml adaptive object relationship</title>
+ <para>
+ If you have a trigger installed on table_1 that do INSERT in <literal>table_2</> for each
+ INSERT on <literal>table_1</>. Then you would want to make sure that
+ read on <literal>table_2</> must not get load-balanced within the same transaction
+ after INSERT into <literal>table_1</>.
+ For this configuration you can set
+ <programlisting>
+ dml_adaptive_object_relationship_list = 'table_1:table_2'
+ </programlisting>
+ </para>
+ </example>
+
+ This parameter is only valid for
+ <xref linkend="guc-disable-load-balance-on-write">=<emphasis>'dml_adaptive'</emphasis>
+
+ <note>
+ <para>
+ To configure the dependency on the function,
+ The function must be present in the <xref linkend="guc-write-function-list">
+ </para>
+ </note>
+
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-statement-level-load-balance" xreflabel="statement_level_load_balance">
+ <term><varname>statement_level_load_balance</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>statement_level_load_balance</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, the load balancing node is decided for each read query.
+ When set to off, load balancing node is decided at the session start time
+ and will not be changed until the session ends.
+ For example, in applications that use connection pooling remain connections
+ open to the backend server, because the session may be held for a long time,
+ the load balancing node does not change until the session ends.
+ In such applications, When <varname>statement_level_load_balance</varname> is enabled,
+ it is possible to decide load balancing node per query, not per session.
+ The default is off.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-in-memory-query-cache">
+ <title>In Memory Query Cache</title>
+
+ <para>
+ In memory query cache can be used with all modes of
+ <productname>Pgpool-II</productname>.
+ <productname>Pgpool-II</productname> does not
+ need a restart when the cache gets outdated because of
+ the underlying table updates.
+ </para>
+ <para>
+ In memory cache saves the pair of SELECT statement
+ and its result
+ (along with the Bind parameters, if the SELECT is an
+ extended query). If the same SELECTs comes in,
+ <productname>Pgpool-II</productname> returns the value from
+ cache. Since no <acronym>SQL</acronym> parsing nor access
+ to <productname>PostgreSQL</productname> are involved, the serving
+ of results from the in memory cache is extremely fast.
+ </para>
+
+ <note>
+ <para>
+ Basically following SELECTs will not be cached:
+ <programlisting>
+ SELECTs including non immutable functions
+ SELECTs including temp tables, unlogged tables
+ SELECT result is too large (memqcache_maxcache)
+ SELECT FOR SHARE/UPDATE
+ SELECT starting with "/*NO QUERY CACHE*/" comment
+ SELECT including system catalogs
+ SELECT uses TABLESAMPLE
+ </programlisting>
+ However, VIEWs and SELECTs accessing unlogged tables can be
+ cached by specifying in
+ the <xref linkend="guc-cache-safe-memqcache-table-list">.
+ </para>
+ </note>
+
+ <para>
+ On the other hand, it might be slower than the normal path
+ in some cases, because it adds some overhead to store cache.
+ Moreover when a table is updated, <productname>Pgpool-II
+ </productname> automatically deletes all the caches related to the
+ table. Therefore, the performance will be degraded by a system with
+ a lot of updates. If the query cache hit ratio (it can be checked
+ by using <xref linkend="SQL-SHOW-POOL-CACHE">) is lower than 70%,
+ you might want to disable in memory cache.
+ </para>
+
+ <sect2 id="runtime-in-memory-query-cache-enabling">
+ <title>Enabling in memory query cache</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-memory-cache-enabled" xreflabel="memory_cache_enabled">
+ <term><varname>memory_cache_enabled</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>memory_cache_enabled</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on enables the memory cache.
+ Default is off.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+
+ <note>
+ <para>
+ The query cache will also be used by shared relation cache if
+ <xref linkend="guc-enable-shared-relcache"> is set to on. Moreover the
+ query cache is used even if <xref linkend="guc-memory-cache-enabled">
+ parameter is set to off. See <xref linkend="runtime-misc"> for more details to relation cache.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-in-memory-query-cache-choose-storage">
+ <title>Choosing cache storage</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-memqcache-method" xreflabel="memqcache_method">
+ <term><varname>memqcache_method</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>memqcache_method</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the storage type to be used for the cache.
+ Below table contains the list of all valid values for the parameter.
+ </para>
+
+ <table id="memqcache-method-table">
+ <title>Memcache method options</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Value</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>'shmem'</literal></entry>
+ <entry>Use shared memory</entry>
+ </row>
+
+ <row>
+ <entry><literal>'memcached'</literal></entry>
+ <entry>Use <ulink url="http://memcached.org/">memcached</ulink></entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ Default is <literal>'shmem'</literal>.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-in-memory-query-cache-config">
+ <title>Common configurations</title>
+ <para>
+ These below parameter are valid for both <literal>shmem</literal>
+ and <literal>memcached</literal> type query cache.
+ </para>
+ <variablelist>
+
+ <varlistentry id="guc-memqcacheexpire" xreflabel="memqcache_expire">
+ <term><varname>memqcache_expire</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>memqcache_expire</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the life time of query cache in seconds.
+ Default is 0. which means no cache expiration and cache remains
+ valid until the table is updated.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ </para>
+
+ <note>
+ <para>
+ <varname>memqcache_expire</varname> and
+ <xref linkend="guc-memqcache-auto-cache-invalidation"> are orthogonal to each other.
+ </para>
+ </note>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-memqcache-auto-cache-invalidation" xreflabel="memqcache_auto_cache_invalidation">
+ <term><varname>memqcache_auto_cache_invalidation</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>memqcache_auto_cache_invalidation</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Setting to on, automatically deletes the cache related to the updated tables.
+ When off, cache is not deleted.
+ </para>
+ <para>
+ Default is on.
+ </para>
+ <note>
+ <para>
+ This parameters <xref linkend="guc-memqcache-auto-cache-invalidation">
+ and <xref linkend="guc-memqcacheexpire"> are orthogonal to each other.
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-memqcache-maxcache" xreflabel="memqcache_maxcache">
+ <term><varname>memqcache_maxcache</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>memqcache_maxcache</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the maximum size in bytes of the SELECT query result to be cached.
+ The result with data size larger than this value will not be cached by
+ <productname>Pgpool-II</productname>.
+ When the caching of data is rejected because of the size constraint the following
+ message is shown.
+ <programlisting>
+ LOG: pid 13756: pool_add_temp_query_cache: data size exceeds memqcache_maxcache. current:4095 requested:111 memq_maxcache:4096
+ </programlisting>
+ </para>
+ <note>
+ <para>
+ For the shared memory query(<literal>'shmem'</literal>) cache the
+ <varname>memqcache_maxcache</varname> must be set lower than
+ <xref linkend="guc-memqcache-cache-block-size"> and for <literal>'memcached'</literal>
+ it must be lower than the size of slab (default is 1 MB).
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-cache-safe-memqcache-table-list" xreflabel="cache_safe_memqcache_table_list">
+ <term><varname>cache_safe_memqcache_table_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>cache_safe_memqcache_table_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies a comma separated list of table names whose
+ SELECT results should be cached by
+ <productname>Pgpool-II</productname>. This parameter only
+ applies to VIEWs and SELECTs accessing unlogged tables.
+ Regular tables can be cached unless specified
+ by <xref linkend="guc-cache-unsafe-memqcache-table-list">.
+ </para>
+
+ <para>
+ You can use regular expression into the list to match table name
+ (to which ^ and $ are automatically added).
+ </para>
+
+ <note>
+ <para>
+ If the queries can refer the table with and without the schema
+ qualification then you must add both entries(with and without
+ schema name) in the list.
+ <programlisting>
+ #For example:
+ #If the queries sometime use "table1" and other times "public.table1"
+ #to refer the table1 then the cache_safe_memqcache_table_list
+ #would be configured as follows.
+
+ cache_safe_memqcache_table_list = "table1,public.table1"
+
+ </programlisting>
+
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-cache-unsafe-memqcache-table-list" xreflabel="cache_unsafe_memqcache_table_list">
+ <term><varname>cache_unsafe_memqcache_table_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>cache_unsafe_memqcache_table_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a comma separated list of table names whose SELECT
+ results should <emphasis>NOT</emphasis> be cached by the <productname>
+ Pgpool-II</productname>.
+ </para>
+
+ <para>
+ You can use regular expression into the list to match table name
+ (to which ^ and $ are automatically added),
+ </para>
+
+ <note>
+ <para>
+ If the queries can refer the table with and without the schema
+ qualification then you must add both entries(with and without
+ schema name) in the list.
+ <programlisting>
+ #For example:
+ #If the queries sometime use "table1" and other times "public.table1"
+ #to refer the table1 then the cache_unsafe_memqcache_table_list
+ #would be configured as follows.
+
+ cache_unsafe_memqcache_table_list = "table1,public.table1"
+
+ </programlisting>
+
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ <note>
+ <para>
+ <varname>cache_unsafe_memqcache_table_list</varname>
+ precedence over <xref linkend="guc-cache-safe-memqcache-table-list">
+ </para>
+ </note>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-memqcache-oiddir" xreflabel="memqcache_oiddir">
+ <term><varname>memqcache_oiddir</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>memqcache_oiddir</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the full path to the directory for storing the
+ <literal>oids</literal> of tables used by SELECT queries.
+ </para>
+ <para>
+ <varname>memqcache_oiddir</varname> directory contains the sub directories
+ for the databases. The directory name is the OID of the database. In addition, each
+ database directory contains the files for each table used by SELECT statement.
+ Again the name of the file is the OID of the table.
+ These files contains the pointers to query cache which are used as key for
+ deleting the caches.
+ </para>
+ <note>
+ <para>
+ Normal restart of <productname>Pgpool-II</productname> does not clear the
+ contents of <varname>memqcache_oiddir</varname>.
+ </para>
+ </note>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-in-memory-query-cache-shmem-config">
+ <title>Configurations to use shared memory</title>
+
+ <para>
+ These are the parameters used with shared memory as the cache storage.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-memqcache-total-size" xreflabel="memqcache_total_size">
+ <term><varname>memqcache_total_size</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>memqcache_total_size</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the shared memory cache size in bytes.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-memqcache-max-num-cache" xreflabel="memqcache_max_num_cache">
+ <term><varname>memqcache_max_num_cache</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>memqcache_max_num_cache</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the number of cache entries. This is used to define the size of cache management space.
+ </para>
+ <note>
+ <para>
+ The management space size can be calculated by:
+ <varname>memqcache_max_num_cache</varname> * 48 bytes.
+ Too small number will cause an error while registering cache.
+ On the other hand too large number will just waste space.
+ </para>
+ </note>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-memqcache-cache-block-size" xreflabel="memqcache_cache_block_size">
+ <term><varname>memqcache_cache_block_size</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>memqcache_cache_block_size</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the cache block size. <productname>Pgpool-II</productname> uses the
+ cache memory arranged in <varname>memqcache_cache_block_size</varname> blocks.
+ SELECT result is packed into the block and must fit in a single block.
+ And the results larger than <varname>memqcache_cache_block_size</varname> are
+ not cached.
+ </para>
+
+ <para>
+ <varname>memqcache_cache_block_size</varname> must be set to at least 512.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-in-memory-query-cache-memcached-config">
+ <title>Configurations to use memcached</title>
+
+ <para>
+ These are the parameters used with memcached as the cache storage.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-memqcache-memcached-host" xreflabel="memqcache_memcached_host">
+ <term><varname>memqcache_memcached_host</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>memqcache_memcached_host</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the host name or the IP address on which <literal>memcached</literal>
+ works. You can use <literal>'localhost'</literal> if <literal>memcached</literal>
+ and <productname>Pgpool-II</productname> resides on same server.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-memqcache-memcached-port" xreflabel="memqcache_memcached_port">
+ <term><varname>memqcache_memcached_port</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>memqcache_memcached_port</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the port number of <acronym>memcached</acronym>.
+ Default is 11211.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-misc">
+ <title>Misc Configuration Parameters</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-relcache-expire" xreflabel="relcache_expire">
+ <term><varname>relcache_expire</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>relcache_expire</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the relation cache expiration time in seconds.
+ The relation cache is used for caching the query result of
+ <productname>PostgreSQL</> system catalogs that is used by <productname>Pgpool-II
+ </productname> to get various information including the table
+ structures and to check table types(e.g. To check if the referred
+ table is a temporary table or not). The cache is maintained in
+ the local memory space of <productname>Pgpool-II</productname>
+ child process and its lifetime is same as of the child process.
+ The cache is also maintained in shared memory to share among child
+ processes,if enable <xref linkend="guc-enable-shared-relcache">.
+ So If the table is modified using <command>ALTER TABLE</command>
+ or some other means, the relcache becomes inconsistent.
+ For this purpose, <varname>relcache_expire</varname> controls
+ the life time of the cache.
+ Default is 0, which means the cache never expires.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-relcache-size" xreflabel="relcache_size">
+ <term><varname>relcache_size</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>relcache_size</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the number of relcache entries. Default is 256.
+ The cache is created about 10 entries per table. So you can estimate
+ the required number of relation cache at "number of using table * 10".
+ </para>
+ <note>
+ <para>
+ If the below message frequently appears in the
+ <productname>Pgpool-II</productname> log, you may need to
+ increase the <varname>relcache_size</varname> for better performance.
+ <programlisting>
+ "pool_search_relcache: cache replacement happened"
+ </programlisting>
+ </para>
+ </note>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-enable-shared-relcache" xreflabel="enable_shared_relcache">
+ <term><varname>enable_shared_relcache</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>enable_shared_relcache</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ By setting to on, relation cache is shared among
+ <productname>Pgpool-II</productname> child processes using the in
+ memory query cache (see <xref
+ linkend="runtime-in-memory-query-cache-enabling"> for more
+ details). Default is on. Each child process needs to access to
+ the system catalog from <productname>PostgreSQL</productname>.
+ By enabling this feature, other process can extract the catalog
+ lookup result from the query cache and it should reduce the
+ frequency of the query. Cache invalidation is not happen even if
+ the system catalog is modified. So it is strongly recommend to
+ set time out base cache invalidation by using <xref
+ linkend="guc-relcache-expire"> parameter.
+ </para>
+ <para>
+ This parameter can be used even if <xref
+ linkend="guc-memory-cache-enabled"> is off. In this case some
+ query cache parameters(<xref linkend="guc-memqcache-method">,
+ <xref linkend="guc-memqcache-maxcache"> and each cache storage
+ parameter) is used together.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> search the local relation
+ cache first. If it is not found on the cache, the shared relation
+ query cache is searched if this feature is enabled. If it is
+ found on query cache, it is copied into the local relation
+ cache. If a cache entry is not found on anywhere,
+ <productname>Pgpool-II</productname> executes the query against
+ <productname>PostgreSQL</productname>, and the result is stored
+ into the shared relation cache and the local cache.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-relcache-query-target" xreflabel="relcache_query_target">
+ <term><varname>relcache_query_target</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>relcache_query_target</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The target node to send queries to create relation cache
+ entries. If set to <literal>primary</literal>, queries will
+ be sent to primary node. This is the default and
+ recommended to most users because the query could get the
+ latest information. If you want to lower the load of
+ primary node, you can set the parameter to
+ <literal>load_balance_node</literal>, which will send
+ queries to the load balance node. This is especially useful
+ for such a system
+ where <productname>Pgpool-II</productname>/primary server is
+ on a continent A while
+ other <productname>Pgpool-II</productname>/standby server is
+ on other continent B. Clients on B want read data from the
+ standby because it's much geographically closer. In this
+ case you can set backend_weight0 (this represents primary)
+ to 0, backend_weight1 to 1 (this represents standby) and set
+ relcache_query_target
+ to <literal>load_balance_node</literal>.
+ </para>
+ <para>
+ Note, however, if you send query to the standby node,
+ recently created tables and rows might not be available on
+ the standby server yet because of replication delay. Thus
+ such a configuration is not recommended for systems where
+ data modification activity is high.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-check-temp-table" xreflabel="check_temp_table">
+ <term><varname>check_temp_table</varname> (<type>enum</type>)
+ <indexterm>
+ <primary><varname>check_temp_table</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Setting to <literal>catalog</literal>
+ or <literal>trace</literal>, enables the temporary table
+ check in the <acronym>SELECT</acronym> statements. To check
+ the temporary table <productname>Pgpool-II</productname>
+ queries the system catalog of
+ primary/main <productname>PostgreSQL</productname> backend
+ if <literal>catalog</literal> is specified, which
+ increases the load on the primary/main server.
+ </para>
+ <para>
+ If <literal>trace</literal> is
+ set, <productname>Pgpool-II</productname> traces temporary
+ table creation and dropping to obtain temporary table
+ info. So no need to access system catalogs. However, if
+ temporary table creation is invisible
+ to <productname>Pgpool-II</productname> (done in functions
+ or triggers, for
+ example), <productname>Pgpool-II</productname> cannot
+ recognize the creation of temporary tables.
+ </para>
+ <para>
+ If you are absolutely sure that your system never uses
+ temporary tables, then you can safely set to none.
+ </para>
+ <note>
+ <para>
+ For a backward compatibility sake for 4.0 or
+ before, <productname>Pgpool-II</productname>
+ accepts <literal>on</literal>, which is same
+ as <literal>catalog</literal> and <literal>off</literal>,
+ which is same as <literal>none</literal>, they may be
+ deleted in the future version.
+ </para>
+ </note>
+ <para>
+ Default is <literal>catalog</literal>.
+ </para>
+ <para>
+ This parameter can be changed by reloading
+ the <productname>Pgpool-II</productname> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to
+ alter the value of this parameter for a current session.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-check-unlogged-table" xreflabel="check_unlogged_table">
+ <term><varname>check_unlogged_table</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>check_unlogged_table</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Setting to on, enables the unlogged table check in the <acronym>SELECT</acronym>
+ statements. To check the unlogged table <productname>Pgpool-II</productname>
+ queries the system catalog of primary/main <productname>PostgreSQL</> backend which increases
+ the load on the primary/main server.
+ If you are absolutely sure that your system never uses the unlogged tables
+ (for example, you are using 9.0 or earlier version of <productname>PostgreSQL</>) then you
+ can safely turn off the <varname>check_unlogged_table</varname>.
+ Default is on.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-pid-file-name" xreflabel="pid_file_name">
+ <term><varname>pid_file_name</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>pid_file_name</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the full path to a file to store the <productname>Pgpool-II
+ </productname> process id.
+ The pid_file_name path can be specified as relative to the
+ location of pgpool.conf file or as an absolute path
+ Default is <literal>"/var/run/pgpool/pgpool.pid"</literal>.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-logdir" xreflabel="logdir">
+ <term><varname>logdir</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>logdir</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the full path to a directory to store the <literal>pgpool_status</literal>.
+ Default is <literal>'/tmp'</literal>.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+</sect1>
--- /dev/null
+# /usr/bin/perl -w
+
+# doc/src/sgml/mk_feature_tables.pl
+
+my $yesno = $ARGV[0];
+
+open PACK, $ARGV[1] or die;
+
+my %feature_packages;
+
+while (<PACK>)
+{
+ chomp;
+ my ($fid, $pname) = split /\t/;
+ if ($feature_packages{$fid})
+ {
+ $feature_packages{$fid} .= ", $pname";
+ }
+ else
+ {
+ $feature_packages{$fid} = $pname;
+ }
+}
+
+close PACK;
+
+open FEAT, $ARGV[2] or die;
+
+print "<tbody>\n";
+
+while (<FEAT>)
+{
+ chomp;
+ my ($feature_id, $feature_name, $subfeature_id,
+ $subfeature_name, $is_supported, $comments) = split /\t/;
+
+ $is_supported eq $yesno || next;
+
+ $feature_name =~ s/</</g;
+ $feature_name =~ s/>/>/g;
+ $subfeature_name =~ s/</</g;
+ $subfeature_name =~ s/>/>/g;
+
+ print " <row>\n";
+
+ if ($subfeature_id)
+ {
+ print " <entry>$feature_id-$subfeature_id</entry>\n";
+ }
+ else
+ {
+ print " <entry>$feature_id</entry>\n";
+ }
+ print " <entry>" . $feature_packages{$feature_id} . "</entry>\n";
+ if ($subfeature_id)
+ {
+ print " <entry>$subfeature_name</entry>\n";
+ }
+ else
+ {
+ print " <entry>$feature_name</entry>\n";
+ }
+ print " <entry>$comments</entry>\n";
+
+ print " </row>\n";
+}
+
+print "</tbody>\n";
+
+close FEAT;
--- /dev/null
+<!-- doc/src/sgml/notation.sgml -->
+
+<sect1 id="notation">
+ <!--
+ <title>Conventions</title>
+ -->
+ <title>约定</title>
+
+ <para>
+ The following conventions are used in the synopsis of a command:
+ brackets (<literal>[</literal> and <literal>]</literal>) indicate
+ optional parts. (In the synopsis of a Tcl command, question marks
+ (<literal>?</>) are used instead, as is usual in Tcl.) Braces
+ (<literal>{</literal> and <literal>}</literal>) and vertical lines
+ (<literal>|</literal>) indicate that you must choose one
+ alternative. Dots (<literal>...</>) mean that the preceding element
+ can be repeated.
+ </para>
+
+ <para>
+ Where it enhances the clarity, SQL commands are preceded by the
+ prompt <literal>=></>, and shell commands are preceded by the
+ prompt <literal>$</>. Normally, prompts are not shown, though.
+ </para>
+
+ <para>
+ An <firstterm>administrator</firstterm> is generally a person who is
+ in charge of installing and running the server. A <firstterm>user</firstterm>
+ could be anyone who is using, or wants to use, any part of the
+ <productname>Pgpool-II</productname> system. These terms should not
+ be interpreted too narrowly; this book does not have fixed
+ presumptions about system administration procedures.
+ </para>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-online-recovery">
+ <title>Online Recovery</title>
+
+ <para>
+ <productname>Pgpool-II</productname> can synchronize database
+ nodes and attach a node without stopping the service. This
+ feature is called <acronym>"online recovery"</acronym>. Online
+ recovery can be executed by
+ using <xref linkend="pcp-recovery-node"> command.
+ </para>
+ <para>
+ For online recovery, the recovery target node must be in detached
+ state. This means the node must be either manually detached by
+ <xref linkend="pcp-detach-node"> or automatically detached
+ by <productname>Pgpool-II</productname> as a consequence of
+ failover.
+ </para>
+ <para>
+ If you wish to add a <productname>PostgreSQL</productname> server
+ node dynamically, reload the
+ <filename>pgpool.conf</filename> after adding the
+ <xref linkend="guc-backend-hostname"> and its associated
+ parameters. This will register the new server
+ to <productname>Pgpool-II</productname> as a detached backend
+ node, after that you execute <xref linkend="pcp-recovery-node"> command,
+ the server is add.
+ </para>
+ <!--
+ <caution>
+ <para>
+ Make sure that <command>autovacuum</command> is stopped on the
+ main node (the first node which is up and running) before starting the
+ online recovery. Autovacuum can change the contents of the database which
+ can cause the inconsistency after the online recovery.
+ </para>
+ <para>
+ This applies only if you're recovering with a simple copy mechanism,
+ such as the <command>rsync</command> and doesn't apply when using
+ the PostgreSQL's PITR mechanism.
+ </para>
+ </caution>
+ -->
+ <note>
+ <para>
+ The recovery target <productname>PostgreSQL</> server must not
+ be running for performing the online recovery. If the
+ target <productname>PostgreSQL</> server has already started,
+ you must shut it down before starting the online recovery.
+ </para>
+ </note>
+
+ <para>
+ Online recovery is performed in two phases. The first phase is
+ called "first stage" and the second phase is called "second
+ stage". Only <xref linkend="guc-replication-mode"> and <xref
+ linkend="guc-snapshot-isolation-mode"> require the second stage.
+ For other modes including streaming replication mode the second
+ stage is not performed and you don't need to provide a script for
+ the stage in <xref
+ linkend="guc-recovery-2nd-stage-command">. i.e. you can safely leave
+ it as an empty string.
+ </para>
+
+ <para>
+ In the first stage the standby (replica) node is created by using
+ <productname>PostgreSQL</productname>'s
+ <command>pg_basebackup</command>, for example, from a backup of the
+ main (primary) node. Update data while executing the first stage
+ will be logged into the <productname>PostgreSQL</productname>'s
+ transaction log.
+ </para>
+
+ <para>
+ In the second stage the target recovery node is started. The
+ transaction log will be replayed and the replica node will be
+ completely synced with the master node.
+ </para>
+
+ <para>
+ You need to provide scripts for each stage. Complete sample scripts
+ are provided at <ulink
+ url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/master">/etc/pgpool-II/recovery_1st_stage.sample</ulink>
+ and <ulink
+ url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_2nd_stage.sample;hb=refs/heads/master">/etc/pgpool-II/recovery_2nd_stage.sample</ulink>.
+ Example installation using those scripts can be found in <xref
+ linkend="example-cluster-pgpool-config-online-recovery">.
+ </para>
+
+ <para>
+ Connections from clients are not allowed only in the second stage
+ while the data can be updated or retrieved during the first stage.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> performs the follows steps in online recovery:
+ </para>
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ CHECKPOINT.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Execute first stage of online recovery.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Wait until all client connections have disconnected (only in <xref
+ linkend="guc-replication-mode"> and <xref
+ linkend="guc-snapshot-isolation-mode">).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ CHECKPOINT (only in <xref linkend="guc-replication-mode"> and
+ <xref linkend="guc-snapshot-isolation-mode">).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Execute second stage of online recovery (only in <xref
+ linkend="guc-replication-mode"> and <xref
+ linkend="guc-snapshot-isolation-mode">).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Start up postmaster (perform <literal>pgpool_remote_start</literal>)
+ </para>
+ <para>
+ The <literal>pgpool_remote_start</literal> is script to start up the <productname>PostgreSQL</productname> node of recovery target.
+ <literal>pgpool_remote_start</literal> receives following 2 parameters:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Hostname of the backend node to be recovered.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Path to the database cluster of the main(primary) node.
+ </para>
+ </listitem>
+ </itemizedlist>
+ The script example can be found in <xref linkend="example-cluster-pgpool-config-online-recovery">.
+ <note>
+ <para>
+ The script path and filename are hard coded, <command>$PGDATA/pgpool_remote_start</command> is executed on main(primary) node.
+ </para>
+ </note>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Node attach
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ <note>
+ <para>
+ There is a restriction in the online recovery in
+ <xref linkend="guc-replication-mode">. If
+ <productname>Pgpool-II</productname> itself is installed
+ on multiple hosts, online recovery does not work correctly,
+ because <productname>Pgpool-II</productname> has to stop all
+ the clients during the 2nd stage of online recovery.
+ If there are several <productname>Pgpool-II</productname> hosts,
+ only one of them will have received the online recovery command and will
+ block the connections from clients.
+ </para>
+ </note>
+ <variablelist>
+
+ <varlistentry id="guc-recovery-user" xreflabel="recovery_user">
+ <term><varname>recovery_user</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>recovery_user</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the <productname>PostgreSQL</> user name to perform online recovery.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-recovery-password" xreflabel="recovery_password">
+ <term><varname>recovery_password</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>recovery_password</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the password for the <productname>PostgreSQL</> user name configured in
+ <xref linkend="guc-recovery-user"> to perform online recovery.
+ </para>
+ <para>
+ If <varname>recovery_password</varname> is left blank <productname>Pgpool-II</productname>
+ will first try to get the password for <xref linkend="guc-recovery-user"> from
+ <xref linkend="guc-pool-passwd"> file before using the empty password.
+ </para>
+ <para>
+ You can also specify AES256-CBC encrypted password in <varname>recovery_password</varname> field.
+ To specify the <literal>AES</literal> encrypted password, password string must be prefixed with
+ <literal>AES</literal> after encrypting (using <literal>aes-256-cbc</literal> algorithm) and
+ encoding to <literal>base64</literal>.
+ </para>
+ <para>
+ To specify the unencrypted clear text password, prefix the password string with
+ <literal>TEXT</literal>. For example if you want to set <literal>mypass</literal> as
+ a password, you should specify <literal>TEXTmypass</literal> in the password field.
+ In the absence of a valid prefix, <productname>Pgpool-II</productname> will considered
+ the string as a plain text password.
+ </para>
+ <para>
+ You can also use <xref linkend="PG-ENC"> utility to create the correctly formatted
+ <literal>AES</literal> encrypted password strings.
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> will require a valid decryption key at the
+ startup to use the encrypted passwords.
+ see <xref linkend="auth-aes-decryption-key"> for more details on providing the
+ decryption key to <productname>Pgpool-II</productname>
+ </para>
+ </note>
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-recovery-1st-stage-command" xreflabel="recovery_1st_stage_command">
+ <term><varname>recovery_1st_stage_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>recovery_1st_stage_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a command to be run by main (primary) node at the
+ first stage of online recovery. The command file must be placed in the
+ database cluster directory for security reasons.
+ For example, if <varname>recovery_1st_stage_command</varname> = <literal>
+ 'sync-command'</literal>, then <productname>Pgpool-II</productname> will
+ look for the command script in <literal>$PGDATA</literal> directory and will
+ try to execute <command>$PGDATA/sync-command</command>.
+ </para>
+ <para>
+ <varname>recovery_1st_stage_command</varname> receives following 6 parameters:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Path to the database cluster of the main (primary) node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Hostname of the backend node to be recovered.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Path to the database cluster of the node to be recovered.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Port number of the main (primary) node (<productname>Pgpool-II</productname> 3.4 or after).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Node number to be recovered (<productname>Pgpool-II</productname> 4.0 or after)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Port number to be recovered (<productname>Pgpool-II</productname> 4.1 or after)
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> accept connections and queries
+ while <varname>recovery_1st_stage command</varname> is executed,
+ so you can retrieve and update data.
+ </para>
+ </note>
+
+ <caution>
+ <para>
+ <varname>recovery_1st_stage command</varname> runs as a <acronym>SQL</acronym>
+ command from PostgreSQL's point of view. So <varname>recovery_1st_stage command
+ </varname> can get prematurely killed by PostgreSQL if the PostgreSQL's
+ <varname>statement_time_out</varname> is configured with the value that is
+ smaller than the time <varname>recovery_1st_stage_command</varname> takes for
+ completion.
+ </para>
+ <para>
+ Typical error in such case is
+ <programlisting>
+ rsync used in the command is killed by signal 2 for example.
+ </programlisting>
+ </para>
+ </caution>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-recovery-2nd-stage-command" xreflabel="recovery_2nd_stage_command">
+ <term><varname>recovery_2nd_stage_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>recovery_2nd_stage_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies a command to be run by main node at the second
+ stage of online recovery. This command is required only
+ <xref linkend="guc-replication-mode">, so for other modes don't need
+ to provide a command file. The command file must be placed in the
+ database cluster directory for security reasons.
+ For example, if <varname>recovery_2nd_stage_command</varname> = <literal>
+ 'sync-command'</literal>, then <productname>Pgpool-II</productname> will
+ look for the command script in <literal>$PGDATA</literal> directory and will
+ try to execute <command>$PGDATA/sync-command</command>.
+ </para>
+ <para>
+ <varname>recovery_2nd_stage_command</varname> receives following 6 parameters:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Path to the database cluster of the main(primary) node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Hostname of the backend node to be recovered.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Path to the database cluster of the node to be recovered.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Port number of the main (primary) node (<productname>Pgpool-II</productname> 3.4 or after).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Node number to be recovered (<productname>Pgpool-II</productname> 4.0 or after)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Port number to be recovered (<productname>Pgpool-II</productname> 4.1 or after)
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> <emphasis>does not</emphasis>
+ accept client connections and queries during the execution
+ of <varname>recovery_2nd_stage_command</varname> command, and waits
+ for the existing clients to close their connections before executing the
+ command.
+ Therefore, the <varname>recovery_2nd_stage_command</varname> may not execute
+ if the client stays connected for a long time.
+ </para>
+ </note>
+
+ <caution>
+ <para>
+ <varname>recovery_2nd_stage command</varname> runs as a <acronym>SQL</acronym>
+ command from PostgreSQL's point of view. Therefore, <varname>recovery_2nd_stage command
+ </varname> can get prematurely killed by PostgreSQL if the PostgreSQL's
+ <varname>statement_time_out</varname> is configured with the value that is
+ smaller than the time <varname>recovery_2nd_stage_command</varname> takes for
+ completion.
+ </para>
+ </caution>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-recovery-timeout" xreflabel="recovery_timeout">
+ <term><varname>recovery_timeout</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>recovery_timeout</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the timeout in seconds to cancel the online recovery if it
+ does not completes within this time.
+ Since <productname>Pgpool-II</productname> does not accepts the connections
+ during the second stage of online recovery, this parameter can be used to cancel
+ the online recovery to manage the service down time during the online recovery.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-client-idle-limit-in-recovery" xreflabel="client_idle_limit_in_recovery">
+ <term><varname>client_idle_limit_in_recovery</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>client_idle_limit_in_recovery</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the time in seconds to disconnect a client if it remains idle
+ since the last query during the online recovery.
+ <varname>client_idle_limit_in_recovery</varname> is similar to the
+ <xref linkend="guc-client-idle-limit"> but only takes effect during the
+ second stage of online recovery.
+ </para>
+ <para>
+ This is useful for preventing the <productname>Pgpool-II</productname>
+ recovery from being disturbed by the lazy clients or if the TCP/IP
+ connection between the client and <productname>Pgpool-II</productname>
+ is accidentally down (a cut cable for instance).
+ </para>
+
+ <note>
+ <para>
+ <varname>client_idle_limit_in_recovery</varname> must be smaller than
+ <xref linkend="guc-recovery-timeout">.
+ Otherwise, <xref linkend="guc-recovery-timeout"> comes
+ first and you will see following error while executing online recovery:
+ <programlisting>
+ ERROR: node recovery failed, waiting connection closed in the other pgpools timeout
+ </programlisting>
+ </para>
+ </note>
+
+ <para>
+ If set to -1, all clients get immediately disconnected when the second
+ stage of online recovery starts.
+ The default is 0, which turns off the feature.
+ </para>
+
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
+ this parameter for a current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/performance.sgml -->
+
+<chapter id="performance">
+ <title>Performance Considerations</title>
+
+ <indexterm>
+ <primary>performance</primary>
+ <secondary>of the server</secondary>
+ </indexterm>
+
+ <para>
+ There are number of configuration parameters that affect the
+ performance of
+ <productname>Pgpool-II</productname>. In this chapter we present
+ how to tune them.
+ </para>
+
+ <sect1 id="resource-requirement">
+ <title>Resource Requirement</title>
+
+ <para>
+ <productname>Pgpool-II</productname> does not consume too much
+ resource. However there are minimum requirements for
+ resource. In this section we are going to explain one by one.
+ </para>
+
+ <sect2 id="memory-requirement">
+ <title>Memory Requirement</title>
+
+ <para>
+ There are two types of memory usage
+ in <productname>Pgpool-II</productname>: shared memory and
+ process private memory. The former is allocated at the startup
+ of <productname>Pgpool-II</productname> main server process
+ and will not be freed until
+ whole <productname>Pgpool-II</productname> servers shut down.
+ The latter is allocated within
+ each <productname>Pgpool-II</productname> child process and
+ will be freed at the end of the process.
+ </para>
+
+ <sect3 id="shared-memory-requirement">
+ <title>Shared Memory Requirement</title>
+
+ <para>
+ Here is a formula to calculate the shared memory requirement.
+ <programlisting>
+ Shared memory requirement (in bytes) = <xref linkend="guc-num-init-children"> * <xref linkend="guc-max-pool"> * 17408
+ </programlisting>
+ For example if you have <varname>num_init_children</varname> = 32 (the default) and <varname>max_pool</varname> = 4 (the
+ default), then you will need 32 * 4 * 17408 = 2228224 bytes = 2.1 MB.
+ </para>
+
+ <para>
+ If you plan to use in memory query cache
+ (see <xref linkend="runtime-in-memory-query-cache"> for more
+ details) in the shared memory, you will need more RAM for
+ it. See
+ <xref linkend="guc-memqcache-total-size"> and
+ <xref linkend="guc-memqcache-max-num-cache"> for required RAM
+ size.
+ </para>
+
+ <para>
+ Note that, however, in <productname>Pgpool-II</productname> 4.1
+ or after, even if the in memory query cache is not enabled, it
+ consumes additional 64MB of shared memory, if <xref
+ linkend="guc-enable-shared-relcache"> is enabled (it is enabled
+ by default).
+ </para>
+ </sect3>
+
+ <sect3 id="process-memory-requirement">
+ <title>Process Memory Requirement</title>
+ <para>
+
+ Here is a formula to calculate the process memory requirement.
+ <programlisting>
+ Process memory requirement in total (in mega bytes) = <xref linkend="guc-num-init-children"> * 5
+ </programlisting>
+ For example if you have <varname>num_init_children</varname> =
+ 32 (the default), you will need 160MB.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="disk-requirement">
+ <title>Disk Requirement</title>
+ <para>
+ <productname>Pgpool-II</productname> does not consume much
+ disk space. Also it does not require high speed disk because
+ disk I/O traffic caused
+ by <productname>Pgpool-II</productname> is small. However,
+ if you plan to emit much logs, of course you need disk space
+ for them.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="managing-client-connections">
+ <title>Managing Client Connections</title>
+ <para>
+ As the number of client connections accepted is growing, the
+ number of <productname>Pgpool-II</productname> child process
+ which can accept new connections from client is decreasing and
+ finally reaches to 0. In this situation new clients need to wait
+ until a child process becomes free. Under heavy load, it could
+ be possible that the queue length of waiting clients is getting
+ longer and longer and finally hits the system's limit (you might
+ see "535 times the listen queue of a socket overflowed"
+ error"). In this case you need to increase the queue
+ limit. There are several ways to deal with this problem.
+ </para>
+
+ <sect2 id="controlling-num-init-children">
+ <title>Controlling num_init_children</title>
+ <para>
+ The obvious way to deal with the problem is increasing the
+ number of child process. This can be done by
+ tweaking <xref linkend="guc-num-init-children">. However
+ increasing child process requires more CPU and memory
+ resource. Also you have to be very careful about
+ max_connections parameter
+ of <productname>PostgreSQL</productname> because once the
+ number of child process is greater than
+ max_connections, <productname>PostgreSQL</productname> refuses
+ to accept new connections, and failover will be triggered.
+ </para>
+ <para>
+ Another drawback of increasing num_init_children is, so called
+ "thundering herd problem". When new connection request comes
+ in, the kernel wake up any sleeping child process to issue
+ accept() system call. This triggers fight of process to get
+ the socket and could give heavy load to the system. To
+ mitigate the problem, you could set serialize_accept to on so
+ that there's only one process to grab the accepting socket.
+ </para>
+ </sect2>
+
+ <sect2 id="controlling-listen-backlog-multiplier">
+ <title>Controlling listen_backlog_multiplier</title>
+ <para>
+ Another solution would be increasing the connection request
+ queue. This could be done by
+ increasing <xref linkend="guc-listen-backlog-multiplier">.
+ </para>
+ </sect2>
+
+ <sect2 id="when-to-use-reserved-connections">
+ <title>When to use reserved_connections</title>
+ <para>
+ However, none of above solutions guarantees that the
+ connection accepting the queue would not be filled up. If a
+ client connection request arrives quicker than the rate of
+ processing queries, the queue will be filled in someday. For
+ example, if there are some heavy queries that take long time,
+ it could easily trigger the problem.
+ </para>
+ <para>
+ The solution is
+ setting <xref linkend="guc-reserved-connections"> so that
+ overflowed connection requests are rejected
+ as <productname>PostgreSQL</productname> already does. This
+ gives visible errors to applications ("Sorry max_connections
+ already") and force them retrying. So the solution should only
+ be used when you cannot foresee the upper limit of system
+ load.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="read-query-load-balancing">
+ <title>Read Query Load Balancing</title>
+ <para>
+ If there are multiple <productname>PostgreSQL</productname>
+ nodes and <productname>Pgpool-II</productname> operates in
+ streaming replication mode, logical replication mode, slony mode
+ or replication mode (for those running mode
+ see <xref linkend="running-mode"> for more details), it is
+ possible to distribute read queries among those database nodes
+ to get more throughput since each database nodes processes
+ smaller number of queries. To enable the feature you need to
+ turn on <xref linkend="guc-load-balance-mode">.
+ </para>
+
+ <para>
+ At this point vast majority of systems use streaming replication
+ mode, so from now on we focus on the mode.
+ </para>
+
+ <sect2 id="session-level-load-balancing-vs-statement-level-load-balancing">
+ <title>Session Level Load Balancing vs. Statement Level Load Balancing</title>
+ <para>
+ By default load balance mode is "session level" which means
+ the node read queries are sent is determined when a client
+ connects to <productname>Pgpool-II</productname>. For example,
+ if we have node 0 and node 1, one of the node is selected
+ randomly each time new session is created. In the long term,
+ the possibility which node is chosen will be getting closer to
+ the ratio specified by <xref linkend="guc-backend-weight">0
+ and
+ <xref linkend="guc-backend-weight">1. If those two values are
+ equal, the chance each node is chosen will be even.
+ </para>
+
+ <para>
+ On the other hand, if
+ <xref linkend="guc-statement-level-load-balance"> is set to
+ on, the load balance node is determined at the time each query
+ starts. This is useful in case that application has its own
+ connection pooling which keeps on connecting
+ to <productname>Pgpool-II</productname> and the load balance
+ node will not be changed once the application starts. Another
+ use case is a batch application. It issues tremendous number
+ of queries but there's only 1 session. With statement level
+ load balancing it can utilize multiple servers.
+ </para>
+ </sect2>
+
+ <sect2 id="creating-specific-purpose-database-node">
+ <title>Creating Specific Purpose Database Node</title>
+ <para>
+ In OLAP environment sometimes it is desirable to have a large
+ read-only database for specific purpose. By creating such a
+ database is possible by creating a replica database using
+ streaming replication. In this case it is possible to redirect
+ read queries to the database in two ways: specifying database
+ names(s) or specifying application name(s). For former,
+ use <xref linkend="guc-database-redirect-preference-list">. For
+ latter use <xref linkend="guc-app-name-redirect-preference-list">.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="in-memory-query-caching">
+ <title>In Memory Query Caching</title>
+ <para>
+ <productname>Pgpool-II</productname> allows to cache read query
+ results for later use. This will bring huge benefit for a type
+ of applications which issue same read queries many times. If
+ there are two queries and the query strings (parameter for
+ prepared statements if any) are identical, two queries are
+ regarded as "same". For the first time the query is
+ sent, <productname>Pgpool-II</productname> saves the query
+ result, and use it for the second query without asking anything
+ to <productname>PostgreSQL</productname>. This technique is
+ explained in <xref linkend="runtime-in-memory-query-cache">.
+ </para>
+
+ <sect2 id="when-not-to-use-in-memory-query-caching">
+ <title>When not to Use in Memory Query Caching</title>
+ <para>
+ When a table is modified, query results against the table
+ could be changed. To avoid
+ inconsistency, <productname>Pgpool-II</productname> discards
+ query cache data when corresponding table is modified. So
+ frequently updated database will not be suitable to use in
+ memory query caching. You can check if your database is
+ suitable to use query caching or not, you could
+ use <xref linkend="SQL-SHOW-POOL-CACHE">. If query cache hit
+ ration is lower than 70%, probably you want to avoid using the
+ query cache.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="relation-cache">
+ <title>Relation Cache</title>
+ <para>
+ Except in raw mode (see <xref linkend="running-mode">)
+ or <xref linkend="guc-load-balance-mode"> is set to off,
+ sometimes <productname>Pgpool-II</productname> needs to
+ ask <productname>PostgreSQL</productname> to get meta
+ information, such as whether a table is a temporary one or
+ not. To get those
+ information, <productname>Pgpool-II</productname> sends queries
+ primary <productname>PostgreSQL</productname> which could be up
+ to as many as 10 queries (in 4.1 or after, the number of queries
+ has been decreased, it is not zero, however). To reduce the
+ overhead, <productname>Pgpool-II</productname> maintains
+ "relation cache". Next time same table is included in a
+ query, <productname>Pgpool-II</productname> extracts the
+ information from the cache.
+ </para>
+ <para>
+ There are some parameters to configure the relation
+ cache. See <xref linkend="guc-relcache-expire">, <xref linkend="guc-relcache-size">, <xref linkend="guc-check-temp-table">, <xref linkend="guc-check-unlogged-table">
+ for more details.
+ </para>
+
+ <sect2 id="shared-relation-cache">
+ <title>Shared Relation Cache</title>
+ <para>
+ The relation cache basically lives in process private memory,
+ which is bound to a process. So even if a relation cache is
+ created to for a table, in different process the relation
+ cache might not be created yet. After all, until a relation
+ cache entry is created in all process, queries continue to
+ sent to <productname>PostgreSQL</productname>.
+ <productname>Pgpool-II</productname> 4.1 overcomes the issue
+ by creating relation cache in shared memory. If a session
+ creates a relation cache entry in the shared memory, other
+ sessions will get the cache result by looking at the shared
+ relation
+ cache. See <xref linkend="guc-enable-shared-relcache">
+ configuration parameter section for more details. This feature
+ is pretty effective and we recommend this feature be enabled.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="other-performance-considerations">
+ <title>Other Performance Considerations</title>
+ <para>
+ This section introduces some other performance considerations.
+ </para>
+
+ <sect2 id="thundering-herd-problem">
+ <title>Thundering Herd Problem</title>
+ <para>
+ If <xref linkend="guc-num-init-children"> is large, it is
+ possible that many <productname>Pgpool-II</productname> process
+ are woke up and heavy context switching happens. This leads to
+ high system load and hurt the overall system performance. This
+ problem is called "the thundering herd
+ problem". Enabling <xref linkend="guc-serialize-accept"> could
+ solve the problem. Please note that for
+ smaller <xref linkend="guc-num-init-children">, <xref linkend="guc-serialize-accept">
+ might make the system performance worse. Please take a look at
+ the guidance in <xref linkend="guc-serialize-accept"> section.
+ </para>
+ </sect2>
+
+ <sect2 id="disaster-recovery-settings">
+ <title>Disaster recovery settings</title>
+ <para>
+ To create a disaster recovery setting, it is possible to deploy a
+ <productname>Pgpool-II</productname> plus
+ <productname>PostgreSQL</productname> primary server, and another
+ <productname>Pgpool-II</productname> plus standby
+ <productname>PostgreSQL</productname> server in a geographically
+ distant place. Clients close to the standby server send read only
+ queries to the <productname>Pgpool-II</productname>, being close
+ to the standby server. However, since standby
+ <productname>Pgpool-II</productname> sends internal queries to
+ system catalog of primary <productname>PostgreSQL</productname>
+ server, query performance may be getting worse. To avoid the
+ problem, it is possible to use <xref
+ linkend="guc-relcache-query-target"> so that such queries are sent
+ to the standby. See <xref linkend="guc-relcache-query-target"> for
+ more details.
+ </para>
+ </sect2>
+ </sect1>
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/pgpool-en.sgml -->
+
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
+
+<!ENTITY % version SYSTEM "version.sgml">
+%version;
+<!ENTITY % filelist SYSTEM "filelist.sgml">
+%filelist;
+
+<!ENTITY reference SYSTEM "reference.sgml">
+
+]>
+
+<book id="Pgpool-II">
+ <!-- needs to be replaced as "pgpool" later -->
+
+ <title>pgpool-II &version; Documentation</title>
+
+ <bookinfo>
+ <corpauthor>The Pgpool Global Development Group</corpauthor>
+ <productname>pgpool-II</productname>
+ <productnumber>&version;</productnumber>
+ &legal;
+ </bookinfo>
+
+ &intro;
+
+ <part id="tutorial">
+ <title>Tutorial</title>
+
+ <partintro>
+ <para>
+ This chapter explains how to get start with <productname>Pgpool-II</productname>.
+ </para>
+
+ </partintro>
+
+ &start;
+
+ </part>
+
+ <part id="admin">
+ <title>Server Administration</title>
+
+ <partintro>
+ <para>
+ This part covers topics that are of interest
+ to <productname>Pgpool-II</productname> administrators.
+ </para>
+ </partintro>
+
+ &installation;
+ &runtime;
+ &advanced;
+ &config;
+ &connection-settings;
+ &connection-pooling;
+ &loadbalance;
+ &healthcheck;
+ &failover;
+ &online-recovery;
+ &stream-check;
+ &memcache;
+ &ssl;
+ &watchdog;
+ &misc-config;
+ &config-last;
+ &client-auth;
+ &performance;
+ </part>
+
+ &examples;
+
+ &reference;
+
+ <part id="appendixes">
+ <title>Appendixes</title>
+
+ <partintro>
+ <para>
+ something...
+ </para>
+ </partintro>
+
+ &release;
+
+ </part>
+
+ &biblio;
+
+ <![%include-index;[&bookindex;]]>
+ <![%include-xslt-index;[<index id="bookindex"></index>]]>
+
+</book>
--- /dev/null
+<!-- doc/src/sgml/problems.sgml -->
+
+<sect1 id="bug-reporting">
+ <!--
+ <title>Bug Reporting Guidelines</title>
+ -->
+ <title>错误报告指南</title>
+
+ <para>
+ When you find a bug in <productname>Pgpool-II</productname>, please register to our <ulink url="http://pgpool.net/mediawiki/index.php/Bug_tracking_system">bug tracking system</ulink>.
+ </para>
+</sect1>
--- /dev/null
+<!--
+doc/src/sgml/ref/allfiles.sgml
+Pgpool-II documentation
+Complete list of usable sgml source files in this directory.
+-->
+
+<!ENTITY pcpCommonOptions SYSTEM "pcp_common_options.sgml">
+<!ENTITY pcpNodeCount SYSTEM "pcp_node_count.sgml">
+<!ENTITY pcpNodeInfo SYSTEM "pcp_node_info.sgml">
+<!ENTITY pcpHealthCheckStats SYSTEM "pcp_health_check_stats.sgml">
+<!ENTITY pcpWatchdogInfo SYSTEM "pcp_watchdog_info.sgml">
+<!ENTITY pcpProcCount SYSTEM "pcp_proc_count.sgml">
+<!ENTITY pcpProcInfo SYSTEM "pcp_proc_info.sgml">
+<!ENTITY pcpPoolStatus SYSTEM "pcp_pool_status.sgml">
+<!ENTITY pcpDetachNode SYSTEM "pcp_detach_node.sgml">
+<!ENTITY pcpAttachNode SYSTEM "pcp_attach_node.sgml">
+<!ENTITY pcpPromoteNode SYSTEM "pcp_promote_node.sgml">
+<!ENTITY pcpStopPgpool SYSTEM "pcp_stop_pgpool.sgml">
+<!ENTITY pcpRecoveryNode SYSTEM "pcp_recovery_node.sgml">
+<!ENTITY pcpReloadConfig SYSTEM "pcp_reload_config.sgml">
+<!ENTITY pgMd5 SYSTEM "pg_md5.sgml">
+<!ENTITY pgEnc SYSTEM "pg_enc.sgml">
+<!ENTITY wdCli SYSTEM "wd_cli.sgml">
+<!ENTITY pgproto SYSTEM "pgproto.sgml">
+<!ENTITY pgpool SYSTEM "pgpool.sgml">
+<!ENTITY pgpoolSetup SYSTEM "pgpool_setup.sgml">
+<!ENTITY watchdogSetup SYSTEM "watchdog_setup.sgml">
+<!ENTITY pgpoolShow SYSTEM "pgpool_show.sgml">
+<!ENTITY pgpoolReset SYSTEM "pgpool_reset.sgml">
+<!ENTITY pgpoolSet SYSTEM "pgpool_set.sgml">
+<!ENTITY showPoolStatus SYSTEM "show_pool_status.sgml">
+<!ENTITY showPoolNodes SYSTEM "show_pool_nodes.sgml">
+<!ENTITY showPoolProcesses SYSTEM "show_pool_processes.sgml">
+<!ENTITY showPoolPools SYSTEM "show_pool_pools.sgml">
+<!ENTITY showPoolVersion SYSTEM "show_pool_version.sgml">
+<!ENTITY showPoolCache SYSTEM "show_pool_cache.sgml">
+<!ENTITY showPoolHealthCheckStats SYSTEM "show_pool_health_check_stats.sgml">
+<!ENTITY showPoolBackendStats SYSTEM "show_pool_backend_stats.sgml">
+<!ENTITY pgpoolAdmPcpNodeInfo SYSTEM "pgpool_adm_pcp_node_info.sgml">
+<!ENTITY pgpoolAdmPcpHealthCheckStats SYSTEM "pgpool_adm_pcp_health_check_stats.sgml">
+<!ENTITY pgpoolAdmPcpPoolStatus SYSTEM "pgpool_adm_pcp_pool_status.sgml">
+<!ENTITY pgpoolAdmPcpNodeCount SYSTEM "pgpool_adm_pcp_node_count.sgml">
+<!ENTITY pgpoolAdmPcpAttachNode SYSTEM "pgpool_adm_pcp_attach_node.sgml">
+<!ENTITY pgpoolAdmPcpDetachNode SYSTEM "pgpool_adm_pcp_detach_node.sgml">
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_attach_node.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-ATTACH-NODE">
+ <indexterm zone="pcp-attach-node">
+ <primary>pcp_attach_node</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_attach_node</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_attach_node</refname>
+ <refpurpose>
+ attaches the given node to Pgpool-II.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_attach_node</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>node_id</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-ATTACH-NODE-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_attach_node</command>
+ attaches the given node to Pgpool-II.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
+ <term><option>--node_id=<replaceable class="parameter">node_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of backend node to attach.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_common_options.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-COMMON-OPTIONS">
+ <indexterm zone="pcp-common-options">
+ <primary>pcp_common_options</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_common_options</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_common_options</refname>
+ <refpurpose>
+ common options used in PCP commands</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_command</command>
+ <arg rep="repeat"><replaceable>option</></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-common-options-1">
+ <title>
+ Description
+ </title>
+ <para>
+ There are some arguments common to all PCP commands. Most of
+ these are for authentication and the rest are about verbose
+ mode, debug message, and so on.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-h <replaceable class="parameter">hostname</replaceable></option></term>
+ <term><option>--host=<replaceable class="parameter">hostname</replaceable></option></term>
+ <listitem>
+ <para>
+ The host name of the machine on which the server is running. If the
+ value begins with a slash, it is used as the directory for the Unix-domain socket.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
+ <term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
+ <listitem>
+ <para>
+ The PCP port number (default:"9898").
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-U <replaceable class="parameter">username</replaceable></option></term>
+ <term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
+ <listitem>
+ <para>
+ The user name for PCP authentication (default: OS user name).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-w</option></term>
+ <term><option>--no-password</option></term>
+ <listitem>
+ <para>
+ Never prompt for password. And if a password is not available
+ by a <filename>.pcppass</filename> file, the connection
+ attempt will fail. This option can be useful in batch jobs
+ and scripts where no user is present to enter a password.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-W</option></term>
+ <term><option>--password</option></term>
+ <listitem>
+ <para>
+ Force password prompt (should happen automatically).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d</option></term>
+ <term><option>--debug</option></term>
+ <listitem>
+ <para>
+ Enable debug message.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-v</option></term>
+ <term><option>--verbose</option></term>
+ <listitem>
+ <para>
+ Enable verbose output.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-V</option></term>
+ <term><option>--version</option></term>
+ <listitem>
+ <para>
+ Print the command version, then exit.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-?</option></term>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>
+ Shows help for the command line arguments, then exit.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>Environment</title>
+
+ <variablelist>
+ <varlistentry>
+ <term><envar>PCPPASSFILE</envar></term>
+
+ <listitem>
+ <para>
+ Specifies the path to pcp password file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_detach_node.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-DETACH-NODE">
+ <indexterm zone="pcp-detach-node">
+ <primary>pcp_detach_node</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_detach_node</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_detach_node</refname>
+ <refpurpose>
+ detaches the given node from Pgpool-II. Existing connections to Pgpool-II are forced to be disconnected.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_detach_node</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>node_id</replaceable></arg>
+ <arg><replaceable>gracefully</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-DETACH-NODE-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_detach_node</command>
+ detaches the given node from Pgpool-II. Existing connections to Pgpool-II are forced to be disconnected.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
+ <term><option>--node_id=<replaceable class="parameter">node_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of backend node to detach.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-g</option></term>
+ <term><option>--gracefully</option></term>
+ <listitem>
+ <para>
+ wait until all clients are disconnected (unless client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_health_check_stats.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-HEALTH-CHECK-STATS">
+ <indexterm zone="pcp-health-check-stats">
+ <primary>pcp_health_check_stats</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_health_check_stats</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_health_check_stats</refname>
+ <refpurpose>
+ displays health check statistics data on given node ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_health_check_stats</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg><replaceable>node_id</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-HEALTH-CHECK-STATS-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_health_check_stats</command>
+ displays health check statistics data on given node ID.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
+ <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of backend node to get information of.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+$ pcp_health_check_stats -h localhost -p 11001 -w 0
+0 /tmp 11002 up primary 2020-02-24 22:02:42 3 3 0 0 0 0.000000 0 5 1 3.666667 2020-02-24 22:02:47 2020-02-24 22:02:47
+$ pcp_health_check_stats -h localhost -p 11001 -w -v 0
+Node Id : 0
+Host Name : /tmp
+Port : 11002
+Status : up
+Role : primary
+Last Status Change : 2020-02-24 22:02:42
+Total Count : 5
+Success Count : 5
+Fail Count : 0
+Skip Count : 0
+Retry Count : 0
+Average Retry Count : 0.000000
+Max Retry Count : 0
+Max Health Check Duration : 5
+Minimum Health Check Duration : 1
+Average Health Check Duration : 4.200000
+Last Health Check : 2020-02-24 22:03:07
+Last Successful Health Check : 2020-02-24 22:03:07
+Last Skip Health Check :
+Last Failed Health Check :
+ </programlisting>
+ </para>
+
+ <para>
+ See <xref linkend="health-check-stats-data-table"> for details of data.
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_node_count.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-NODE-COUNT">
+ <indexterm zone="pcp-node-count">
+ <primary>pcp_node_count</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_node_count</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_node_count</refname>
+ <refpurpose>
+ displays the total number of database nodes</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_node_count</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-NODE-COUNT-1">
+ <title>
+ Description
+ </title>
+ <para>
+ <command>pcp_node_count</command>
+ displays the total number of database nodes defined in <filename>pgpool.conf</filename>. It does
+ not distinguish between nodes status, ie attached/detached. ALL nodes are counted.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ $ pcp_node_count -p 11001
+ Password:
+ 2
+ </programlisting>
+ </para>
+ </refsect1>
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_node_info.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-NODE-INFO">
+ <indexterm zone="pcp-node-info">
+ <primary>pcp_node_info</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_node_info</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_node_info</refname>
+ <refpurpose>
+ displays the information on the given node ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_node_info</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg><replaceable>node_id</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-NODE-INFO-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_node_info</command>
+ displays the information on the given node ID.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
+ <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of backend node to get information of.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ $ pcp_node_info -h localhost -U postgres 1
+ /tmp 11003 2 0.500000 up standby 0 streaming async 2019-04-23 13:58:40
+ </programlisting>
+ </para>
+ <para>
+ The result is in the following order:
+ <literallayout class="monospaced">
+ 1. hostname
+ 2. port number
+ 3. status
+ 4. load balance weight
+ 5. status name
+ 6. backend role
+ 7. replication delay
+ 8. replication state (taken from pg_stat_replication, if PostgreSQL is 9.1 or later)
+ 9. sync replication state (taken from pg_stat_replication, if PostgreSQL is 9.2 or later)
+ 10. last status change time
+ </literallayout>
+ </para>
+ <para>
+ Status is represented by a digit from [0 to 3]. To correctly 7,
+ 8, 9 are displayed, <xref linkend="guc-sr-check-period"> must not
+ be 0. 8, 9 will not be displayed
+ if <xref linkend="guc-sr-check-user"> is
+ not <productname>PostgreSQL</productname> super user nor it's not
+ in "pg_monitor" group.
+ <note>
+ <para>
+ To make <xref linkend="guc-sr-check-user"> in pg_monitor
+ group, execute following SQL command
+ by <productname>PostgreSQL</productname> super user (replace
+ "sr_check_user" with the setting
+ of <xref linkend="guc-sr-check-user">):
+ <programlisting>
+ GRANT pg_monitor TO sr_check_user;
+ </programlisting>
+ For <productname>PostgreSQL</productname> 9.6, there's no
+ pg_monitor group and <xref linkend="guc-sr-check-user"> must
+ be <productname>PostgreSQL</productname> super user.
+ </para>
+ </note>
+
+ <itemizedlist>
+ <listitem><para>0 - This state is only used during the initialization. PCP will never display it. </para></listitem>
+ <listitem><para>1 - Node is up. No connections yet. </para></listitem>
+ <listitem><para>2 - Node is up. Connections are pooled. </para></listitem>
+ <listitem><para>3 - Node is down. </para></listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The load balance weight is displayed in normalized format.
+ </para>
+ <para>
+ The <option>--verbose</option> option can help understand the output. For example:
+ </para>
+ <programlisting>
+ $ pcp_node_info --verbose -h localhost -U postgres 1
+ Hostname : /tmp
+ Port : 11003
+ Status : 2
+ Weight : 0.500000
+ Status Name : up
+ Role : standby
+ Replication Delay : 0
+ Replication State : streaming
+ Replication Sync State : async
+ Last Status Change : 2019-04-23 13:58:40
+ </programlisting>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_pool_status.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-POOL-STATUS">
+ <indexterm zone="pcp-pool-status">
+ <primary>pcp_pool_status</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_pool_status</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_pool_status</refname>
+ <refpurpose>
+ displays the parameter values as defined in <filename>pgpool.conf</filename></refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_pool_status</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-POOL-STATUS-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_pool_status</command>
+ displays the parameter values as defined in <filename>pgpool.conf</filename>.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ $ pcp_pool_status -h localhost -U postgres
+ name : listen_addresses
+ value: localhost
+ desc : host name(s) or IP address(es) to listen to
+
+ name : port
+ value: 9999
+ desc : pgpool accepting port number
+
+ name : socket_dir
+ value: /tmp
+ desc : pgpool socket directory
+
+ name : pcp_port
+ value: 9898
+ desc : PCP port # to bind
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_proc_count.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-PROC-COUNT">
+ <indexterm zone="pcp-proc-count">
+ <primary>pcp_proc_count</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_proc_count</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_proc_count</refname>
+ <refpurpose>
+ displays the list of Pgpool-II children process IDs</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_proc_count</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-PROC-COUNT-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_proc_count</command>
+ displays the list of Pgpool-II children process IDs. If there is more than one process, IDs will be delimited by a white space.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_proc_info.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-PROC-INFO">
+ <indexterm zone="pcp-proc-info">
+ <primary>pcp_proc_info</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_proc_info</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_proc_info</refname>
+ <refpurpose>
+ displays the information on the given Pgpool-II child process ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_proc_info</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>pgpool_child_processid</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-PROC-INFO-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_proc_info</command>
+ displays the information on the given Pgpool-II child process ID.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-a</option></term>
+ <term><option>--all</option></term>
+ <listitem>
+ <para>
+ Display all child processes and their available connection slots.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-P <replaceable class="parameter">PID</replaceable></option></term>
+ <term><option>--process-id=<replaceable class="parameter">PID</replaceable></option></term>
+ <listitem>
+ <para>
+ PID of <productname>Pgpool-II</productname> child process.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ If -a nor -P is not specified, process information of all
+ connected <productname>Pgpool-II</productname> child process will
+ be printed. In this case if there's no
+ connected <productname>Pgpool-II</productname> child process,
+ nothing but "No process information available" message will be
+ printed.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ $ pcp_proc_info -p 11001 1406
+ test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1435 1 1406 0
+ test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1436 1 1406 1
+ </programlisting>
+ </para>
+ <para>
+ The result is in the following order:
+ <literallayout class="monospaced">
+ 1. connected database name
+ 2. connected user name
+ 3. process start-up timestamp
+ 4. connection created timestamp
+ 5. protocol major version
+ 6. protocol minor version
+ 7. connection-reuse counter
+ 8. PostgreSQL backend process id
+ 9. 1 if frontend connected 0 if not
+ 10. pgpool child process id
+ 11. PostgreSQL backend id
+ </literallayout>
+ </para>
+ <para>
+ If <literal>-a</literal> or <literal>--all</literal> option is not specified and
+ there is no connection to the backends, nothing will be displayed. If there are
+ multiple connections, one connection's information will be displayed on each
+ line multiple times. Timestamps are displayed in EPOCH format.
+ </para>
+ <para>
+ The <option>--verbose</option> option can help understand the output. For example:
+ </para>
+ <programlisting>
+ $ pcp_proc_info -p 11001 --verbose 1406
+ Database : test
+ Username : t-ishii
+ Start time : 2018-07-09 16:43:53
+ Creation time: 2018-07-09 16:44:08
+ Major : 3
+ Minor : 0
+ Counter : 1
+ Backend PID : 1435
+ Connected : 1
+ PID : 1406
+ Backend ID : 0
+ Database : test
+ Username : t-ishii
+ Start time : 2018-07-09 16:43:53
+ Creation time: 2018-07-09 16:44:08
+ Major : 3
+ Minor : 0
+ Counter : 1
+ Backend PID : 1436
+ Connected : 1
+ PID : 1406
+ Backend ID : 1
+ </programlisting>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_promote_node.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-PROMOTE-NODE">
+ <indexterm zone="pcp-promote-node">
+ <primary>pcp_promote_node</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_promote_node</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_promote_node</refname>
+ <refpurpose>
+ promotes the given node as new main to Pgpool-II</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_promote_node</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>node_id</replaceable></arg>
+ <arg><replaceable>gracefully</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-PROMOTE-NODE-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_promote_node</command>
+ promotes the given node as new primary to Pgpool-II. In streaming replication mode only. Please note that this command does not actually promote standby PostgreSQL backend: it just changes the internal status of Pgpool-II and trigger failover and users have to promote standby PostgreSQL outside Pgpool-II.
+ </para>
+
+ <para>
+ <command>pcp_promote_node</command> executes followings. Please be
+ warned that if <xref linkend="guc-follow-primary-command"> is set,
+ the command will be executed. It is a standard advice that you
+ disable <xref linkend="guc-follow-primary-command"> before executing
+ this command.
+
+ <orderedlist>
+
+ <listitem>
+ <para>
+ Change the status of standby
+ <productname>PostgreSQL</productname> from standby to
+ primary. It just changes the internal status of Pgpool-II and it
+ does not actually promote <productname>PostgreSQL</productname>
+ standby server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Change the status of <productname>PostgreSQL</productname> node
+ which is not specified by this command's argument to down. It
+ just changes the internal status of Pgpool-II and it does not
+ actually make <productname>PostgreSQL</productname> standby
+ server down.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ If <xref linkend="guc-follow-primary-command"> is set, execute
+ <xref linkend="guc-follow-primary-command"> against
+ <productname>PostgreSQL</productname>.
+ </para>
+ </listitem>
+
+ </orderedlist>
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
+ <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of backend node to promote as new main.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-g </option></term>
+ <term><option>--gracefully</option></term>
+ <listitem>
+ <para>
+ Wait until all clients are disconnected (unless client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_recovery_node.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-RECOVERY-NODE">
+ <indexterm zone="pcp-recovery-node">
+ <primary>pcp_recovery_node</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_recovery_node</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_recovery_node</refname>
+ <refpurpose>
+ attaches the given backend node with recovery</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_recovery_node</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>node_id</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-RECOVERY-NODE-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_recovery_node</command>
+ attaches the given backend node with recovery.
+ See <xref linkend="runtime-online-recovery"> to set up necessary parameters of pgpool.conf.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
+ <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of backend node.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_reload_config.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-RELOAD-CONFIG">
+ <indexterm zone="pcp-reload-config">
+ <primary>pcp_reload_config</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_reload_config</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_reload_config</refname>
+ <refpurpose>
+ reload pgpool-II config file</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_reload_config</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-RELOAD-CONFIG-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_reload_config</command>
+ reload Pgpool-II config file.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-s <replaceable class="parameter">scope</replaceable></option></term>
+ <term><option>--scope=<replaceable class="parameter">scope</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the breadth of a command's impact.
+ </para>
+ <para>
+ The supported command scopes are as follows (The default is "local"):
+ <itemizedlist>
+ <listitem><para>c, cluster : reload config files of all Pgpool-II nodes part of the cluster </para></listitem>
+ <listitem><para>l, local : reload config file of local Pgpool-II node only </para></listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_stop_pgpool.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-STOP-PGPOOL">
+ <indexterm zone="pcp-stop-pgpool">
+ <primary>pcp_stop_pgpool</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_stop_pgpool</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_stop_pgpool</refname>
+ <refpurpose>
+ terminates the Pgpool-II process</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_stop_pgpool</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>mode</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-STOP-PGPOOL-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_stop_pgpool</command>
+ terminates the Pgpool-II process.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-m <replaceable class="parameter">mode</replaceable></option></term>
+ <term><option>--mode=<replaceable class="parameter">mode</replaceable></option></term>
+ <listitem>
+ <para>
+ Shutdown mode for terminating the Pgpool-II process.
+ </para>
+ <para>
+ The available modes are as follows (The default is "smart"):
+ <itemizedlist>
+ <listitem><para>s, smart : smart mode </para></listitem>
+ <listitem><para>f, fast : fast mode </para></listitem>
+ <listitem><para>i, immediate : immediate mode </para></listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-s <replaceable class="parameter">scope</replaceable></option></term>
+ <term><option>--scope=<replaceable class="parameter">scope</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the breadth of a command's impact.
+ </para>
+ <para>
+ The supported command scopes are as follows (The default is "local"):
+ <itemizedlist>
+ <listitem><para>c, cluster : terminates all Pgpool-II nodes part of the cluster </para></listitem>
+ <listitem><para>l, local : terminates local Pgpool-II node only </para></listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pcp_watchdog_info.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PCP-WATCHDOG-INFO">
+ <indexterm zone="pcp-watchdog-info">
+ <primary>pcp_watchdog_info</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pcp_watchdog_info</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>PCP Command</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pcp_watchdog_info</refname>
+ <refpurpose>
+ displays the watchdog status of the Pgpool-II</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pcp_watchdog_info</command>
+ <arg rep="repeat"><replaceable>options</replaceable></arg>
+ <arg><replaceable>watchdog_id</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PCP-WATCHDOG-INFO-1">
+ <title>Description</title>
+ <para>
+ <command>pcp_node_info</command>
+ displays the information on the given node ID.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">watchdog_id</replaceable></option></term>
+ <term><option>--node-id=<replaceable class="parameter">watchdog_id</replaceable></option></term>
+ <listitem>
+ <para>
+ The index of other Pgpool-II to get information for.
+ </para>
+ <para>
+ Index 0 gets one's self watchdog information.
+ </para>
+ <para>
+ If omitted then gets information of all watchdog nodes.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other options </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ $ pcp_watchdog_info -h localhost -U postgres
+
+ 3 NO Linux_host1.localdomain_9991 host1
+
+ Linux_host1.localdomain_9991 host1 9991 9001 7 STANDBY
+ Linux_host2.localdomain_9992 host2 9992 9002 4 LEADER
+ Linux_host3.localdomain_9993 host3 9993 9003 7 STANDBY
+ </programlisting>
+ </para>
+ <para>
+ The result is in the following order:
+ <literallayout class="monospaced">
+ The first output line describes the watchdog cluster information:
+
+ 1. Total watchdog nodes in the cluster
+ 2. Is VIP is up on current node?
+ 3. Leader node name
+ 4. Leader node host
+ </literallayout>
+ <literallayout class="monospaced">
+ Next is the list of watchdog nodes:
+
+ 1. node name
+ 2. hostname
+ 3. pgpool port
+ 4. watchdog port
+ 5. current node state
+ 6. current node state name
+ </literallayout>
+ </para>
+ <para>
+ The <option>--verbose</option> option can help understand the output. For example:
+ </para>
+ <programlisting>
+ $ pcp_watchdog_info -h localhost -v -U postgres
+
+ Watchdog Cluster Information
+ Total Nodes : 3
+ Remote Nodes : 2
+ Quorum state : QUORUM EXIST
+ Alive Remote Nodes : 2
+ VIP up on local node : NO
+ Leader Node Name : Linux_host2.localdomain_9992
+ Leader Host Name : localhost
+
+ Watchdog Node Information
+ Node Name : Linux_host1.localdomain_9991
+ Host Name : host1
+ Delegate IP : 192.168.1.10
+ Pgpool port : 9991
+ Watchdog port : 9001
+ Node priority : 1
+ Status : 7
+ Status Name : STANDBY
+
+ Node Name : Linux_host2.localdomain_9992
+ Host Name : host2
+ Delegate IP : 192.168.1.10
+ Pgpool port : 9992
+ Watchdog port : 9002
+ Node priority : 1
+ Status : 4
+ Status Name : LEADER
+
+ Node Name : Linux_host3.localdomain_9993
+ Host Name : host3
+ Delegate IP : 192.168.1.10
+ Pgpool port : 9993
+ Watchdog port : 9003
+ Node priority : 1
+ Status : 7
+ Status Name : STANDBY
+ </programlisting>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pg_enc.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PG-ENC">
+ <indexterm zone="pg-enc">
+ <primary>pg_enc</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pg_enc</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>Other Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pg_enc</refname>
+ <refpurpose>
+ AES256 password encryption utility
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pg_enc</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg choice="plain"><replaceable>-p</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>pg_enc</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg choice="plain"><replaceable>password</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PG-ENC-1">
+ <title>Description</title>
+ <para>
+ <command>pg_enc</command>
+ AES256 password encryption utility.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-k <replaceable class="parameter">KEY_FILE</replaceable></option></term>
+ <term><option>--key-file=<replaceable class="parameter">KEY_FILE</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the path to the encryption key file. Default is the <literal>.pgpoolkey</literal> file
+ located in the users home directory, which can be overridden by the environment variable <varname>PGPOOLKEYFILE</varname>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-K <replaceable class="parameter">ENCRYPTION_KEY</replaceable></option></term>
+ <term><option>--enc-key=<replaceable class="parameter">ENCRYPTION_KEY</replaceable></option></term>
+ <listitem>
+ <para>
+ Encryption key to be used for encrypting database passwords.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-f <replaceable class="parameter">CONFIG_FILE</replaceable></option></term>
+ <term><option>--config-file=<replaceable class="parameter">CONFIG_FILE</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the <literal>pgpool.conf</literal> file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-i <replaceable class="parameter">INPUT_FILE</replaceable></option></term>
+ <term><option>--input-file=<replaceable class="parameter">INPUT_FILE</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies file containing username and password pairs.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p</option></term>
+ <term><option>--prompt</option></term>
+ <listitem>
+ <para>
+ Prompt for database password using standard input.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-P</option></term>
+ <term><option>--prompt-for-key</option></term>
+ <listitem>
+ <para>
+ Prompt for encryption key using standard input.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-m</option></term>
+ <term><option>--update-pass</option></term>
+ <listitem>
+ <para>
+ Create encrypted password entry in the pool_passwd file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-u <replaceable class="parameter">your_username</replaceable></option></term>
+ <term><option>--username=<replaceable class="parameter">your_username</replaceable></option></term>
+ <listitem>
+ <para>
+ Creates the <literal>pool_passwd</literal> entry for the database user called
+ <literal>your_username</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-h</option></term>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>
+ Prints the help for <literal>pg_enc</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ pg_enc -p
+ db password: [your password]
+ </programlisting>
+ </para>
+ <para>
+ or
+ </para>
+ <programlisting>
+ ./pg_enc foo
+ trying to read key from file /home/pgpool/.pgpoolkey
+
+ jglid1QRgiCl/vfhHUDyVA==
+ pool_passwd string: AESjglid1QRgiCl/vfhHUDyVA==
+ </programlisting>
+ <para>
+ <literal>pg_enc</literal> can be used for <literal>pool_passwd</literal> passwords with:
+ <programlisting>
+ pg_enc -m -f /path/to/pgpool.conf -u username -p
+ db password: [your password]
+ </programlisting>
+ which will add an entry for <literal>username</literal> with the password given.
+ </para>
+ <para>
+ To avoid password prompt or password in command parameter,
+ <literal>pg_enc</literal> can read user name:password pairs from file.
+ It will add all user names and encrypted password to
+ <xref linkend="guc-pool-passwd"> authentication file.
+ <programlisting>
+ $ cat users.txt
+ username1:secretpassword1
+ username2:secretpassword2
+
+ $ pg_enc -m -f /path/to/pgpool.conf -i users.txt
+ trying to read key from file /home/pgpool/.pgpoolkey
+ trying to read user:password pairs from file users.text
+
+ $ cat /path/to/pool_passwd
+ username1:AESrx5QdpGyW/+4CB80KWtwhg==
+ username2:AESUAdohy7nCUhWliRI9WiYQA==
+ </programlisting>
+ </para>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pg_md5.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PG-MD5">
+ <indexterm zone="pg-md5">
+ <primary>pg_md5</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pg_md5</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>Other Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pg_md5</refname>
+ <refpurpose>
+ produces encrypted password in md5</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pg_md5</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg choice="plain"><replaceable>-p</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>pg_md5</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg choice="plain"><replaceable>password</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PG-MD5-1">
+ <title>Description</title>
+ <para>
+ <command>pg_md5</command>
+ produces encrypted password in md5.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-p</option></term>
+ <term><option>--prompt</option></term>
+ <listitem>
+ <para>
+ Prompt password using standard input.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-m</option></term>
+ <term><option>--md5auth</option></term>
+ <listitem>
+ <para>
+ Produce md5 authentication password to authentication file <filename>pool_passwd</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-u <replaceable class="parameter">your_username</replaceable></option></term>
+ <term><option>--username=<replaceable class="parameter">your_username</replaceable></option></term>
+ <listitem>
+ <para>
+ When producing a md5 authentication password, create the pool_passwd entry for <literal>your_username</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-f <replaceable class="parameter">config_file</replaceable></option></term>
+ <term><option>--config-file=<replaceable class="parameter">config_file</replaceable></option></term>
+ <listitem>
+ <para>
+ Specify the path to the <literal>pgpool.conf</literal> configuration file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-i <replaceable class="parameter">input_file</replaceable></option></term>
+ <term><option>--input-file=<replaceable class="parameter">input_file</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies file containing user name and password pairs.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ The following are examples to encrypt your password into md5 hash format for <filename>pcp.conf</filename>.
+ <programlisting>
+ $ pg_md5 -p
+ password: [your password]
+ </programlisting>
+ </para>
+ <para>
+ or
+ </para>
+ <programlisting>
+ $ pg_md5 [your password]
+ acbd18db4cc2f85cedef654fccc4a4d8
+ </programlisting>
+
+ <para>
+ <literal>pg_md5</literal> can also be used for adding an entry of user name and
+ <literal>md5</literal> encrypted password to
+ <xref linkend="guc-pool-passwd"> authentication file.
+ <programlisting>
+ $ pg_md5 -m -f /path/to/pgpool.conf -u username -p
+ password: [your password]
+
+ $ cat /path/to/pool_passwd
+ username:md55a231fcdb710d73268c4f44283487ba2
+ </programlisting>
+
+ To avoid password prompt or password in command parameter,
+ <literal>pg_md5</literal> can read user name:password pairs from file.
+ It will add all user names and <literal>md5</literal> hashed password to
+ <xref linkend="guc-pool-passwd"> authentication file.
+ <programlisting>
+ $ cat users.txt
+ username1:secretpassword1
+ username2:secretpassword1
+
+ $ pg_md5 -m -f /path/to/pgpool.conf -i users.txt
+ trying to read username:password pairs from file users.txt
+
+ $ cat /path/to/pool_passwd
+ username1:md533314126ba0b187df1e37f5ce6a489a8
+ username2:md58ae92c6e1d6a48d80e2583fe715e2b36
+ </programlisting>
+
+ To just display the md5 hashed string, not adding an entry to <xref linkend="guc-pool-passwd">, pass a string concatenating password and user name.
+ For example, if password is "password" and user name is "user", the output would be:
+ <programlisting>
+ $ pg_md5 passworduser
+ 4d45974e13472b5a0be3533de4666414
+ </programlisting>
+ Please note that the actual entry to be inserted into
+ <xref linkend="guc-pool-passwd"> should have "md5" on top of the
+ result string. That is: "md54d45974e13472b5a0be3533de4666414".
+ </para>
+ </refsect1>
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="pgpool">
+ <indexterm zone="pgpool">
+ <primary>pgpool</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo>Server Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool</refname>
+ <refpurpose>
+ <productname>Pgpool-II</productname> main server</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pgpool</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>pgpool</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg choice="plain"><replaceable>stop</replaceable></arg>
+ </cmdsynopsis>
+
+ <cmdsynopsis>
+ <command>pgpool</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ <arg choice="plain"><replaceable>reload</replaceable></arg>
+ </cmdsynopsis>
+
+ </refsynopsisdiv>
+
+ <refsect1 id="R8-PGPOOL-8">
+ <title>Description</title>
+ <para>
+ the <productname>Pgpool-II</productname> main server
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Usages</title>
+ <para>
+ <command>pgpool</command> runs in 3 modes: start, stop and reload.
+ If none of stop or reload is given, it is assumed that "start" is specified.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Common options</title>
+ <para>
+ These are common options for 3 modes.
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-a <replaceable class="parameter">hba_config_file</replaceable></option></term>
+ <term><option>--hba-file=<replaceable class="parameter">hba_config_file</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the path to the <filename>pool_hba.conf</filename> configuration file.
+ Mandatory if the file is placed other than the standard location.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-f <replaceable class="parameter">config_file</replaceable></option></term>
+ <term><option>--config-file=<replaceable class="parameter">config_file</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the path to the <filename>pgpool.conf</filename> configuration file.
+ Mandatory if the file is placed other than the standard location.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-F <replaceable class="parameter">pc_config_file</replaceable></option></term>
+ <term><option>--pcp-file=<replaceable class="parameter">pcp_config_file</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the path to the <filename>pcp.conf</filename> configuration file.
+ Mandatory if the file is placed other than the standard location.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-k <replaceable class="parameter">key_file</replaceable></option></term>
+ <term><option>--key-file=<replaceable class="parameter">key_file</replaceable></option></term>
+ <listitem>
+ <para>
+ Set the path to the <filename>.pgpoolkey</filename> file.
+ Mandatory if you use AES256 encrypted password and the file is placed other than the standard location and used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-h</option></term>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>
+ Print help.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+
+ <title>Starting <productname>Pgpool-II</productname> main server</title>
+ <para>
+ Here are options for the start mode.
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-d</option></term>
+ <term><option>--debug</option></term>
+ <listitem>
+ <para>
+ Run <productname>Pgpool-II</productname> in debug mode.
+ Lots of debug messages are produced.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-n</option></term>
+ <term><option>--dont-detach</option></term>
+ <listitem>
+ <para>
+ Don't run in daemon mode, does not detach control ttys.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-x</option></term>
+ <term><option>--debug-assertions</option></term>
+ <listitem>
+ <para>
+ Turns on various assertion checks, This is a debugging aid.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-C</option></term>
+ <term><option>--clear-oidmaps</option></term>
+ <listitem>
+ <para>
+ Clear query cache oidmaps when <xref linkend="guc-memqcache-method"> is
+ <varname>memcached</varname>.
+ </para>
+ <para>
+ If memqcache_method
+ is <varname>shmem</varname>, <productname>Pgpool-II</productname>
+ always discards oidmaps at the start-up time. So this option
+ is not necessary.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-D</option></term>
+ <term><option>--discard-status</option></term>
+ <listitem>
+ <para>
+ Discard <filename>pgpool_status</filename> file and do not
+ restore previous status.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+
+ <title>Stopping <productname>Pgpool-II</productname> main server</title>
+ <para>
+ Here are options for the stop mode.
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-m <replaceable class="parameter">shutdown_mode</replaceable></option></term>
+ <term><option>--mode=<replaceable class="parameter">shutdown_mode</replaceable></option></term>
+ <listitem>
+ <para>
+ Stop <productname>Pgpool-II</productname>.
+ <varname>shutdown_mode</varname> is
+ either <literal>smart</literal>, <literal>fast</literal>
+ or <literal>immediate</literal>. If <literal>smart</literal>
+ is specified, <productname>Pgpool-II</productname> will wait
+ for all clients are disconnected. If <literal>fast</literal>
+ or <literal>immediate</literal> are
+ specified, <productname>Pgpool-II</productname> immediately
+ stops itself without waiting for all clients are
+ disconnected. There's no difference
+ between <literal>fast</literal>
+ and <literal>immediate</literal> in the current
+ implementation.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Reloading <productname>Pgpool-II</productname> configuration files</title>
+ <para>
+ Reload configuration file
+ of <productname>Pgpool-II</productname>. No specific options
+ exist for reload mode. Common options are applicable.
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_adm_pcp_attach_node.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-ADM-PCP-ATTACH-NODE">
+ <indexterm zone="pgpool-adm-pcp-attach-node">
+ <primary>pgpool_adm_pcp_attach_node</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_adm_pcp_attach_node</refentrytitle>
+ <manvolnum>3</manvolnum>
+ <refmiscinfo>pgpool_adm extension</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_adm_pcp_attach_node</refname>
+ <refpurpose>
+ a function to attach given node ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef><function>pcp_attach_node</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>text <parameter>host</parameter></paramdef>
+ <paramdef>integer <parameter>port</parameter></paramdef>
+ <paramdef>text <parameter>username</parameter></paramdef>
+ <paramdef>text <parameter>password</parameter></paramdef>
+ <paramdef>out <parameter>node_attached boolean</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef><function>pcp_attach_node</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>text <parameter>pcp_server</parameter></paramdef>
+ <paramdef>out <parameter>node_attached boolean</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R3-PCP-ATTACH-NODE-3">
+ <title>Description</title>
+ <para>
+ <function>pcp_attach_node</function> attaches a node
+ to <productname>Pgpool-II</productname>.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Arguments</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="parameter">node_id</replaceable></term>
+ <listitem>
+ <para>
+ The index of backend node to attach.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">pcp_server</replaceable></term>
+ <listitem>
+ <para>
+ The foreign server name for pcp server.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other arguments </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ test=# SELECT * FROM pcp_attach_node(node_id => 1, host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
+ node_attached
+ ---------------
+ t
+ (1 row)
+ </programlisting>
+ </para>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_adm_pcp_detach_node.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-ADM-PCP-DETACH-NODE">
+ <indexterm zone="pgpool-adm-pcp-detach-node">
+ <primary>pgpool_adm_pcp_detach_node</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_adm_pcp_detach_node</refentrytitle>
+ <manvolnum>3</manvolnum>
+ <refmiscinfo>pgpool_adm extension</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_adm_pcp_detach_node</refname>
+ <refpurpose>
+ a function to detach given node ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef><function>pcp_detach_node</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>boolean <parameter>gracefully</parameter></paramdef>
+ <paramdef>text <parameter>host</parameter></paramdef>
+ <paramdef>integer <parameter>port</parameter></paramdef>
+ <paramdef>text <parameter>username</parameter></paramdef>
+ <paramdef>text <parameter>password</parameter></paramdef>
+ <paramdef>out <parameter>node_detached boolean</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef><function>pcp_detach_node</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>boolean <parameter>gracefully</parameter></paramdef>
+ <paramdef>text <parameter>pcp_server</parameter></paramdef>
+ <paramdef>out <parameter>node_detached boolean</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R3-PCP-DETACH-NODE-3">
+ <title>Description</title>
+ <para>
+ <function>pcp_detach_node</function> detaches a node
+ from <productname>Pgpool-II</productname>.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Arguments</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="parameter">node_id</replaceable></term>
+ <listitem>
+ <para>
+ The index of backend node to detach.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">gracefully</replaceable></term>
+ <listitem>
+ <para>
+ If true, wait for all session
+ of <productname>pgpool-II</productname> terminates.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">pcp_server</replaceable></term>
+ <listitem>
+ <para>
+ The foreign server name for pcp server.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other arguments </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ test=# SELECT * FROM pcp_detach_node(node_id => 1, gracefully => 'false', host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
+ node_detached
+ ---------------
+ t
+ (1 row)
+ </programlisting>
+ </para>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_adm_pcp_health_check_stats.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-ADM-PCP-HEAlTH-CHECK-STATS">
+ <indexterm zone="pgpool-adm-pcp-health-check-stats">
+ <primary>pgpool_adm_pcp_health_check_stats</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_adm_pcp_health_check_stats</refentrytitle>
+ <manvolnum>3</manvolnum>
+ <refmiscinfo>pgpool_adm extension</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_adm_pcp_health_check_stats</refname>
+ <refpurpose>
+ a function to display health check statistics data on given node ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef><function>pcp_health_check_stats</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>text <parameter>host</parameter></paramdef>
+ <paramdef>integer <parameter>port</parameter></paramdef>
+ <paramdef>text <parameter>username</parameter></paramdef>
+ <paramdef>text <parameter>password</parameter></paramdef>
+ <paramdef>out <parameter>node_id integer</parameter></paramdef>
+ <paramdef>out <parameter>host text</parameter></paramdef>
+ <paramdef>out <parameter>port integer</parameter></paramdef>
+ <paramdef>out <parameter>status text</parameter></paramdef>
+ <paramdef>out <parameter>role text</parameter></paramdef>
+ <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
+ <paramdef>out <parameter>total_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>success_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>fail_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>skip_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>retry_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>average_retry_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>max_retry_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>max_health_check_duration bigint</parameter></paramdef>
+ <paramdef>out <parameter>min_health_check_duration bigint</parameter></paramdef>
+ <paramdef>out <parameter>average_health_check_duration float4</parameter></paramdef>
+ <paramdef>out <parameter>last_health_check timestamp</parameter></paramdef>
+ <paramdef>out <parameter>last_successful_health_check timestamp</parameter></paramdef>
+ <paramdef>out <parameter>last_skip_health_check timestamp</parameter></paramdef>
+ <paramdef>out <parameter>last_failed_health_check timestamp</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef><function>pcp_health_check_stats</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>text <parameter>pcp_server</parameter></paramdef>
+ <paramdef>out <parameter>node_id integer</parameter></paramdef>
+ <paramdef>out <parameter>host text</parameter></paramdef>
+ <paramdef>out <parameter>port integer</parameter></paramdef>
+ <paramdef>out <parameter>status text</parameter></paramdef>
+ <paramdef>out <parameter>role text</parameter></paramdef>
+ <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
+ <paramdef>out <parameter>total_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>success_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>fail_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>skip_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>retry_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>average_retry_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>max_retry_count bigint</parameter></paramdef>
+ <paramdef>out <parameter>max_health_check_duration bigint</parameter></paramdef>
+ <paramdef>out <parameter>min_health_check_duration bigint</parameter></paramdef>
+ <paramdef>out <parameter>average_health_check_duration float4</parameter></paramdef>
+ <paramdef>out <parameter>last_health_check timestamp</parameter></paramdef>
+ <paramdef>out <parameter>last_successful_health_check timestamp</parameter></paramdef>
+ <paramdef>out <parameter>last_skip_health_check timestamp</parameter></paramdef>
+ <paramdef>out <parameter>last_failed_health_check timestamp</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R3-PCP-HEALTH-CHECK-STATS-3">
+ <title>Description</title>
+ <para>
+ <function>pcp_health_check_stats</function>
+ displays health check statistics data on given node ID.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Arguments</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="parameter">node_id</replaceable></term>
+ <listitem>
+ <para>
+ The index of backend node to get information of.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">pcp_server</replaceable></term>
+ <listitem>
+ <para>
+ The foreign server name for pcp server.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other arguments </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+test=# select * from pcp_health_check_stats(node_id => 0, host => '', port => 11001, username => 't-ishii', password => 't-ishii');
+-[ RECORD 1 ]-----------------+--------------------
+node_id | 0
+host | /tmp
+port | 11002
+status | up
+role | primary
+last_status_change | 2020-02-25 16:05:29
+total_count | 3
+success_count | 3
+fail_count | 0
+skip_count | 0
+retry_count | 0
+average_retry_count | 0
+max_retry_count | 0
+max_health_check_duration | 5
+min_health_check_duration | 3
+average_health_check_duration | 4.333333
+last_health_check | 2020-02-25 16:05:47
+last_successful_health_check | 2020-02-25 16:05:47
+last_skip_health_check |
+last_failed_health_check |
+ </programlisting>
+ </para>
+
+ <para>
+ See <xref linkend="health-check-stats-data-table"> for details of data.
+ </para>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_adm_pcp_node_count.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-ADM-PCP-NODE-COUNT">
+ <indexterm zone="pgpool-adm-pcp-node-count">
+ <primary>pgpool_adm_pcp_node_count</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_adm_pcp_node_count</refentrytitle>
+ <manvolnum>3</manvolnum>
+ <refmiscinfo>pgpool_adm extension</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_adm_pcp_node_count</refname>
+ <refpurpose>
+ a function to retrieves number of backend nodes.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef><function>pcp_node_count</function> returns integer</funcdef>
+ <paramdef>text <parameter>host</parameter></paramdef>
+ <paramdef>integer <parameter>port</parameter></paramdef>
+ <paramdef>text <parameter>username</parameter></paramdef>
+ <paramdef>text <parameter>password</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef><function>pcp_node_count</function> returns integer</funcdef>
+ <paramdef>text <parameter>pcp_server</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R3-PCP-NODE-COUNT-3">
+ <title>Description</title>
+ <para>
+ <function>pcp_node_count</function> retrieves number of DB nodes.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Arguments</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="parameter">pcp_server</replaceable></term>
+ <listitem>
+ <para>
+ The foreign server name for pcp server.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other arguments </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ test=# SELECT * FROM pcp_node_count(host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
+ node_count
+ ------------
+ 2
+ (1 row)
+ </programlisting>
+ </para>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_adm_pcp_node_info.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-ADM-PCP-NODE-INFO">
+ <indexterm zone="pgpool-adm-pcp-node-info">
+ <primary>pgpool_adm_pcp_node_info</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_adm_pcp_node_info</refentrytitle>
+ <manvolnum>3</manvolnum>
+ <refmiscinfo>pgpool_adm extension</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_adm_pcp_node_info</refname>
+ <refpurpose>
+ a function to display the information on the given node
+ ID</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef><function>pcp_node_info</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>text <parameter>host</parameter></paramdef>
+ <paramdef>integer <parameter>port</parameter></paramdef>
+ <paramdef>text <parameter>username</parameter></paramdef>
+ <paramdef>text <parameter>password</parameter></paramdef>
+ <paramdef>out <parameter>status text</parameter></paramdef>
+ <paramdef>out <parameter>weight float4</parameter></paramdef>
+ <paramdef>out <parameter>role text</parameter></paramdef>
+ <paramdef>out <parameter>replication_delay bigint</parameter></paramdef>
+ <paramdef>out <parameter>replication_state text</parameter></paramdef>
+ <paramdef>out <parameter>replication_sync_state text</parameter></paramdef>
+ <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef><function>pcp_node_info</function> returns record</funcdef>
+ <paramdef>integer <parameter>node_id</parameter></paramdef>
+ <paramdef>text <parameter>pcp_server</parameter></paramdef>
+ <paramdef>out <parameter>status text</parameter></paramdef>
+ <paramdef>out <parameter>weight float4</parameter></paramdef>
+ <paramdef>out <parameter>role text</parameter></paramdef>
+ <paramdef>out <parameter>replication_delay bigint</parameter></paramdef>
+ <paramdef>out <parameter>replication_state text</parameter></paramdef>
+ <paramdef>out <parameter>replication_sync_state text</parameter></paramdef>
+ <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R3-PCP-NODE-INFO-3">
+ <title>Description</title>
+ <para>
+ <function>pcp_node_info</function>
+ displays the information on the given node ID.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Arguments</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="parameter">node_id</replaceable></term>
+ <listitem>
+ <para>
+ The index of backend node to get information of.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">pcp_server</replaceable></term>
+ <listitem>
+ <para>
+ The foreign server name for pcp server.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other arguments </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ test=# SELECT * FROM pcp_node_info(node_id => 1, host => '', port => 11001, username => 't-ishii', password => 't-ishii');
+ host | port | status | weight | role | replication_delay | replication_state | replication_sync_state | last_status_change
+ ------+-------+-------------------+--------+---------+-------------------+-------------------+------------------------+---------------------
+ /tmp | 11003 | Connection in use | 0 | Standby | 0 | streaming | async | 2019-04-23 15:02:46
+ (1 row)
+ </programlisting>
+ </para>
+
+ <note>
+ <para>
+ <parameter>role</parameter>, <parameter>replication_delay</parameter>, <parameter>last_status_change</parameter>
+ out parameters are new
+ from <productname>Pgpool-II</productname> 4.0. If you have
+ already installed pre-4.0 pgpool_adm extension, you can upgrade
+ to the new one by using ALTER EXTENSION SQL command.
+ <programlisting>
+ ALTER EXTENSION pgpool_adm UPDATE;
+ </programlisting>
+ </para>
+ </note>
+
+ <note>
+ <para>
+ <parameter>replication_state</parameter> and <parameter>replication_sync_state</parameter> out parameters are new from <productname>Pgpool-II</productname> 4.1. If you have
+ already installed pre-4.1 pgpool_adm extension, you can upgrade
+ to the new one by using ALTER EXTENSION SQL command.
+ <programlisting>
+ ALTER EXTENSION pgpool_adm UPDATE;
+ </programlisting>
+ </para>
+ </note>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_adm_pcp_pool_status.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-ADM-PCP-POOL-STATUS">
+ <indexterm zone="pgpool-adm-pcp-pool-status">
+ <primary>pgpool_adm_pcp_pool_status</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_adm_pcp_pool_status</refentrytitle>
+ <manvolnum>3</manvolnum>
+ <refmiscinfo>pgpool_adm extension</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_adm_pcp_pool_status</refname>
+ <refpurpose>
+ a function to retrieves parameters in pgpool.conf.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef><function>pcp_pool_status</function> returns record</funcdef>
+ <paramdef>text <parameter>host</parameter></paramdef>
+ <paramdef>integer <parameter>port</parameter></paramdef>
+ <paramdef>text <parameter>username</parameter></paramdef>
+ <paramdef>text <parameter>password</parameter></paramdef>
+ <paramdef>out <parameter>item text</parameter></paramdef>
+ <paramdef>out <parameter>value text</parameter></paramdef>
+ <paramdef>out <parameter>description text</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef><function>pcp_pool_status</function> returns record</funcdef>
+ <paramdef>text <parameter>pcp_server</parameter></paramdef>
+ <paramdef>out <parameter>item text</parameter></paramdef>
+ <paramdef>out <parameter>value text</parameter></paramdef>
+ <paramdef>out <parameter>description text</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R3-PCP-POOL-STATUS-3">
+ <title>Description</title>
+ <para>
+ <function>pcp_pool_status</function> retrieves parameters in
+ pgpool.conf.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Arguments</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="parameter">pcp_server</replaceable></term>
+ <listitem>
+ <para>
+ The foreign server name for pcp server.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>Other arguments </option></term>
+ <listitem>
+ <para>
+ See <xref linkend="pcp-common-options">.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ Here is an example output:
+ <programlisting>
+ test=# SELECT * FROM pcp_pool_status(host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii') WHERE item ~ 'backend.*0';
+ item | value | description
+ -------------------------+------------------------------------------------+-------------------------------
+ backend_hostname0 | /tmp | backend #0 hostname
+ backend_port0 | 11002 | backend #0 port number
+ backend_weight0 | 0.500000 | weight of backend #0
+ backend_data_directory0 | /home/t-ishii/work/pgpool-II/current/aaa/data0 | data directory for backend #0
+ backend_status0 | 2 | status of backend #0
+ backend_flag0 | ALLOW_TO_FAILOVER | backend #0 flag
+ (6 rows)
+ </programlisting>
+ </para>
+
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/reset.sgml
+PostgreSQL documentation
+-->
+
+<refentry id="SQL-PGPOOL-RESET">
+ <indexterm zone="sql-pgpool-reset">
+ <primary>RESET</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>PGPOOL RESET</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>PGPOOL RESET</refname>
+ <refpurpose>restore the value of a configuration parameter to the default value</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ PGPOOL RESET <replaceable class="PARAMETER">configuration_parameter</replaceable>
+ PGPOOL RESET ALL
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>PGPOOL RESET</command> command restores the value of
+ <productname>Pgpool-II</productname> configuration parameters to
+ the default value.
+ The default value is defined as the value that the parameter would have had,
+ if no <command>PGPOOL SET</command> had ever been issued for it in the
+ current session.
+
+ This command is similar to the
+ <ulink url="https://www.postgresql.org/docs/current/static/sql-reset.html">
+ <command>RESET</command></ulink> command in PostgreSQL with an addition
+ of <acronym>PGPOOL</acronym> keyword to distinguish it from the
+ PostgreSQL RESET command.
+
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>Parameters</title>
+
+ <variablelist>
+ <varlistentry>
+ <term><replaceable class="PARAMETER">configuration_parameter</replaceable></term>
+ <listitem>
+ <para>
+ Name of a settable <productname>Pgpool-II</productname> configuration parameter.
+ Available parameters are
+ documented in <xref linkend="runtime-config">.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>ALL</literal></term>
+ <listitem>
+ <para>
+ Resets all settable <productname>Pgpool-II</productname> configuration parameters to default values.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Examples</title>
+
+ <para>
+ Reset the value of <xref linkend="guc-client-idle-limit"> parameter:
+ <screen>
+ PGPOOL RESET client_idle_limit;
+ </screen></para>
+
+ <para>
+ Reset the value of all parameter to default:
+ <screen>
+ PGPOOL RESET ALL;
+ </screen></para>
+ </refsect1>
+
+
+ <refsect1>
+ <title>See Also</title>
+
+ <simplelist type="inline">
+ <member><xref linkend="SQL-PGPOOL-SET"></member>
+ <member><xref linkend="SQL-PGPOOL-SHOW"></member>
+ </simplelist>
+ </refsect1>
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/set.sgml
+PostgreSQL documentation
+-->
+
+<refentry id="SQL-PGPOOL-SET">
+ <indexterm zone="sql-pgpool-set">
+ <primary>SET</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>PGPOOL SET</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>PGPOOL SET</refname>
+ <refpurpose>change a configuration parameter</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ PGPOOL SET <replaceable class="PARAMETER">configuration_parameter</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+
+ The <command>PGPOOL SET</command> command changes the value of
+ <productname>Pgpool-II</productname> configuration parameters for the current session.
+
+ This command is similar to the
+ <ulink url="https://www.postgresql.org/docs/current/static/sql-set.html">
+ <command>SET</command></ulink> command in PostgreSQL with an addition
+ of <acronym>PGPOOL</acronym> keyword to distinguish it from the
+ PostgreSQL SET command.
+ Many of the configuration parameters listed in
+ <xref linkend="runtime-config"> can be changed on-the-fly with
+ <command>PGPOOL SET</command> and it only affects the value used by the current
+ session.
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>Examples</title>
+
+ <para>
+ Change the value of <xref linkend="guc-client-idle-limit"> parameter:
+ <programlisting>
+ PGPOOL SET client_idle_limit = 350;
+ </programlisting>
+ </para>
+
+ <para>
+ Reset the value of <xref linkend="guc-client-idle-limit"> parameter to default:
+ <programlisting>
+ PGPOOL SET client_idle_limit TO DEFAULT;
+ </programlisting>
+ </para>
+
+ <para>
+ Change the value of <xref linkend="guc-log-min-messages"> parameter:
+ <programlisting>
+ PGPOOL SET log_min_messages TO INFO;
+ </programlisting>
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <simplelist type="inline">
+ <member><xref linkend="SQL-PGPOOL-RESET"></member>
+ <member><xref linkend="SQL-PGPOOL-SHOW"></member>
+ </simplelist>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgpool_setup.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPOOL-SETUP">
+ <indexterm zone="pgpool-setup">
+ <primary>pgpool_setup</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgpool_setup</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>Other Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgpool_setup</refname>
+ <refpurpose>
+ Create a temporary installation of Pgpool-II cluster</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pgpool_setup</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PGPOOL-SETUP-1">
+ <title>
+ Description
+ </title>
+ <para>
+ <application>pgpool_setup</application> creates a temporary
+ installation of <productname>Pgpool-II</productname> cluster, which
+ includes a <productname>Pgpool-II</productname> installation and
+ specified number of <productname>PostgreSQL</productname>
+ installations under current directory.
+ Current directory must be empty before running <application>pgpool_setup</application>.
+ </para>
+ <para>
+ <application>pgpool_setup</application> is for testing purpose
+ only and should not be used to create production installations.
+ </para>
+
+ <para>
+ <application>pgpool_setup</application> executes
+ <application>ssh</application> against localhost. You need to
+ configure <application>ssh</application> so that it can login to
+ localhost without password.
+ </para>
+
+ <para>
+ Currently <application>pgpool_setup</application> supports
+ streaming replication mode, native replication mode, raw mode,
+ logical replication mode and snapshot isolation mode. To support watchdog,
+ see <xref linkend="WATCHDOG-SETUP"> for details.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <application>pgpool_setup</application> accepts the following command-line arguments:
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-m <replaceable class="parameter">mode</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the running mode. <replaceable>mode</replaceable>
+ can be <literal>r</literal> (native replication mode), <literal>s</literal> (streaming replication mode),
+ <literal>n</literal> (raw mode), <literal>l</literal>
+ (logical replication mode), <literal>y</literal> (slony mode) or <literal>i</literal> (snapshot isolation mode). If this is
+ omitted, <literal>s</literal> is assumed.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">num_clusters</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the number of PostgreSQL installations.
+ If this is omitted, <literal>2</literal> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p <replaceable class="parameter">base_port</replaceable></option></term>
+ <listitem>
+ <para>
+ Specify the base port number used by Pgpool-II and PostgreSQL.
+ Pgpool-II port is base_port. pcp port is base_port + 1. The
+ first PostgreSQL node's port is base_port + 2, second
+ PostgreSQL node's port is base_port + 3 and so on.
+ </para>
+ <para>
+ If -pg option is specified, the first PostgreSQL node's port is
+ assigned to pg_base_port, the second PostgreSQL node's port is
+ pg_base_port + 1 and so on.
+ </para>
+ <para>
+ If this is omitted, <literal>11000</literal> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-pg <replaceable class="parameter">pg_base_port</replaceable></option></term>
+ <listitem>
+ <para>
+ Specify the base port number used by PostgreSQL.
+ The first PostgreSQL node's port is base_port + 2, second
+ PostgreSQL node's port is base_port + 3 and so on.
+ </para>
+ <para>
+ If this is omitted, <literal>base_port</literal>+2 is used.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--no-stop</option></term>
+ <listitem>
+ <para>
+ Do not stop pgpool and PostgreSQL after the work.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d</option></term>
+ <listitem>
+ <para>
+ Start pgpool with debug mode.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-s</option></term>
+ <listitem>
+ <para>
+ In streaming replication mode, use replication slot instead
+ of archive. Since the archive directory is shared by all
+ <productname>PostgreSQL</productname> clusters, if a standby
+ is promoted, the time line in the archive directory will be
+ changed and other standby servers will be stopped. Using a
+ replication slot does not have this problem and is always
+ preferable if you can
+ use <productname>PostgreSQL</productname> 9.4 or later, which
+ supports replication slot. The replication slot name used
+ by <application>pgpool_setup</application>
+ is <literal>pgpool_setup_slot</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-r</option></term>
+ <listitem>
+ <para>
+ Use <command>pg_rewind</command> command in recovery script
+ (basebackup.sh). If the command fails, switch to use ordinal
+ rsync command. In certain cases recovery
+ using <command>pg_rewind</command> is much faster than rsync
+ since it does not copy whole database cluster.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Environment variables</title>
+ <para>
+ <application>pgpool_setup</application> recognizes following environment variables:
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>PGPOOL_INSTALL_DIR</option></term>
+ <listitem>
+ <para>
+ Specifies the Pgpool-II installation directory. Pgpool-II
+ binaries is expected to be placed under PGPOOL_INSTALL_DIR/bin
+ and pgpool.conf and pool_hba.conf etc. are expected to be placed under
+ PGPOOL_INSTALL_DIR/etc. The default is /usr/local.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGPOOLDIR</option></term>
+ <listitem>
+ <para>
+ Specifies the path to Pgpool-II configuration files.
+ The default is PGPOOL_INSTALL_DIR/etc.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGBIN</option></term>
+ <listitem>
+ <para>
+ Specifies the path to PostgreSQL commands such as initdb, pg_ctl and psql.
+ The default is /usr/local/pgsql/bin.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGLIB</option></term>
+ <listitem>
+ <para>
+ Specifies the path to PostgreSQL shared libraries.
+ The default is /usr/local/pgsql/lib.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGSOCKET_DIR</option></term>
+ <listitem>
+ <para>
+ Specifies the path to Unix socket directory.
+ The default is /tmp.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>INITDBARG</option></term>
+ <listitem>
+ <para>
+ Specifies the arguments for initdb command.
+ The default is "--no-locale -E UTF_8".
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>USE_REPLICATION_SLOT</option></term>
+ <listitem>
+ <para>
+ If "true", in streaming replication mode, use replication slot instead
+ of archive. This brings the same effect as "-s" option is specified.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>USE_PG_REWIND</option></term>
+ <listitem>
+ <para>
+ If "true", in streaming replication mode, use <command>pg_rewind</command> in basebackup.sh script.
+ This brings the same effect as "-r" option is specified.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ <screen>
+$ pgpool_setup
+PostgreSQL major version: 124
+Starting set up in streaming replication mode
+creating startall and shutdownall
+creating failover script
+creating database cluster /tmp/test/data0...done.
+update postgresql.conf
+creating pgpool_remote_start
+creating basebackup.sh
+creating recovery.conf
+creating database cluster /tmp/test/data1...done.
+update postgresql.conf
+creating pgpool_remote_start
+creating basebackup.sh
+creating recovery.conf
+temporarily start data0 cluster to create extensions
+temporarily start pgpool-II to create standby nodes
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | true | 0 | | | 2020-08-18 13:50:19
+ 1 | /tmp | 11003 | down | 0.500000 | standby | 0 | false | 0 | | | 2020-08-18 13:50:18
+(2 rows)
+
+recovery node 1...pcp_recovery_node -- Command Successful
+done.
+creating follow primary script
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | true | 0 | | | 2020-08-18 13:50:19
+ 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | false | 0 | | | 2020-08-18 13:50:23
+(2 rows)
+
+shutdown all
+
+pgpool-II setting for streaming replication mode is done.
+To start the whole system, use /tmp/test/startall.
+To shutdown the whole system, use /tmp/test/shutdownall.
+pcp command user name is "t-ishii", password is "t-ishii".
+Each PostgreSQL, pgpool-II and pcp port is as follows:
+#1 port is 11002
+#2 port is 11003
+pgpool port is 11000
+pcp port is 11001
+The info above is in README.port.
+t-ishii$ ./startall
+waiting for server to start....5744 2020-08-18 13:50:27 JST LOG: starting PostgreSQL 12.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
+5744 2020-08-18 13:50:27 JST LOG: listening on IPv4 address "0.0.0.0", port 11002
+5744 2020-08-18 13:50:27 JST LOG: listening on IPv6 address "::", port 11002
+5744 2020-08-18 13:50:27 JST LOG: listening on Unix socket "/tmp/.s.PGSQL.11002"
+5744 2020-08-18 13:50:27 JST LOG: redirecting log output to logging collector process
+5744 2020-08-18 13:50:27 JST HINT: Future log output will appear in directory "log".
+ done
+server started
+waiting for server to start....5757 2020-08-18 13:50:27 JST LOG: starting PostgreSQL 12.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
+5757 2020-08-18 13:50:27 JST LOG: listening on IPv4 address "0.0.0.0", port 11003
+5757 2020-08-18 13:50:27 JST LOG: listening on IPv6 address "::", port 11003
+5757 2020-08-18 13:50:27 JST LOG: listening on Unix socket "/tmp/.s.PGSQL.11003"
+5757 2020-08-18 13:50:27 JST LOG: redirecting log output to logging collector process
+5757 2020-08-18 13:50:27 JST HINT: Future log output will appear in directory "log".
+ done
+server started
+t-ishii$ psql -p 11000 test
+psql (12.4)
+Type "help" for help.
+
+test=# show pool_nodes;
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | true | 0 | | | 2020-08-18 13:50:32
+ 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | false | 0 | streaming | async | 2020-08-18 13:50:32
+(2 rows)
+
+ </screen>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/show.sgml
+PostgreSQL documentation
+-->
+
+<refentry id="SQL-PGPOOL-SHOW">
+ <indexterm zone="sql-pgpool-show">
+ <primary>SHOW</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>PGPOOL SHOW</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>PGPOOL SHOW</refname>
+ <refpurpose>show the value of a configuration parameter</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ PGPOOL SHOW <replaceable class="PARAMETER">configuration_parameter</replaceable>
+ PGPOOL SHOW <replaceable class="PARAMETER">configuration_parameter_group</replaceable>
+ PGPOOL SHOW ALL
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>PGPOOL SHOW</command> will display the current value of
+ <productname>Pgpool-II</productname> configuration parameters.
+
+ This command is similar to the
+ <ulink url="https://www.postgresql.org/docs/current/static/sql-show.html">
+ <command>SHOW</command></ulink> command in PostgreSQL with an addition
+ of <acronym>PGPOOL</acronym> keyword to distinguish it from the
+ PostgreSQL SHOW command.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Parameters</title>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable class="PARAMETER">configuration_parameter</replaceable></term>
+ <listitem>
+ <para>
+ The name of a <productname>Pgpool-II</productname> configuration parameter.
+ Available parameters are documented in <xref linkend="runtime-config">
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="PARAMETER">configuration_parameter_group</replaceable></term>
+ <listitem>
+ <para>
+ The name of the <productname>Pgpool-II</productname> configuration parameter group.
+ Currently there are three parameter groups.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>backend</literal></term>
+ <listitem>
+ <para>
+ Configuration group of all backend config parameters.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>other_pgpool</literal></term>
+ <listitem>
+ <para>
+ Configuration group of all watchdog node config parameters.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>heartbeat</literal></term>
+ <listitem>
+ <para>
+ configuration group of all watchdog heartbeat node config parameters.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>health_check</literal></term>
+ <listitem>
+ <para>
+ configuration group of all health check parameters.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>ALL</literal></term>
+ <listitem>
+ <para>
+ Show the values of all configuration parameters, with descriptions.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Examples</title>
+
+ <para>
+ Show the current setting of the parameter <xref linkend="guc-port">:
+
+ <programlisting>
+ PGPOOL SHOW port;
+ port
+ ------
+ 9999
+ (1 row)
+ </programlisting>
+ </para>
+
+ <para>
+ Show the current setting of the parameter <xref linkend="guc-write-function-list">:
+ <programlisting>
+ PGPOOL SHOW write_function_list;
+ write_function_list
+ ---------------------
+ nextval,setval
+ (1 row)
+ </programlisting>
+ </para>
+
+ <para>
+ Show the current settings of all the configuration parameters belonging to backend group:
+ <programlisting>
+ PGPOOL SHOW backend;
+ item | value | description
+ -------------------------+-------------------------+-----------------------------------------------------------
+ backend_hostname0 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
+ backend_port0 | 5434 | port number of PostgreSQL backend.
+ backend_weight0 | 0 | load balance weight of backend.
+ backend_data_directory0 | /var/lib/pgsql/data | data directory of the backend.
+ backend_flag0 | ALLOW_TO_FAILOVER | Controls various backend behavior.
+ backend_hostname1 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
+ backend_port1 | 5432 | port number of PostgreSQL backend.
+ backend_weight1 | 1 | load balance weight of backend.
+ backend_data_directory1 | /home/work/installed/pg | data directory of the backend.
+ backend_flag1 | ALLOW_TO_FAILOVER | Controls various backend behavior.
+ (10 rows)
+ </programlisting></para>
+
+ <para>
+ Show all settings:
+ <programlisting>
+ PGPOOL SHOW ALL;
+ item | value | description
+ -------------------------+-------------------------+-----------------------------------------------------------
+ backend_hostname0 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
+ backend_port0 | 5434 | port number of PostgreSQL backend.
+ backend_weight0 | 0 | load balance weight of backend.
+ backend_data_directory0 | /var/lib/pgsql/data | data directory of the backend.
+ backend_flag0 | ALLOW_TO_FAILOVER | Controls various backend behavior.
+ backend_hostname1 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
+ backend_port1 | 5432 | port number of PostgreSQL backend.
+ backend_weight1 | 1 | load balance weight of backend.
+ backend_data_directory1 | /home/work/installed/pg | data directory of the backend.
+ backend_flag1 | ALLOW_TO_FAILOVER | Controls various backend behavior.
+ other_pgpool_hostname0 | localhost | Hostname of other pgpool node for watchdog connection.
+ .
+ .
+ .
+ ssl | off | Enables SSL support for frontend and backend connections
+ (138 rows)
+
+ </programlisting></para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <simplelist type="inline">
+ <member><xref linkend="SQL-PGPOOL-SET"></member>
+ </simplelist>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/pgproto.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="PGPROTO">
+ <indexterm zone="pgproto">
+ <primary>pgproto</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>pgproto</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>Other Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>pgproto</refname>
+ <refpurpose>
+ tests <productname>PostgreSQL</productname> or any other servers that understand the frontend/backend protocol.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>pgproto</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-PGPROTO-1">
+ <title>Description</title>
+ <para>
+ <command>pgproto</command>
+ tests <productname>PostgreSQL</productname> or any other servers that understand the frontend/backend protocol.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><option>-h <replaceable class="parameter">hostname</replaceable></option></term>
+ <term><option>--hostname=<replaceable class="parameter">hostname</replaceable></option></term>
+ <listitem>
+ <para>
+ The host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket (default: Unix-domain socket).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
+ <term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
+ <listitem>
+ <para>
+ The port number (default:5432).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-u <replaceable class="parameter">username</replaceable></option></term>
+ <term><option>--user=<replaceable class="parameter">username</replaceable></option></term>
+ <listitem>
+ <para>
+ The user name (default: OS user name).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d <replaceable class="parameter">databasename</replaceable></option></term>
+ <term><option>--database=<replaceable class="parameter">databasename</replaceable></option></term>
+ <listitem>
+ <para>
+ The database name (default: same as user).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-f <replaceable class="parameter">filename</replaceable></option></term>
+ <term><option>--proto-data-file=<replaceable class="parameter">filename</replaceable></option></term>
+ <listitem>
+ <para>
+ Text file describing message data to be sent to <productname>PostgreSQL</productname> (default: pgproto.data).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-r <replaceable class="parameter">naptime</replaceable></option></term>
+ <term><option>--read-nap=<replaceable class="parameter">naptime</replaceable></option></term>
+ <listitem>
+ <para>
+ The nap time in micro seconds (default:0).
+ Greater than 0 will let pgproto sleep between each data reading from socket.
+ This is useful to simulate slow clients.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-D</option></term>
+ <term><option>--debug</option></term>
+ <listitem>
+ <para>
+ Enable debug message.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-v</option></term>
+ <term><option>--version</option></term>
+ <listitem>
+ <para>
+ Print the command version, then exit.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-?</option></term>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>
+ Shows help for the command line arguments, then exit.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ In the example below, the first character in the file (i.e. 'Q')
+ indicates the message kind specified in the PostgreSQL frontend/backend protocol.
+ </para>
+ <para>
+ Exceptions are 'Y' and 'y'. 'Y' reads messages from backend
+ until 'Ready for query' is received.
+ 'y' reads messages from backend while messages are coming from backend then stops
+ if messages are not available for 1 second.
+ 'Y' is used for waiting for reply of 'Q' (simple query) or after 'S' (sync) in extended queries.
+ 'y' can be used for receiving messages after 'H' (flush).
+ </para>
+ <para>
+ If you want to include a " (double quotation) in a string data type,
+ for example "SELECT * FROM "aaa"", you can qualify it by using \ (back slash) like ""SELECT * FROM "aaa""
+
+ A command line spread over multiple lines can be created using \ as well.
+ <programlisting>
+ 'Q' "SELECT * FROM aaa \
+ WHERE a = 1"
+ </programlisting>
+ </para>
+ <para>
+ Here is an example input file:
+ <programlisting>
+ #
+ # Test data example
+ #
+ 'Q' "SELECT * FROM aaa"
+ 'Y'
+ 'P' "S1" "BEGIN" 0
+ 'B' "" "S1" 0 0 0
+ 'E' "" 0
+ 'C' 'S' "S1"
+ 'P' "foo" "SELECT 1" 0
+ 'B' "myportal" "foo" 0 0 0
+ 'E' "myportal" 0
+ 'P' "S2" "COMMIT" 0
+ 'B' "" "S2" 0 0 0
+ 'E' "" 0
+ 'C' 'S' "S2"
+ 'S'
+ 'Y'
+ 'X'
+ </programlisting>
+ </para>
+ <para>
+ Here is an example output:
+ <programlisting>
+ $ pgproto -p 11000 -d test -f sample.data
+ FE=> Query (query="SELECT * FROM aaa")
+ <= BE RowDescription
+ <= BE CommandComplete(SELECT 0)
+ <= BE ReadyForQuery(I)
+ FE=> Parse(stmt="S1", query="BEGIN")
+ FE=> Bind(stmt="S1", portal="")
+ FE=> Execute(portal="")
+ FE=> Close(stmt="S1")
+ FE=> Parse(stmt="foo", query="SELECT 1")
+ FE=> Bind(stmt="foo", portal="myportal")
+ FE=> Execute(portal="myportal")
+ FE=> Parse(stmt="S2", query="COMMIT")
+ FE=> Bind(stmt="S2", portal="")
+ FE=> Execute(portal="")
+ FE=> Close(stmt="S2")
+ FE=> Sync
+ <= BE ParseComplete
+ <= BE BindComplete
+ <= BE CommandComplete(BEGIN)
+ <= BE CloseComplete
+ <= BE ParseComplete
+ <= BE BindComplete
+ <= BE DataRow
+ <= BE CommandComplete(SELECT 1)
+ <= BE ParseComplete
+ <= BE BindComplete
+ <= BE CommandComplete(COMMIT)
+ <= BE CloseComplete
+ <= BE ReadyForQuery(I)
+ FE=> Terminate
+ </programlisting>
+ </para>
+ <para>
+ Other example data files:
+ </para>
+ <para>
+ Copy
+ <programlisting>
+ #
+ # Test data example
+ #
+
+ # CopyIn
+ #
+ 'Q' "COPY t1 FROM STDIN"
+ # CopyData
+ 'd' "abc"
+ # CopyDone
+ 'c'
+ 'Y'
+
+ # CopyOut
+ #
+ 'Q' "COPY t1 TO STDOUT"
+ 'Y'
+
+ #
+ # Copy fail case
+ #
+ 'Q' "COPY t1 FROM STDIN"
+ # CopyData
+ 'd' "abc"
+ # CopyFail
+ 'f' "pgproto copy fail test"
+ 'Y'
+ 'X'
+ </programlisting>
+ </para>
+ <para>
+ Function Call
+ <programlisting>
+ #
+ # Test data example
+ #
+
+ # Function call (lo_creat)
+ # from PostgreSQL's src/include/catalog/pg_proc.data
+ # { oid => '957', descr => 'large object create',
+ # proname => 'lo_creat', provolatile => 'v', proparallel => 'u',
+ # prorettype => 'oid', proargtypes => 'int4', prosrc => 'be_lo_creat' },
+
+ 'F' 957 1 0 1 1 "0" 0
+ 'Y'
+ 'X'
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_backend_stats.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-BACKEND-STATS">
+ <indexterm zone="sql-show-pool-backend-stats">
+ <primary>SHOW POOL_BACKEND_STATS</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL_BACKEND_STATS</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_BACKEND_STATS</refname>
+ <refpurpose>
+ show backend SQL command statistics
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_BACKEND_STATS
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_BACKEND_STATS</command> displays the node id,
+ the hostname, the port, the status, the role, the
+ SELECT/INSERT/UPDATE/DELETE/DDL/other query counts issued to each
+ backend. Also error messages returned from backend are counted and
+ shown, classified by the severity. The node id, the hostname, the
+ port, the status, the role are same as <xref
+ linkend="sql-show-pool-nodes">.
+ </para>
+ <para>
+ select_cnt, insert_cnt, update_cnt, delete_cnt, ddl_cnt, other_cnt
+ are the numbers of SQL command: SELECT, INSERT, UPDATE, DELETE, DDL
+ and others issued since <productname>Pgpool-II</productname>
+ started. Failed commands (for example SELECT from non-existing
+ table) are counted. Commands rolled back are also
+ counted. Currently, other than
+ SELECT/WITH/INSERT/UPDATE/DELETE/CHECKPOINT/DEALLOCATE/DISCARD/EXECUTE/
+ EXPLAIN/LISTEN/LOAD/LOCK/NOTIFY/PREPARE/SET/SHOW/Transaction
+ commands/UNLISTEN are considered as DDL.
+ </para>
+ <para>
+ Here is an example session:
+ <programlisting>
+test=# show pool_backend_stats;
+ node_id | hostname | port | status | role | select_cnt | insert_cnt | update_cnt | delete_cnt | ddl_cnt | other_cnt | panic_cnt | fatal_cnt | error_cnt
+---------+----------+-------+--------+---------+------------+------------+------------+------------+---------+-----------+-----------+-----------+-----------
+ 0 | /tmp | 11002 | up | primary | 12 | 10 | 30 | 0 | 2 | 30 | 0 | 0 | 1
+ 1 | /tmp | 11003 | up | standby | 12 | 0 | 0 | 0 | 0 | 23 | 0 | 0 | 1
+(2 rows)
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_cache.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-CACHE">
+ <indexterm zone="sql-show-pool-cache">
+ <primary>SHOW</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL_CACHE</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_CACHE</refname>
+ <refpurpose>
+ displays cache storage statistics
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_CACHE
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_CACHE</command>
+ displays <link linkend="runtime-in-memory-query-cache">in memory
+ query cache </link> statistics if in memory query cache is
+ enabled. Here is an example session:
+ <programlisting>
+ test=# \x
+ \x
+ Expanded display is on.
+ test=# show pool_cache;
+ show pool_cache;
+ -[ RECORD 1 ]---------------+---------
+ num_cache_hits | 891703
+ num_selects | 99995
+ cache_hit_ratio | 0.90
+ num_hash_entries | 131072
+ used_hash_entries | 99992
+ num_cache_entries | 99992
+ used_cache_entries_size | 12482600
+ free_cache_entries_size | 54626264
+ fragment_cache_entries_size | 0
+ </programlisting>
+
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_health_check_stats.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-HEALTH-CHECK-STATS">
+ <indexterm zone="sql-show-pool-health-check-stats">
+ <primary>SHOW POOL_HEALTH_CHECK_STATS</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL_HEALTH_CHECK_STATS</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_HEALTH_CHECK_STATS</refname>
+ <refpurpose>
+ show health check statistics data
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_HEALTH_CHECK_STATS
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_HEALTH_CHECK_STATS</command> displays health
+ check (see <xref linkend="runtime-config-health-check">) statistic
+ data mostly collected by health check process. This command helps
+ <productname>Pgpool-II</productname> admin to study events related
+ to health check. For example, admin can easily locate the failover
+ event in the log file by looking at "last_failed_health_check"
+ column. Another example is finding unstable connection to backend
+ by evaluating "average_retry_count" column. If particular node
+ shows higher retry count than other node, there may be problem to
+ the connection to the backend.
+ </para>
+
+ <para>
+ <xref linkend="health-check-stats-data-table"> shows each column name and its description.
+ </para>
+
+ <table id="health-check-stats-data-table">
+ <title>Statistics data shown by pool_health_check_stats command</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Column Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>node_id</entry>
+ <entry>
+ Backend node id.
+ </entry>
+ </row>
+
+ <row>
+ <entry>hostname</entry>
+ <entry>
+ Backend hostname or UNIX domain socket path.
+ </entry>
+ </row>
+
+ <row>
+ <entry>port</entry>
+ <entry>
+ Backend port number.
+ </entry>
+ </row>
+
+ <row>
+ <entry>status</entry>
+ <entry>
+ Backend status. One of up, down, waiting, unused or quarantine.
+ </entry>
+ </row>
+
+ <row>
+ <entry>role</entry>
+ <entry>
+ Role of the node. Either primary or standby in streaming
+ replication mode. Either main or replica in other mode.
+ </entry>
+ </row>
+
+ <row>
+ <entry>last_status_change</entry>
+ <entry>
+ Timestamp of last backend status changed.
+ </entry>
+ </row>
+
+ <row>
+ <entry>total_count</entry>
+ <entry>
+ Number of health check count in total.
+ </entry>
+ </row>
+
+ <row>
+ <entry>success_count</entry>
+ <entry>
+ Number of successful health check count in total.
+ </entry>
+ </row>
+
+ <row>
+ <entry>fail_count</entry>
+ <entry>
+ Number of failed health check count in total.
+ </entry>
+ </row>
+
+ <row>
+ <entry>skip_count</entry>
+ <entry>
+ Number of skipped health check count in total. If the node is
+ already down, health check skips the node.
+ </entry>
+ </row>
+
+ <row>
+ <entry>retry_count</entry>
+ <entry>
+ Number of retried health check count in total.
+ </entry>
+ </row>
+
+ <row>
+ <entry>average_retry_count</entry>
+ <entry>
+ Number of average retried health check count in a health check
+ session.
+ </entry>
+ </row>
+
+ <row>
+ <entry>max_retry_count</entry>
+ <entry>
+ Number of maximum retried health check count in a health check
+ session.
+ </entry>
+ </row>
+
+ <row>
+ <entry>max_duration</entry>
+ <entry>
+ Maximum health check duration in Millie seconds. If a health
+ check session retries, the health check duration is sum of each
+ retried health check.
+ </entry>
+ </row>
+
+ <row>
+ <entry>min_duration</entry>
+ <entry>
+ Minimum health check duration in Millie seconds. If a health
+ check session retries, the health check duration is sum of each
+ retried health check.
+ </entry>
+ </row>
+
+ <row>
+ <entry>average_duration</entry>
+ <entry>
+ Average health check duration in Millie seconds. If a health
+ check session retries, the health check duration is sum of each
+ retried health check.
+ </entry>
+ </row>
+
+ <row>
+ <entry>last_health_check</entry>
+ <entry>
+ Timestamp of last health check. If heath check does not
+ performed yet, empty string.
+ </entry>
+ </row>
+
+ <row>
+ <entry>last_successful_health_check</entry>
+ <entry>
+ Timestamp of last successful health check. If heath check does
+ not succeeds yet, empty string.
+ </entry>
+ </row>
+
+ <row>
+ <entry>last_skip_health_check</entry>
+ <entry>
+ Timestamp of last skipped health check. If heath check is not
+ skipped yet, empty string. Note that it is possible that this
+ field is an empty string even if the status is down. In this
+ case failover was triggered by other than health check process.
+ </entry>
+ </row>
+
+ <row>
+ <entry>last_failed_health_check</entry>
+ <entry>
+ Timestamp of last failed health check. If heath check does not
+ fail yet, empty string. Note that it is possible that this
+ field is an empty string even if the status is down. In this
+ case failover was triggered by other than health check process.
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ Here is an example session:
+ <programlisting>
+test=# show pool_health_check_stats;
+-[ RECORD 1 ]----------------+--------------------
+node_id | 0
+hostname | /tmp
+port | 11002
+status | up
+role | primary
+last_status_change | 2020-01-26 19:08:45
+total_count | 27
+success_count | 27
+fail_count | 0
+skip_count | 0
+retry_count | 0
+average_retry_count | 0.000000
+max_retry_count | 0
+max_duration | 9
+min_duration | 2
+average_duration | 6.296296
+last_health_check | 2020-01-26 19:12:45
+last_successful_health_check | 2020-01-26 19:12:45
+last_skip_health_check |
+last_failed_health_check |
+-[ RECORD 2 ]----------------+--------------------
+node_id | 1
+hostname | /tmp
+port | 11003
+status | down
+role | standby
+last_status_change | 2020-01-26 19:11:48
+total_count | 19
+success_count | 12
+fail_count | 1
+skip_count | 6
+retry_count | 3
+average_retry_count | 0.230769
+max_retry_count | 3
+max_duration | 83003
+min_duration | 0
+average_duration | 6390.307692
+last_health_check | 2020-01-26 19:12:48
+last_successful_health_check | 2020-01-26 19:10:15
+last_skip_health_check | 2020-01-26 19:12:48
+last_failed_health_check | 2020-01-26 19:11:48
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_nodes.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-NODES">
+ <indexterm zone="sql-show-pool-nodes">
+ <primary>SHOW POOL_NODES</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL NODES</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_NODES</refname>
+ <refpurpose>
+ sends back a list of all configured nodes
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_NODES
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_NODES</command> displays the node id, the
+ hostname, the port, the status, the weight (only meaningful if
+ you use the load balancing mode), the role, the SELECT query
+ counts issued to each backend, whether each node is the load
+ balance node or not, the replication delay (only if in streaming
+ replication mode) and last status change time. In addition to
+ this replication state and sync state are shown for standby nodes
+ in <productname>Pgpool-II</productname> 4.1 or after. The
+ possible values in the status column are explained in
+ the <xref linkend="pcp-node-info"> reference. If the hostname is
+ something like "/tmp", that means
+ <productname>Pgpool-II</productname> is connecting to backend by
+ using UNIX domain sockets. The SELECT count does not include
+ internal queries used
+ by <productname>Pgpool-II</productname>. Also the counters are
+ reset to zero upon starting up
+ of <productname>Pgpool-II</productname>. The last status change
+ time is initially set to the
+ time <productname>Pgpool-II</productname> starts. After that
+ whenever "status" or "role" is changed, it is updated.
+ </para>
+ <para>
+ Here is an example session:
+ <programlisting>
+ test=# show pool_nodes;
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | false | 0 | | | 2019-04-22 16:13:46
+ 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | true | 0 | streaming | async | 2019-04-22 16:13:46
+ (2 rows)
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_pools.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-POOLS">
+ <indexterm zone="sql-show-pool-pools">
+ <primary>SHOW POOL_POOLS</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL_POOLS</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_POOLS</refname>
+ <refpurpose>
+ sends back a list of pools handled
+ by <productname>Pgpool-II</productname>.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_POOLS
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_POOLS</command> sends back a list of pools
+ handled by
+ <productname>Pgpool-II</productname>
+ </para>
+ <para>
+ It has 11 columns:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>pool_pid</literal> is the PID of the
+ displayed <productname>Pgpool-II</productname> process.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>start_time</literal> is the timestamp of when
+ this process was launched.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>pool_id</literal> is the pool identifier (should
+ be between 0 and <xref linkend="guc-max-pool"> - 1)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>backend_id</literal> is the backend identifier (should
+ be between 0 and the number of configured backends minus one)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>database</literal> is the database name for this
+ process's pool id connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>username</literal> is the user name for this
+ process's pool id connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>create_time</literal> is the creation time and
+ date of the connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>majorversion</literal>
+ and <literal>minorversion</literal> are the protocol
+ version numbers used in this connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>pool_counter</literal> counts the number of times
+ this pool of connections (process) has been used by
+ clients.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>pool_backendpid</literal> is the PID of the
+ PostgreSQL process.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <literal>pool_connected</literal> is true (1) if a
+ frontend is currently using this backend.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+ <para>
+ It'll always return <xref linkend="guc-num-init-children"> * <xref linkend="guc-max-pool"> *
+ number_of_backends lines. Here is an example session:
+ <programlisting>
+ test=# show pool_pools;
+ pool_pid | start_time | pool_id | backend_id | database | username | create_time | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected
+ ----------+---------------------+---------+------------+----------+----------+---------------------+--------------+--------------+--------------+-----------------+----------------
+ 19696 | 2016-10-17 13:24:17 | 0 | 0 | postgres | t-ishii | 2016-10-17 13:35:12 | 3 | 0 | 1 | 20079 | 1
+ 19696 | 2016-10-17 13:24:17 | 0 | 1 | postgres | t-ishii | 2016-10-17 13:35:12 | 3 | 0 | 1 | 20080 | 1
+ 19696 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19696 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19696 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19696 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19696 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19696 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19697 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19698 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19699 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19700 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19701 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19702 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19703 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19704 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19705 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19706 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19707 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19708 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19709 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19710 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19711 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19712 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19713 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19714 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19715 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19716 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19717 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19718 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19719 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19720 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20024 | 2016-10-17 13:33:46 | 0 | 0 | test | t-ishii | 2016-10-17 14:30:53 | 3 | 0 | 1 | 22055 | 1
+ 20024 | 2016-10-17 13:33:46 | 0 | 1 | test | t-ishii | 2016-10-17 14:30:53 | 3 | 0 | 1 | 22056 | 1
+ 20024 | 2016-10-17 13:33:46 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20024 | 2016-10-17 13:33:46 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20024 | 2016-10-17 13:33:46 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20024 | 2016-10-17 13:33:46 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20024 | 2016-10-17 13:33:46 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20024 | 2016-10-17 13:33:46 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 20600 | 2016-10-17 13:46:58 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19723 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19724 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19725 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19726 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
+ 19727 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
+ (256 rows)
+ </programlisting>
+
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_processes.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-PROCESSES">
+ <indexterm zone="sql-show-pool-processes">
+ <primary>SHOW POOL_PROCESSES</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL_PROCESSES</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_PROCESSES</refname>
+ <refpurpose>
+ sends back a list of all <productname>Pgpool-II</productname>
+ processes waiting for connections and dealing with a connection
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_PROCESSES
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_PROCESSES</command> sends back a list of all
+ <productname>Pgpool-II</productname> processes waiting for
+ connections and dealing with a connection.
+ </para>
+ <para>
+ It has 6 columns:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>pool_pid</literal> is the PID of the
+ displayed <productname>Pgpool-II</productname> process.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>start_time</literal> is the timestamp of when
+ this process was launched.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>database</literal> is the database name of the
+ currently active backend for this process.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>username</literal> is the user name used in the
+ connection of the currently active backend for this
+ process.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>create_time</literal> is the creation time and
+ date of the connection.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>pool_counter</literal> counts the number of times
+ this pool of connections (process) has been used by
+ clients.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Here is an example session:
+ <programlisting>
+ test=# show pool_processes;
+ pool_pid | start_time | database | username | create_time | pool_counter
+ ----------+---------------------+----------+----------+---------------------+--------------
+ 19696 | 2016-10-17 13:24:17 | postgres | t-ishii | 2016-10-17 13:35:12 | 1
+ 19697 | 2016-10-17 13:24:17 | | | |
+ 19698 | 2016-10-17 13:24:17 | | | |
+ 19699 | 2016-10-17 13:24:17 | | | |
+ 19700 | 2016-10-17 13:24:17 | | | |
+ 19701 | 2016-10-17 13:24:17 | | | |
+ 19702 | 2016-10-17 13:24:17 | | | |
+ 19703 | 2016-10-17 13:24:17 | | | |
+ 19704 | 2016-10-17 13:24:17 | | | |
+ 19705 | 2016-10-17 13:24:17 | | | |
+ 19706 | 2016-10-17 13:24:17 | | | |
+ 19707 | 2016-10-17 13:24:17 | | | |
+ 19708 | 2016-10-17 13:24:17 | | | |
+ 19709 | 2016-10-17 13:24:17 | | | |
+ 19710 | 2016-10-17 13:24:17 | | | |
+ 19711 | 2016-10-17 13:24:17 | | | |
+ 19712 | 2016-10-17 13:24:17 | | | |
+ 19713 | 2016-10-17 13:24:17 | | | |
+ 19714 | 2016-10-17 13:24:17 | | | |
+ 19715 | 2016-10-17 13:24:17 | | | |
+ 19716 | 2016-10-17 13:24:17 | | | |
+ 19717 | 2016-10-17 13:24:17 | | | |
+ 19718 | 2016-10-17 13:24:17 | | | |
+ 19719 | 2016-10-17 13:24:17 | | | |
+ 19720 | 2016-10-17 13:24:17 | | | |
+ 20024 | 2016-10-17 13:33:46 | | | |
+ 19722 | 2016-10-17 13:24:17 | test | t-ishii | 2016-10-17 13:34:42 | 1
+ 19723 | 2016-10-17 13:24:17 | | | |
+ 19724 | 2016-10-17 13:24:17 | | | |
+ 19725 | 2016-10-17 13:24:17 | | | |
+ 19726 | 2016-10-17 13:24:17 | | | |
+ 19727 | 2016-10-17 13:24:17 | | | |
+ (32 rows)
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_status.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-STATUS">
+ <indexterm zone="sql-show-pool-status">
+ <primary>SHOW POOL_STATUS</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL STATUS</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL STATUS</refname>
+ <refpurpose>
+ sends back the list of configuration parameters with their name,
+ value, and description
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_STATUS
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_STATUS</command> displays the current value of
+ <productname>Pgpool-II</productname> configuration parameters.
+ </para>
+ <para>
+ This command is similar to the
+ <xref linkend="SQL-PGPOOL-SHOW"> command, but this is the older
+ version of it. It is recommended to
+ use <xref linkend="SQL-PGPOOL-SHOW"> instead.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <simplelist type="inline">
+ <member><xref linkend="SQL-PGPOOL-SHOW"></member>
+ </simplelist>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+ doc/src/sgml/ref/show_pool_version.sgml
+ Pgpool-II documentation
+ -->
+
+<refentry id="SQL-SHOW-POOL-VERSION">
+ <indexterm zone="sql-show-pool-version">
+ <primary>SHOW POOL_VERSION</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>SHOW POOL_VERSION</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>SQL - Language Statements</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>SHOW POOL_VERSION</refname>
+ <refpurpose>
+ displays a string containing
+ the <productname>Pgpool-II</productname> release number.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <synopsis>
+ SHOW POOL_VERSION
+ </synopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>
+ <command>SHOW POOL_VERSION</command> displays a string
+ containing the <productname>Pgpool-II</productname> release
+ number. Here is an example session:
+ <programlisting>
+ test=# show pool_version;
+ pool_version
+ --------------------------
+ 3.6.0 (subaruboshi)
+ (1 row)
+ </programlisting>
+
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/watchdog_setup.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="WATCHDOG-SETUP">
+ <indexterm zone="watchdog-setup">
+ <primary>watchdog_setup</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>watchdog_setup</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>Other Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>watchdog_setup</refname>
+ <refpurpose>
+ Create a temporary installation of Pgpool-II clusters with watchdog</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>watchdog_setup</command>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-WATCHDOG-SETUP-1">
+ <title>
+ Description
+ </title>
+ <para>
+ <application>watchdog_setup</application> creates a temporary
+ installation of <productname>Pgpool-II</productname> clusters with watchdog enabled, which
+ includes a <productname>Pgpool-II</productname> installation and
+ specified number of <productname>PostgreSQL</productname>
+ installations under current directory.
+ Current directory must be empty before running <application>watchdog_setup</application>.
+ </para>
+ <para>
+ <application>watchdog_setup</application> is for testing purpose
+ only and should not be used to create production installations.
+ Also please note that heartbeat is not used.
+ </para>
+
+ <para>
+ <application>watchdog_setup</application>
+ uses <xref linkend="pgpool-setup"> as a workhorse.
+ </para>
+
+ <para>
+ Currently <application>watchdog_setup</application> supports streaming replication mode, native replication mode, logical replication mode and raw mode.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <application>watchdog_setup</application> accepts the following command-line arguments:
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-wn <replaceable class="parameter">num_pgpool</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the number of Pgpool-II installations.
+ If this is omitted, <literal>3</literal> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-wp <replaceable class="parameter">watchdog_base_port</replaceable></option></term>
+ <listitem>
+ <para>
+ Specify the starting base port number used by Pgpool-II and
+ PostgreSQL. For the first Pgpool-II, Pgpool-II port is
+ watchdog_base_port. pcp port is watchdog_base_port + 1, watchdog port is
+ watchdog_base_port + 2. wd_heartbeat_port is
+ watchdog_base_port + 3 (though heartbeat is not used). The
+ first PostgreSQL node's port is watchdog_base_port + 4,
+ second PostgreSQL node's port is watchdog_base_port + 5 and
+ so on.
+ </para>
+ <para>
+ If this is omitted, <literal>50000</literal> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-m <replaceable class="parameter">mode</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the running mode. <replaceable>mode</replaceable>
+ can be <literal>r</literal> (native replication mode), <literal>s</literal> (streaming replication mode), or
+ <literal>n</literal> (raw mode).
+ If this is omitted, <literal>s</literal> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">num_clusters</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the number of PostgreSQL installations.
+ If this is omitted, <literal>2</literal> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--no-stop</option></term>
+ <listitem>
+ <para>
+ Do not stop pgpool and PostgreSQL after the work.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d</option></term>
+ <listitem>
+ <para>
+ Start pgpool with debug mode.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Environment variables</title>
+ <para>
+ <application>watchdog_setup</application> recognizes following environment variables:
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>PGPOOL_SETUP</option></term>
+ <listitem>
+ <para>
+ Specifies the path to pgpool_setup command. The default is
+ "pgpool_setup", thus it is assumed that pgpool_setup is in the
+ command search path.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGPOOL_INSTALL_DIR</option></term>
+ <listitem>
+ <para>
+ Specifies the Pgpool-II installation directory. Pgpool-II
+ binaries is expected to be placed under PGPOOL_INSTALL_DIR/bin
+ and pgpool.conf and pool_hba.conf etc. are expected to be placed under
+ PGPOOL_INSTALL_DIR/etc. The default is /usr/local.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGPOOLDIR</option></term>
+ <listitem>
+ <para>
+ Specifies the path to Pgpool-II configuration files.
+ The default is PGPOOL_INSTALL_DIR/etc.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGBIN</option></term>
+ <listitem>
+ <para>
+ Specifies the path to PostgreSQL commands such as initdb, pg_ctl and psql.
+ The default is /usr/local/pgsql/bin.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGLIB</option></term>
+ <listitem>
+ <para>
+ Specifies the path to PostgreSQL shared libraries.
+ The default is /usr/local/pgsql/lib.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>PGSOCKET_DIR</option></term>
+ <listitem>
+ <para>
+ Specifies the path to Unix socket directory.
+ The default is /tmp.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>INITDBARG</option></term>
+ <listitem>
+ <para>
+ Specifies the arguments for initdb command.
+ The default is "--no-locale -E UTF_8".
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ <screen>
+ $ watchdog_setup
+ Starting set up
+ ============= setting up pgpool 0 =============
+ Starting set up in streaming replication mode
+ creating startall and shutdownall
+ creating failover script
+ creating database cluster /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool0/data0...done.
+ update postgresql.conf
+ creating pgpool_remote_start
+ creating basebackup.sh
+ creating recovery.conf
+ creating database cluster /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool0/data1...done.
+ update postgresql.conf
+ creating pgpool_remote_start
+ creating basebackup.sh
+ creating recovery.conf
+ temporarily start data0 cluster to create extensions
+ temporarily start pgpool-II to create standby nodes
+ INFO: unrecognized configuration parameter "debug_level"
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
+ 0 | /tmp | 51000 | up | 0.500000 | primary | 0 | true | 0
+ 1 | /tmp | 51001 | down | 0.500000 | standby | 0 | false | 0
+ (2 rows)
+
+ recovery node 1...pcp_recovery_node -- Command Successful
+ done.
+ creating follow primary script
+ Pager usage is off.
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
+ 0 | /tmp | 51000 | up | 0.500000 | primary | 0 | false | 0
+ 1 | /tmp | 51001 | up | 0.500000 | standby | 0 | true | 0
+ (2 rows)
+
+ shutdown all
+
+ pgpool-II setting for streaming replication mode is done.
+ To start the whole system, use /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool0/startall.
+ To shutdown the whole system, use /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool0/shutdownall.
+ pcp command user name is "t-ishii", password is "t-ishii".
+ Each PostgreSQL, pgpool-II and pcp port is as follows:
+ #1 port is 51000
+ #2 port is 51001
+ pgpool port is 50000
+ pcp port is 50001
+ The info above is in README.port.
+ ============= setting up pgpool 1 =============
+ Starting set up in streaming replication mode
+ creating startall and shutdownall
+ creating failover script
+ creating database cluster /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool1/data0...done.
+ update postgresql.conf
+ creating pgpool_remote_start
+ creating basebackup.sh
+ creating recovery.conf
+ creating database cluster /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool1/data1...done.
+ update postgresql.conf
+ creating pgpool_remote_start
+ creating basebackup.sh
+ creating recovery.conf
+ temporarily start data0 cluster to create extensions
+ temporarily start pgpool-II to create standby nodes
+ INFO: unrecognized configuration parameter "debug_level"
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
+ 0 | /tmp | 51000 | up | 0.500000 | primary | 0 | true | 0
+ 1 | /tmp | 51001 | down | 0.500000 | standby | 0 | false | 0
+ (2 rows)
+
+ recovery node 1...pcp_recovery_node -- Command Successful
+ done.
+ creating follow primary script
+ Pager usage is off.
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
+ 0 | /tmp | 51000 | up | 0.500000 | primary | 0 | true | 0
+ 1 | /tmp | 51001 | up | 0.500000 | standby | 0 | false | 0
+ (2 rows)
+
+ shutdown all
+
+ pgpool-II setting for streaming replication mode is done.
+ To start the whole system, use /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool1/startall.
+ To shutdown the whole system, use /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool1/shutdownall.
+ pcp command user name is "t-ishii", password is "t-ishii".
+ Each PostgreSQL, pgpool-II and pcp port is as follows:
+ #1 port is 51000
+ #2 port is 51001
+ pgpool port is 50004
+ pcp port is 50005
+ The info above is in README.port.
+ ============= setting up pgpool 2 =============
+ Starting set up in streaming replication mode
+ creating startall and shutdownall
+ creating failover script
+ creating database cluster /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool2/data0...done.
+ update postgresql.conf
+ creating pgpool_remote_start
+ creating basebackup.sh
+ creating recovery.conf
+ creating database cluster /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool2/data1...done.
+ update postgresql.conf
+ creating pgpool_remote_start
+ creating basebackup.sh
+ creating recovery.conf
+ temporarily start data0 cluster to create extensions
+ temporarily start pgpool-II to create standby nodes
+ INFO: unrecognized configuration parameter "debug_level"
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
+ 0 | /tmp | 51000 | up | 0.500000 | primary | 0 | true | 0
+ 1 | /tmp | 51001 | down | 0.500000 | standby | 0 | false | 0
+ (2 rows)
+
+ recovery node 1...pcp_recovery_node -- Command Successful
+ done.
+ creating follow primary script
+ Pager usage is off.
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------
+ 0 | /tmp | 51000 | up | 0.500000 | primary | 0 | true | 0
+ 1 | /tmp | 51001 | up | 0.500000 | standby | 0 | false | 0
+ (2 rows)
+
+ shutdown all
+
+ pgpool-II setting for streaming replication mode is done.
+ To start the whole system, use /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool2/startall.
+ To shutdown the whole system, use /home/t-ishii/work/pgpool-II/current/pgpool2/src/test/a/pgpool2/shutdownall.
+ pcp command user name is "t-ishii", password is "t-ishii".
+ Each PostgreSQL, pgpool-II and pcp port is as follows:
+ #1 port is 51000
+ #2 port is 51001
+ pgpool port is 50008
+ pcp port is 50009
+ The info above is in README.port.
+
+ $ ls
+ pgpool0 pgpool1 pgpool2 shutdownall startall
+
+ $ sh startall
+ waiting for server to start....16123 2016-08-18 16:26:53 JST LOG: redirecting log output to logging collector process
+ 16123 2016-08-18 16:26:53 JST HINT: Future log output will appear in directory "pg_log".
+ done
+ server started
+ waiting for server to start....16136 2016-08-18 16:26:54 JST LOG: redirecting log output to logging collector process
+ 16136 2016-08-18 16:26:54 JST HINT: Future log output will appear in directory "pg_log".
+ done
+ server started
+
+ t-ishii@localhost: psql -p 50000 test
+
+ Pager usage is off.
+ psql (9.5.4)
+ Type "help" for help.
+
+ test=# \q
+
+ $ pcp_watchdog_info -p 50001 -v
+ Password:
+ Watchdog Cluster Information
+ Total Nodes : 3
+ Remote Nodes : 2
+ Quorum state : QUORUM EXIST
+ Alive Remote Nodes : 2
+ VIP up on local node : NO
+ Leader Node Name : Linux_tishii-CF-SX3HE4BP_50004
+ Leader Host Name : localhost
+
+ Watchdog Node Information
+ Node Name : Linux_tishii-CF-SX3HE4BP_50000
+ Host Name : localhost
+ Delegate IP : Not_Set
+ Pgpool port : 50000
+ Watchdog port : 50002
+ Node priority : 1
+ Status : 7
+ Status Name : STANDBY
+
+ Node Name : Linux_tishii-CF-SX3HE4BP_50004
+ Host Name : localhost
+ Delegate IP : Not_Set
+ Pgpool port : 50004
+ Watchdog port : 50006
+ Node priority : 1
+ Status : 4
+ Status Name : LEADER
+
+ Node Name : Linux_tishii-CF-SX3HE4BP_50008
+ Host Name : localhost
+ Delegate IP : Not_Set
+ Pgpool port : 50008
+ Watchdog port : 50010
+ Node priority : 1
+ Status : 7
+ Status Name : STANDBY
+
+ </screen>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!--
+doc/src/sgml/ref/wd_cli.sgml
+Pgpool-II documentation
+-->
+
+<refentry id="WD-CLI">
+ <indexterm zone="wd-cli">
+ <primary>wd_cli</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle>wd_cli</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo>Other Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>wd_cli</refname>
+ <refpurpose>
+ Watchdog Command Line Interface (CLI) utility for the
+ external health-check system integration.
+ </refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>wd_cli</command>
+ <arg rep="repeat"><replaceable>operation</replaceable></arg>
+ <arg rep="repeat"><replaceable>node search option</replaceable></arg>
+ <arg rep="repeat"><replaceable>option</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1 id="R1-WD-CLI-1">
+ <title>Description</title>
+ <para>
+ <command>wd_cli</command>
+ Provides a convenient and easy to use interface to interact with
+ watchdog and perform health check related node operations.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Operations</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-i</option></term>
+ <term><option>--info</option></term>
+ <listitem>
+ <para>
+ Get the node status for node(s) based on node search criteria
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-I <replaceable class="parameter">NEW_STATUS</replaceable></option></term>
+ <term><option>--inform=<replaceable class="parameter">NEW_STATUS</replaceable></option></term>
+ <listitem>
+ <para>
+ Update the watchdog node status.
+ Allowed values are <literal>DEAD</literal> and <literal>ALIVE</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Node Search Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-a </option></term>
+ <term><option>--all</option></term>
+ <listitem>
+ <para>
+ Select all nodes (only available with <literal>--info</literal> operation)
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-n <replaceable class="parameter">WATCHDOG_NODE_ID</replaceable></option></term>
+ <term><option>--node-id=<replaceable class="parameter">WATCHDOG_NODE_ID</replaceable></option></term>
+ <listitem>
+ <para>
+ Select watchdog node by node_id.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-N <replaceable class="parameter">NODE_NAME</replaceable></option></term>
+ <term><option>--node-name=<replaceable class="parameter">NODE_NAME</replaceable></option></term>
+ <listitem>
+ <para>
+ Select watchdog node by name.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-H <replaceable class="parameter">HOSTNAME</replaceable></option></term>
+ <term><option>--node-host=<replaceable class="parameter">HOSTNAME</replaceable></option></term>
+ <listitem>
+ <para>
+ Select watchdog node by hostname.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-P <replaceable class="parameter">PORT_NO</replaceable></option></term>
+ <term><option>--node-port=<replaceable class="parameter">PORT_NO</replaceable></option></term>
+ <listitem>
+ <para>
+ Select watchdog node by port number.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Options</title>
+ <para>
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-k <replaceable class="parameter">KEY</replaceable></option></term>
+ <term><option>--auth-key=<replaceable class="parameter">KEY</replaceable></option></term>
+ <listitem>
+ <para>
+ Watchdog auth key.
+ Specifying auth-key over rides the <literal>pgpool.conf->wd_authkey</literal> value.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-f <replaceable class="parameter">CONFIG_FILE</replaceable></option></term>
+ <term><option>--config-file=<replaceable class="parameter">CONFIG_FILE</replaceable></option></term>
+ <listitem>
+ <para>
+ Specifies the <literal>pgpool.conf</literal> file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-s <replaceable class="parameter">SOCKET_DIR</replaceable></option></term>
+ <term><option>--socket-dir=<replaceable class="parameter">SOCKET_DIR</replaceable></option></term>
+ <listitem>
+ <para>
+ Path to the watchdog IPC socket directory.
+ Specifying socket-dir over rides the <literal>pgpool.conf->wd_ipc_socket_dir</literal> value.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p <replaceable class="parameter">PORT_NO</replaceable></option></term>
+ <term><option>--ipc-port=<replaceable class="parameter">PORT_NO</replaceable></option></term>
+ <listitem>
+ <para>
+ Port number of watchdog IPC socket.
+ Specifying ipc-port over rides the <literal>pgpool.conf->wd_port</literal> value.
+ </para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><option>-m <replaceable class="parameter">message_string</replaceable></option></term>
+ <term><option>--message=<replaceable class="parameter">message_string</replaceable></option></term>
+ <listitem>
+ <para>
+ Optional message string to be passed to <productname>Pgpool-II</productname> along with the node status.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-v</option></term>
+ <term><option>--verbose</option></term>
+ <listitem>
+ <para>
+ Enable verbose messages.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-V</option></term>
+ <term><option>--version</option></term>
+ <listitem>
+ <para>
+ Prints version information.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d</option></term>
+ <term><option>--debug</option></term>
+ <listitem>
+ <para>
+ Enable debug output.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-h</option></term>
+ <term><option>--help</option></term>
+ <listitem>
+ <para>
+ Prints the help for <literal>wd_cli</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Example</title>
+ <para>
+ When some external health-check system is configured
+ to monitor the health of <productname>Pgpool-II</productname> cluster
+ and it detects a node failure. <literal>wd_cli</literal> utility can
+ be used to pass this information to <productname>Pgpool-II</productname>
+ cluster so that it can take the appropriate actions.
+
+ <programlisting>
+ #inform Pgpool-II about node named RN-110 failure
+ wd_cli --inform DEAD -N 'RN-110' -p 9001 -m 'Pgpool node with name RN-110 is not reachable'
+ </programlisting>
+ <programlisting>
+ #inform Pgpool-II about node-id 10 failure
+ wd_cli --inform DEAD -n 10 -m 'Pgpool node with ID 10 is not responding'
+ </programlisting>
+ Similarly to inform Pgpool-II about the node is alive again.
+ <programlisting>
+ #inform Pgpool-II about node-id 10 re-joining
+ wd_cli --inform ALIVE -n 10 -m 'Pgpool node with ID 10 is reachable again'
+ </programlisting>
+
+ wd_cli can also be used to get the current status of cluster nodes.
+ <programlisting>
+ wd_cli -f simple_conf/watchdog/pgpool_wd1.conf --info -v --all
+
+ Total Watchdog nodes configured for lifecheck: 2
+ *****************
+ Node ID: 0
+ Node Status code 4
+ Node Status: LEADER
+ Node Name: localhost:9991 Linux localhost.localdomain
+ Node Host: localhost
+ Node WD Port: 9001
+ Node Pgpool Port: 9991
+
+ Node ID: 1
+ Node Status code 7
+ Node Status: STANDBY
+ Node Name: localhost:9992 Linux localhost.localdomain
+ Node Host: localhost
+ Node WD Port: 9002
+ Node Pgpool Port: 9992
+ </programlisting>
+ </para>
+ </refsect1>
+
+</refentry>
--- /dev/null
+<!-- doc/src/sgml/reference.sgml -->
+
+<part id="reference">
+ <title>Reference</title>
+
+ <partintro>
+ <para>
+ This part contains reference information for the <productname>Pgpool-II</productname>.
+ </para>
+
+ <para>
+ The reference entries are also available as traditional
+ <quote>man</quote> pages.
+ </para>
+ </partintro>
+
+ <reference id="server-commands">
+ <title>Server commands</title>
+
+ <partintro>
+ <para>
+ This part contains reference information for server
+ commands. Currently only <command>pgpool</command> falls into
+ this category.
+ </para>
+ </partintro>
+ &pgpool;
+ </reference>
+
+ <reference id="pcp-commands">
+ <title>PCP commands</title>
+
+ <partintro>
+ <para>
+ This part contains reference information for PCP commands.
+ PCP commands are UNIX commands which manipulate pgpool-II via
+ the network. Please note that the parameter format for all
+ PCP commands has been changed since <productname>Pgpool-II
+ 3.5</productname>.
+ </para>
+
+ <sect1 id="pcp-connection-authentication">
+ <title>PCP connection authentication</title>
+ <para>
+ PCP user names and passwords must be declared in
+ <filename>pcp.conf</filename>
+ in <filename>$prefix/etc</filename> directory
+ (see <xref linkend="configuring-pcp-conf"> to know to create
+ the file). <option>-F</option> option can be used when
+ starting
+ <productname>Pgpool-II</productname>
+ if <filename>pcp.conf</filename> is placed somewhere else.
+ </para>
+ </sect1>
+
+ <sect1 id="pcp-password-file">
+ <title>PCP password file</title>
+ <para>
+ The file <filename>.pcppass</filename> in a user's home
+ directory or the file referenced by environment variable
+ PCPPASSFILE can contain passwords to be used if no password has
+ been specified for the pcp connection.
+ </para>
+ <para>
+ This file should contain lines of the following format:
+
+ <programlisting>
+ hostname:port:username:password
+ </programlisting>
+ </para>
+
+ <para>
+ (You can add a reminder comment to the file by copying the line
+ above and preceding it with #.) Each of the first three fields
+ can be a literal value, or *, which matches anything. The password
+ field from the first line that matches the current connection
+ parameters will be used. (Therefore, put more-specific entries
+ first when you are using wildcards.) If an entry needs to contain
+ : or \, escape this character with \. A host name of localhost
+ matches both TCP (host name localhost) and Unix domain socket
+ connections coming from the local machine.
+ </para>
+
+ <para>
+ The permissions on .pcppass must disallow any access to world or
+ group; achieve this by the command chmod 0600 ~/.pcppass. If the
+ permissions are less strict than this, the file will be
+ ignored.
+ </para>
+
+ </sect1>
+
+ </partintro>
+
+ &pcpCommonOptions;
+ &pcpNodeCount;
+ &pcpNodeInfo;
+ &pcpHealthCheckStats;
+ &pcpWatchdogInfo;
+ &pcpProcCount;
+ &pcpProcInfo;
+ &pcpPoolStatus;
+ &pcpDetachNode;
+ &pcpAttachNode;
+ &pcpPromoteNode;
+ &pcpStopPgpool;
+ &pcpReloadConfig;
+ &pcpRecoveryNode;
+
+ </reference>
+
+ <reference id="other-commands">
+ <title>Other commands</title>
+
+ <partintro>
+ <para>
+ This part contains reference information for various Pgpool-II commands.
+ </para>
+
+ </partintro>
+
+ &pgMd5;
+ &pgEnc;
+ &pgproto;
+ &pgpoolSetup;
+ &watchdogSetup;
+ &wdCli;
+
+ </reference>
+
+ <reference id="sql-commands">
+ <title>SQL type commands</title>
+
+ <partintro>
+ <para>
+ This part contains reference information for various SQL type
+ <productname>Pgpool-II</productname> commands. These commands
+ can be issued inside the SQL session using the
+ standard <productname>PostgreSQL</productname> client
+ like <literal>psql</literal>. They are not forwarded to the
+ backend DB: instead they are processed
+ by <productname>Pgpool-II</productname> server. Please note
+ that SQL type commands cannot be used in extended query
+ mode. You will get parse errors
+ from <productname>PostgreSQL</productname>.
+ </para>
+
+ </partintro>
+
+ &pgpoolShow
+ &pgpoolSet
+ &pgpoolReset
+ &showPoolStatus
+ &showPoolNodes
+ &showPoolProcesses
+ &showPoolPools
+ &showPoolVersion
+ &showPoolCache
+ &showPoolHealthCheckStats
+ &showPoolBackendStats
+ </reference>
+
+ <reference id="pgpool-adm">
+ <title>pgpool_adm extension</title>
+
+ <partintro>
+ <para>
+ <command>pgpool_adm</command> is a set of extensions to allow
+ SQL access to <xref linkend="pcp-commands"> (actually, pcp
+ libraries). It uses foreign data wrapper as shown in the
+ diagram below.
+ </para>
+ <para>
+ <figure>
+ <title>How <command>pgpool_adm</command> works</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="pgpool_adm.gif">
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </para>
+
+ <para>
+ It is possible to call the functions from either via pgpool-II
+ (1) or via <productname>PostgreSQL</productname> (2). In case
+ (1), <productname>Pgpool-II</productname> accepts query from
+ user (1), then forward
+ to <productname>PostgreSQL</productname> (3).
+ <productname>PostgreSQL</productname> connects
+ to <productname>Pgpool-II</productname> (5)
+ and <productname>Pgpool-II</productname> reply back
+ to <productname>PostgreSQL</productname> with the result
+ (3). <productname>PostgreSQL</productname> returns the result
+ to <productname>Pgpool-II</productname> (5)
+ and <productname>Pgpool-II</productname> forwards the data to
+ the user (6).
+ </para>
+ <para>
+ In case (2), <productname>PostgreSQL</productname> accepts query from user (2).
+ <productname>PostgreSQL</productname> connects
+ to <productname>Pgpool-II</productname> (5)
+ and <productname>Pgpool-II</productname> reply back
+ to <productname>PostgreSQL</productname> with the result (3).
+ <productname>PostgreSQL</productname> replies back the data to
+ the user (4).
+ </para>
+ <para>
+ There are two forms to call pgpool_adm functions: first form
+ accepts <productname>Pgpool-II</productname> host name (or IP
+ address), pcp port number, pcp user name, its password and
+ another parameters.
+ </para>
+ <para>
+ In the second form, <productname>Pgpool-II</productname>
+ server name is required. The server name must be already
+ defined using "CREATE FOREIGN SERVER" command
+ of <productname>PostgreSQL</productname>. The pcp port number
+ is hard coded as 9898, the pcp user name is assumes to be same
+ as caller's <productname>PostgreSQL</productname> user name.
+ password is extracted from $HOME/.pcppass.
+ </para>
+
+ <sect1 id="installing-pgpool-adm">
+ <title>Installing pgpool_adm</title>
+ <para>
+ pgpool_adm is an extension and should be installed on all
+ PostgreSQL servers.
+ <programlisting>
+ $ cd src/sql/pgpool_adm
+ $ make
+ $ make install
+ </programlisting>
+ Then issue following SQL command for every database you want to access.
+ <programlisting>
+ $ psql ...
+ $ CREATE EXTENSION pgpool_adm
+ </programlisting>
+ </para>
+ </sect1>
+
+ </partintro>
+
+ &pgpoolAdmPcpNodeInfo
+ &pgpoolAdmPcpHealthCheckStats
+ &pgpoolAdmPcpPoolStatus
+ &pgpoolAdmPcpNodeCount
+ &pgpoolAdmPcpAttachNode
+ &pgpoolAdmPcpDetachNode
+
+ </reference>
+
+</part>
--- /dev/null
+<!-- doc/src/sgml/release-3.1.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id="release-3-1-21">
+ <title>Release 3.1.21</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-12-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-10-27 [f37c592]
+ -->
+ <para>
+ Do not cancel a query when the query resulted in an error other than in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ It was intended to keep the consistency, but there's no point in other
+ than native replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-09 [8231f65]
+ -->
+ <para>
+ Do not use random() while generating MD5 salt. (Tatsuo Ishii)
+ </para>
+ <para>
+ random() should not be used in security related applications. To
+ replace random(), import PostmasterRandom() from PostgreSQL. Also
+ store current time at the start up of Pgpool-II main process for later
+ use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-06 [891ce0f]
+ -->
+ <para>
+ Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/release-3.2.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id="release-3-2-22">
+ <title>Release 3.2.22</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-09-05</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-08-24 [cb4d863]
+ -->
+ <para>
+ Doc: Fix documentation about load-balancing. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-15 [2cd5bd3]
+ -->
+ <para>
+ Fix ancient bug of <function>pool_unread()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ When <function>realloc()</function> is called in <function>pool_unread()</function>, it did not update the
+ buffer size. This could cause variety of memory corruption and
+ unexpected data reading from backend. The reason why we did not found
+ that is, probably recently <productname>Pgpool-II</productname> starts extensively to use
+ <function>pool_unread()</function>.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [3f9806b]
+ -->
+ <para>
+ Fix for when failover is triggered by worker process, it is possible that wrong DB node could failover. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=303">bug 303</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ This is due to the db_node_id member in the <varname>POLL_CONNECTION</varname> structure is not initialized in the process (in child process the member is properly initialized). To solve the problem, add new function <function>pool_set_db_node_id()</function> to set the structure member variable and call it inside <function>make_persistent_db_connection()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-31 [ea6ea69]
+ -->
+ <para>
+ Fix starting unnecessary transaction when <command>SET</command> command is issued. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [576312c]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-July/005679.html">[pgpool-general: 5621]</ulink> <function>Failover()</function> function should be executed with health check alarm disabled. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-2-21">
+ <title>Release 3.2.21</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-07-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-06-24 [242e87a]
+ -->
+ <para>
+ Fixing <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002390.html">[pgpool-hackers: 2390]</ulink>Problems with the relative paths in daemon mode (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-19 [11b0808]
+ -->
+ <para>
+ Adjust function name change in <productname>PostgreSQL</productname> 10 dev head. (Tatsuo Ishii)
+ </para>
+ <programlisting>
+ pg_current_wal_location -> pg_current_wal_lsn
+ pg_last_wal_replay_location -> pg_last_wal_replay_lsn
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [69f486f]
+ -->
+ <para>
+ Fix query cache hang when used by node.js. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-May/005569.html">[pgpool-general: 5511]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-29 [487bf5e]
+ -->
+ <para>
+ Deal with <productname>PostgreSQL</productname> 10 in streaming replication delay checking. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-27 [378f61d]
+ -->
+ <para>
+ Fix query cache memory leak. (Tatsuo Ishii)
+ </para>
+ <para>
+ Clearing cache buffers in case of no oid queries (like <command>BEGIN</command>,
+ <command>CHECKPOINT</command>, <command>VACUUM</command>, etc) should have been done, but it did not.
+ Fix query cache memory leak. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-2-20">
+ <title>Release 3.2.20</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-04-28</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-04-12 [0185d33]
+ -->
+ <para>
+
+ Fix for 0000299: Errors on the reloading of configuration.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=299">(Bug 299)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-2-19">
+ <title>Release 3.2.19</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-03-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-03-09 [1ddb7f1]
+ -->
+ <para>
+ Fix <link linkend="PCP-PROMOTE-NODE">pcp_promote_node</link> bug that fails promoting node 0. (Yugo Nagata)
+ </para>
+ <para>
+ The master node could not be promoted by pcp_promote_node with
+ the following error;
+ </para>
+
+ <programlisting>
+ FATAL: invalid pgpool mode for process recovery request
+ DETAIL: specified node is already primary node, can't promote node id 0
+ </programlisting>
+
+ <para>
+ In streaming replication mode, there is a case that Pgpool-II
+ regards the status of primary node as "standby" for some reasons,
+ for example, when pg_ctl promote is executed manually during
+ Pgpool-II is running, in which case, it seems to Pgpool-II
+ that the primary node doesn't exist.
+ </para>
+
+ <para>
+ This status mismatch should be fixed by pcp_promote_node, but when the node
+ is the master node (the first alive node), it fails as mentioned above.
+ </para>
+
+ <para>
+ The reason is as following. before changing the status, pcp_promote_node
+ checks if the specified node is already primary or not by comparing the
+ node id with PRIMARY_NODE_ID. However, if the primary doesn't exist from
+ Pgpool-II's view, PRIMARY_NODE_ID is set to 0, which is same as MASTER_NODE_ID.
+ Hence, when the master node is specified to be promoted, pcp_promote_node
+ is confused that this node is already primary and doesn't have to be
+ promoted, and it exits with the error.
+ </para>
+
+ <para>
+ To fix this, pcp_promote_node should check the node id by using
+ REAL_PRIMARY_NODE_ID, which is set -1 when the primary doesn't exist,
+ rather than PRIMARY_NODE_ID.
+
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <!--
+ 2017-02-28 [5b4f78c]
+ -->
+ <para>
+ Add the latest release note link to README file.(Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [7ed400b]
+ -->
+ <para>
+ Fix to release shared memory segments when <productname>Pgpool-II</productname>exits.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=272">bug 272</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-11 [29b61eb]
+ -->
+ <para>
+ Remove pool_log/pool_error calls from signal handlers. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-December/001950.html">[pgpool-hackers: 1950]</ulink> for details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [8598d5a]
+ -->
+ <para>
+ Fix for 0000249: watchdog sometimes fails de-escalation.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=249">bug 249</ulink>) (Muhammad Usama)
+ </para>
+
+ <para>
+ The solution is to use the <function>waitpid()</function> system call without WNOHANG option.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [bd92a11]
+ -->
+ <para>
+ Fix connection_life_time broken by authentication_timeout. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-28 [afebadf]
+ -->
+ <para>
+ Fix authentication timeout that can occur right after client connections. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+<sect1 id="release-3-2-18">
+ <title>Release 3.2.18</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-12-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-12-20 [888ac16]
+ -->
+ <para>
+ Fix occasional segfault when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ <para>
+ Per bug 263.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-27 [f37c592]
+ -->
+ <para>
+ Do not cancel a query when the query resulted in an error other than in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ It was intended to keep the consistency, but there's no point in other
+ than native replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-09 [8231f65]
+ -->
+ <para>
+ Do not use <function>random()</function> while generating MD5 salt. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>random()</function> should not be used in security related applications. To
+ replace <function>random()</function>, import <function>PostmasterRandom()</function> from PostgreSQL. Also
+ store current time at the start up of <productname>Pgpool-II</productname> main process for later
+ use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-06 [891ce0f]
+ -->
+ <para>
+ Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
--- /dev/null
+<!-- doc/src/sgml/release-3.3.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id="release-3-3-22">
+ <title>Release 3.3.22</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-07-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-07-04 [8fe9a65]
+ -->
+ <para>
+ Fix "write on backend 0 failed with error :"Success"" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=403">bug 403</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Don't treated it as an error if <function>write()</function> returns 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [7111ebb]
+ -->
+ <para>
+ Fix segfault in <function>per_node_error_log()</function> on armhf architecture. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Christian Ehrhardt.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-21">
+ <title>Release 3.3.21</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-04-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-04-08 [424acce]
+ -->
+ <para>
+ Make calls to to_regclass fully schema qualified. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-20">
+ <title>Release 3.3.20</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-02-13</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-01-19 [0bca7cf]
+ -->
+ <para>
+ Change systemd service file to use <varname>STOP_OPTS=" -m fast"</>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [9dab4b2]
+ -->
+ <para>
+ Change <command>pgpool_setup</> to add restore_command in <filename>recovery.conf</>. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-01-18 [21451f9]
+ -->
+ <para>
+ Fix queries hanging in <function>parse_before_bind</> with extended protocol and replication + load-balancing. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=377">bug 377</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-19">
+ <title>Release 3.3.19</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-01-09</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-12-21 [b5f7c63]
+ -->
+ <para>
+ Change the <filename>pgpool.service</filename> and sysconfig files to output <productname>Pgpool-II</productname> log. (Bo Peng)
+ </para>
+ <para>
+ Removing "Type=forking" and add OPTS=" -n" to
+ run <productname>Pgpool-II</productname> with non-daemon mode, because we need to redirect logs.
+ Using <command>"journalctl"</command> command to see <productname>Pgpool-II</productname> systemd log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-18 [63fdde2]
+ 2017-12-17 [91723e7]
+ -->
+ <para>
+ Fix timestamp data inconsistency by replication mode. (Bo Peng)
+ </para>
+ <para>
+ From <productname>PostgreSQL</productname>10 the column
+ default value such as 'CURRENT_DATE' changes,
+ <productname>Pgpool-II</productname> didn't rewrite
+ timestamp by the added default values. This caused data inconsistency.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-10 [3f1d420]
+ -->
+ <para>
+ Fix returning transaction state when "ready for query" message received. (Tatsuo Ishii)
+ </para>
+ <para>
+ We return primary or master node state of ready for query message to
+ frontend. In most cases this is good. However if other than primary
+ node or master node returns an error state (this could happen if load
+ balance node is other than primary or master node and the query is an
+ erroneous SELECT), this should be returned to frontend, because the
+ frontend already received an error.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-18">
+ <title>Release 3.3.18</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-11-01</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-10-31 [48ab79c]
+ -->
+ <para>
+ Add different pgpool.sysconfig file for RHEL6 and RHEL7. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=343">bug 343</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In RHEL6, the "-n" option is needed to redirect log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [b0da893]
+ -->
+ <para>
+ Fix bug mistakenly overriding global backend status right after failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-September/005786.html">[pgpool-general: 5728]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-11 [ca278d0]
+ -->
+ <para>
+ Deal with OpenSSL 1.1. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-17">
+ <title>Release 3.3.17</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-09-05</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-08-24 [119b38a]
+ -->
+ <para>
+ Doc: Fix documentation about load-balancing. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-15 [c84ce4e]
+ -->
+ <para>
+ Fix ancient bug of <function>pool_unread()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ When <function>realloc()</function> is called in <function>pool_unread()</function>, it did not update the
+ buffer size. This could cause variety of memory corruption and
+ unexpected data reading from backend. The reason why we did not found
+ that is, probably recently <productname>Pgpool-II</productname> starts extensively to use
+ <function>pool_unread()</function>.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [8ba5091]
+ -->
+ <para>
+ Test: Fix Java program in 005.regression test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [626ef81]
+ -->
+ <para>
+ Fix for when failover is triggered by worker process, it is possible that wrong DB node could failover. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=303">bug 303</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ This is due to the db_node_id member in the <varname>POLL_CONNECTION</varname> structure is not initialized in the process (in child process the member is properly initialized). To solve the problem, add new function <function>pool_set_db_node_id()</function> to set the structure member variable and call it inside <function>make_persistent_db_connection()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-31 [e77c206]
+ -->
+ <para>
+ Fix starting unnecessary transaction when <command>SET</command> command is issued. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [45e4df4]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-July/005679.html">[pgpool-general: 5621]</ulink> <function>Failover()</function> function should be executed with health check alarm disabled. (Muhammad Usama)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-16">
+ <title>Release 3.3.16</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-07-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-06-24 [1f9e532]
+ -->
+ <para>
+ Fixing <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002390.html">[pgpool-hackers: 2390]</ulink>Problems with the relative paths in daemon mode (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-19 [7b52511]
+ -->
+ <para>
+ Adjust function name change in <productname>PostgreSQL</productname> 10 dev head. (Tatsuo Ishii)
+ </para>
+ <programlisting>
+ pg_current_wal_location -> pg_current_wal_lsn
+ pg_last_wal_replay_location -> pg_last_wal_replay_lsn
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [906f9af]
+ -->
+ <para>
+ Fix query cache hang when used by node.js. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-May/005569.html">[pgpool-general: 5511]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-29 [d740659]
+ -->
+ <para>
+ Deal with <productname>PostgreSQL</productname> 10 in streaming replication delay checking. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-27 [466dc92]
+ -->
+ <para>
+ Fix query cache memory leak. (Tatsuo Ishii)
+ </para>
+ <para>
+ Clearing cache buffers in case of no oid queries (like <command>BEGIN</command>,
+ <command>CHECKPOINT</command>, <command>VACUUM</command>, etc) should have been done, but it did not.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-3-15">
+ <title>Release 3.3.15</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-04-28</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-04-12 [7575feb]
+ -->
+ <para>
+
+ Fix for 0000299: Errors on the reloading of configuration.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=299">(Bug 299)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-04 [ba0a596]
+ -->
+ <para>
+ Fix coverity warnings. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-24 [dab2ff0]
+ -->
+ <para>
+ Fix for 0000296: Pgpool v3.6.2 terminated by systemd because the service Type has been set to 'forking'.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=296">(Bug 296)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-3-14">
+ <title>Release 3.3.14</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-03-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-03-17 [ba1bcc3]
+ -->
+ <para>
+ Add "Wants=network.target" to pgpool.service file.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=294">bug 294</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-09 [1ddb7f1]
+ -->
+ <para>
+ Fix <link linkend="PCP-PROMOTE-NODE">pcp_promote_node</link> bug that fails promoting node 0. (Yugo Nagata)
+ </para>
+ <para>
+ The master node could not be promoted by pcp_promote_node with
+ the following error;
+ </para>
+
+ <programlisting>
+ FATAL: invalid pgpool mode for process recovery request
+ DETAIL: specified node is already primary node, can't promote node id 0
+ </programlisting>
+
+ <para>
+ In streaming replication mode, there is a case that Pgpool-II
+ regards the status of primary node as "standby" for some reasons,
+ for example, when pg_ctl promote is executed manually during
+ Pgpool-II is running, in which case, it seems to Pgpool-II
+ that the primary node doesn't exist.
+ </para>
+
+ <para>
+ This status mismatch should be fixed by pcp_promote_node, but when the node
+ is the master node (the first alive node), it fails as mentioned above.
+ </para>
+
+ <para>
+ The reason is as following. before changing the status, pcp_promote_node
+ checks if the specified node is already primary or not by comparing the
+ node id with PRIMARY_NODE_ID. However, if the primary doesn't exist from
+ Pgpool-II's view, PRIMARY_NODE_ID is set to 0, which is same as MASTER_NODE_ID.
+ Hence, when the master node is specified to be promoted, pcp_promote_node
+ is confused that this node is already primary and doesn't have to be
+ promoted, and it exits with the error.
+ </para>
+
+ <para>
+ To fix this, pcp_promote_node should check the node id by using
+ REAL_PRIMARY_NODE_ID, which is set -1 when the primary doesn't exist,
+ rather than PRIMARY_NODE_ID.
+
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <!--
+ 2017-02-28 [5b4f78c]
+ -->
+ <para>
+ Add the latest release note link to README file.(Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [7ed400b]
+ -->
+ <para>
+ Fix to release shared memory segments when <productname>Pgpool-II</productname>exits.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=272">bug 272</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-14 [c1cd41c]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-February/005373.html">[pgpool-general: 5315]</ulink> pg_terminate_backend (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-06 [8fa731a]
+ -->
+ <para>
+ Adding the missing ExecStop and ExecReload commands to the systemd service configuration file. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [7512482]
+ -->
+ <para>
+ Fixing stack smashing detected. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=280">bug 280</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ It was a buffer overflow in <function>wd_get_cmd</function> function
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-11 [29b61eb]
+ -->
+ <para>
+ Remove pool_log/pool_error calls from signal handlers. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-December/001950.html">[pgpool-hackers: 1950]</ulink> for details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [8598d5a]
+ -->
+ <para>
+ Fix for 0000249: watchdog sometimes fails de-escalation. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=249">bug 249</ulink>) (Muhammad Usama)
+ </para>
+
+ <para>
+ The solution is to use the <function>waitpid()</function> system call without WNOHANG option.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [bd92a11]
+ -->
+ <para>
+ Fix connection_life_time broken by authentication_timeout. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-28 [afebadf]
+ -->
+ <para>
+ Fix authentication timeout that can occur right after client connections. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+<sect1 id="release-3-3-13">
+ <title>Release 3.3.13</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-12-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-12-23 [a7e222d]
+ -->
+ <para>
+ Tightening up the watchdog security. (Muhammad Usama)
+ </para>
+
+ <para>
+ Now wd_authkey uses the HMAC SHA-256 hashing.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-22 [1b293c4]
+ -->
+ <para>
+ Add pgpool_adm extension in <productname>Pgpool-II</productname> RPM. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-20 [888ac16]
+ -->
+ <para>
+ Fix occasional segfault when query cache is enabled. (bug 263) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-27 [f37c592]
+ -->
+ <para>
+ Do not cancel a query when the query resulted in an error other than in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ It was intended to keep the consistency, but there's no point in other
+ than native replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-24 [8aa7586]
+ -->
+ <para>
+ Change the default value of search_primary_node_timeout from 10 to 300. (Tatsuo Ishii)
+ </para>
+ <para>
+ Prior default value 10 seconds is sometimes too short for a standby to
+ be promoted.
+ </para>
+ <para>
+ Per [pgpool-general: 5026].
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-21 [b306e04]
+ -->
+ <para>
+ Fix the case when all backends are down then 1 node attached. (bug 248) (Tatsuo Ishii)
+ </para>
+ <para>
+ When all backends are down, no connection is accepted. Then 1
+ PostgreSQL becomes up, and attach the node using pcp_attach_node. It
+ successfully finishes. However, when a new connection arrives, still
+ the connection is refused because pgpool child process looks into the
+ cached status, in which the recovered node is still in down status if
+ mode is streaming replication mode (native replication and other modes
+ are fine). Solution is, if all nodes are down, force to restart all
+ pgpool child.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-09 [8231f65]
+ -->
+ <para>
+ Do not use random() while generating MD5 salt. (Tatsuo Ishii)
+ </para>
+ <para>
+ random() should not be used in security related applications. To
+ replace random(), import PostmasterRandom() from PostgreSQL. Also
+ store current time at the start up of Pgpool-II main process for later
+ use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-06 [891ce0f]
+ -->
+ <para>
+ Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
--- /dev/null
+<!-- doc/src/sgml/release-3.4.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id=release-3-4-26>
+ <title>Release 3.4.26</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-10-25 [45a3469]
+ -->
+ <para>
+ Fix incorrect query rewrite in replication mode. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-10 [4b726df]
+ -->
+ <para>
+ Fix assorted ancient v2 protocol bugs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-08 [45ac39b]
+ -->
+ <para>
+ Fix problem that <xref linkend="guc-syslog-facility"> doesn't change by reload.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=548">bug 548</ulink>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-03 [fed3d6b]
+ -->
+ <para>
+ Fix Pgpool-II shutdown failed in certain case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-15 [a333a45]
+ -->
+ <para>
+ Fix segfault when executing an erroneous query after DEALLOCATE a named statement.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=546">bug 546</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-4-25>
+ <title>Release 3.4.25</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-08-15</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-08-08 [94b0ce1]
+ -->
+ <para>
+ Import some of memory manager debug facilities from <productname>PostgreSQL</productname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-07-24 [d3493f7]
+ -->
+ <para>
+ Use <function>pg_get_expr()</function> instead of <literal>pg_attrdef.adsrc</literal> to support for <productname>PostgreSQL</productname> 12. (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-08-11 [c553e51]
+ 2019-08-08 [94364ad]
+ 2019-07-17 [5730d28]
+ 2019-07-02 [b364caa]
+ -->
+ <para>
+ Enhance shutdown script of <xref linkend="PGPOOL-SETUP">. (Tatsuo Ishii)
+ <itemizedlist>
+ <listitem>
+ <para>
+ Make shutdownall to wait for completion of shutdown of <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If environment variable <varname>CHECK_TIME_WAIT</varname> is set to true, use <command>netstat</command> command to confirm usage of the <literal>TCP/IP</literal> port while executing shutdown script.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-05-22 [57cd1d4]
+ -->
+ <para>
+ Deal <literal>pgpool_adm</literal> extension with <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-07-28 [fbe8fdc]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to produce correct follow master command. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [44f8e2d]
+ -->
+ <para>
+ Fix query cache module so that it checks oid array's bound. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [ae45e93]
+ -->
+ <para>
+ Fix off-by-one error in query cache module. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-24 [057a635]
+ -->
+ <para>
+ Fix segfault when <literal>samenet</literal> is specified in <filename>pool_hba.conf</filename>. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006659.html">[pgpool-general: 6601]</ulink>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-07 [9d7c5ba]
+ -->
+ <para>
+ Fix to deal with backslashes according to the config of <varname>standard_conforming_strings</varname> in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=467">bug 467</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-14 [0d6fdbc]
+ 2019-05-23 [0e8c1c2]
+ 2019-05-22 [c264275]
+ 2019-05-22 [53e7af0]
+ 2019-05-22 [19cfda2]
+ -->
+ <para>
+ Fix memory leaks. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-4-24>
+ <title>Release 3.4.24</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-05-16</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-03 [afbcff2]
+ -->
+ <para>
+ Speed up failover when all of backends are down. (Tatsuo Ishii)
+ </para>
+ <para>
+ If all of the backend are in down status, immediately give up finding
+ primary node regardless search_primary_node_timeout and promptly
+ finish the failover process.
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-May/003321.html">[pgpool-hackers: 3321]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-30 [87e531e]
+ 2019-04-30 [3cad617]
+ -->
+ <para>
+ pgpool-recovery extension and <command>pgpool_setup</> is now ready for the next major release <productname>PostgreSQL</> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-09 [2b2f525]
+ -->
+ <para>
+ Fix the wrong error message "ERROR: connection cache is full", when all backend nodes are down.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=487">bug 487</>) (Bo Peng)
+ </para>
+ <para>
+ When all backend nodes are down, <productname>Pgpool-II</> throws an incorrect
+ error message "ERROR: connection cache is full". Change the error
+ message to "all backend nodes are down, pgpool requires at least one valid node".
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-21 [b58aef8]
+ -->
+ <para>
+ Avoid exit/fork storm of pool_worker_child process. (Tatsuo Ishii)
+ </para>
+ <para>
+ pool_worker_child issues query to get WAL position using <function>do_query()</>,
+ which could throws FATAL error. In this case pool_worker_child process
+ exits and <productname>Pgpool-II</> parent immediately forks new process. This cycle
+ indefinitely repeats and gives high load to the system.
+ To avoid the exit/fork storm, sleep <varname>sr_check_period</>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-18 [233673c]
+ -->
+ <para>
+ Fix <xref linkend="GUC-write-function-list">'s broken default value. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-17 [90b5f44]
+ -->
+ <para>
+ Fix "not enough space in buffer" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=499">bug 499</>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The error occurred while processing error message returned from
+ backend and the cause is that the query string in question is too
+ big. Problem is, the buffer is in fixed size (8192 bytes).
+ Eliminate the fixed size buffer and use palloced buffer
+ instead. This also saves some memory copy work.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-16 [586b012]
+ -->
+ <para>
+ Fix DROP DATABASE failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-10 [2f849b6]
+ -->
+ <para>
+ Fix wrong variable in <function>read_status_file()</> function.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=493">bug 493</>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-30 [5441f49]
+ -->
+ <para>
+ Fix compiler warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-4-23>
+ <title>Release 3.4.23</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-03-29</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-27 [b950824]
+ -->
+ <para>
+ Add new configuration option <xref linkend="guc-ssl-prefer-server-ciphers">. (Muhammad Usama)
+ </para>
+ <para>
+ Add the new setting <xref linkend="guc-ssl-prefer-server-ciphers"> to let users configure if they
+ want client's or server's cipher order to take preference.
+ </para>
+ <para>
+ The default for this parameter is off, which prioritize the client's
+ cipher order as usual. However this is just for keeping backward
+ compatibility, and it is possible that a malicious client uses weak
+ ciphers. For this reason we recommend to set this parameter to on at
+ all times.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-23 [3f8d1f0]
+ -->
+ <para>
+ Allow to set a client cipher list. (Tatsuo Ishii)
+ </para>
+ <para>
+ For this purpose new parameter <xref linkend="guc-ssl-ciphers">, which specifies the cipher
+ list to be accepted by <productname>Pgpool-II</>, is added.
+ This is already implemented in <productname>PostgreSQL</> and useful to enhance security when SSL is enabled.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-18 [b92e048]
+ -->
+ <para>
+ Fix unnecessary <function>fsync()</> to <filename>pgpool_status</> file. (Tatsuo Ishii)
+ </para>
+ <para>
+ Whenever new connections are created to PostgreSQL backend, <function>fsync()</>
+ was issued to <filename>pgpool_status</> file, which could generate excessive I/O
+ in certain conditions.
+ So reduce the chance of issuing <function>fsync()</> so that it is issued only when
+ backend status is changed.
+ </para>
+ <para>
+ Discussion: <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-February/006494.html">[pgpool-general: 6436]</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-4-22>
+ <title>Release 3.4.22</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-02-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-02-15 [fee0584]
+ -->
+ <para>
+ Doc: Fix configuration change timing regarding <xref linkend="GUC-MEMORY-CACHE-ENABLED">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-12 [8bf96bf]
+ -->
+ <para>
+ Fix online recovery failed due to <xref linkend="GUC-CLIENT-IDLE-LIMIT-IN-RECOVERY"> in certain cases.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=431">bug 431</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-29 [8a94657]
+ -->
+ <para>
+ Fix corner case bug when <function>strip_quote()</function> handle a empty query string. <ulink url="http://www.pgpool.net/mantisbt/view.php?id=458">(bug 458</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-10 [fc47d5f]
+ -->
+ <para>
+ Fix Pgpool child segfault if failover occurs when trying to establish a connection. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-January/003214.html">[pgpool-hackers: 3214]</ulink> for discussion.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-06 [21d6ae8]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when <varname>idle_in_transaction_session_timeout = on</varname>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=448">bug 448</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-4-21>
+ <title>Release 3.4.21</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-11-22</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-11-21 [8be3528]
+ -->
+
+ <para>
+ Fix to sort startup packet's parameters sent by client.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=444">bug 444</ulink>)(Takuma Hoshiai)
+ </para>
+ <para>
+ If order of startup packet's parameters differ between cached connection
+ pools and connection request, didn't use connection pool ,and created new
+ connection pool.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-13 [8d445dd]
+ -->
+
+ <para>
+ Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=443">bug 443</ulink>)(Bo Peng)
+ </para>
+ <para>
+ If the number of parameter format codes is specified to one, but the number
+ of the original query's parameter is zero, <function>bind_rewrite_timestamp()</>
+ will call <function>memcpy</> with a negative value.
+ This causes segmentation fault.
+ </para>
+ <para>
+ Patch is provided by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-08 [6d17384]
+ -->
+
+ <para>
+ Fix a query passed to relcache so that it uses schema qualified table name. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-05 [ca3466a]
+ -->
+
+ <para>
+ Fix query cache invalidation bug. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-01 [ca3dc43]
+ -->
+ <para>
+ Fix memory leak in extended query + query cache enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-20">
+ <title>Release 3.4.20</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-18 [8cc799a]
+ -->
+ <para>
+ Change <filename>pgpool.spec</filename> file to install extension to DB server which supports LLVM JIT. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-29 [b8d4b6c]
+ -->
+ <para>
+ Test: Add regression test for SSL connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [6c48e90]
+ -->
+ <para>
+ Test: Add definition of PGLIB in <filename>regress.sh</filename>. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-25 [6f8507e]
+ -->
+ <para>
+ Fix typo in <varname>child_max_connections</varname> description of <command>SHOW POOL_STATUS</command> output. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Phil Ramirez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-22 [73478a4]
+ -->
+ <para>
+ Fix segmentation fault when error query and Sync message are sent in native replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=434">bug 434</ulink>) (Takuma Hoshiai)
+ </para>
+ <para>
+ In native replication mode, segmentation fault occurs when Sync messages is sent just after a query error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [103ac89]
+ -->
+ <para>
+ Fix syntax error when queries including time functions and
+ <literal>IN (SELECT ...)</literal> in <literal>WHERE</literal>
+ clause in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=433">bug 433</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In native replication mode, queries including time functions (e.g. <function>now()</function>, <function>CURRENT_TIMESTAMP</function> etc.) are rewritten to a timestamp constant value.
+ However, <productname>Pgpool-II</productname> doesn't support queries including time functions and <literal>IN (SELECT ...)</literal> in <literal>WHERE</literal> clause.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [be2e21c]
+ -->
+ <para>
+ Fix memory leak in <function>trigger_failover_command()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [50eb310]
+ -->
+ <para>
+ Fix memory leak when memory_cache_enabled = on and write SQLs are sent. (Bo Peng)
+ </para>
+ <para>
+ In a explicit transaction, the <literal>SELECT</literal> results are cached in temporary buffer.
+ If a write <acronym>SQL</acronym> is sent which modifies the table, the temporary buffer should be reset.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [b6fbb58]
+ -->
+ <para>
+ Test: Fix occasional failure in regression 065.bug152. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-19 [ab22c8a]
+ -->
+ <para>
+ Add missing <filename>pgpool_recovery--1.0--1.1.sql</filename> file to update
+ <function>pgpool_recovery()</function> function version to 1.1. (Bo Peng)
+ Add missing pgpool_recovery--1.0--1.1.sql file to update pgpool_recovery() function version to 1.1. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-27 [7db4027]
+ -->
+ <para>
+ Do not update <xref linkend="guc-pool-passwd"> if the password length is incorrect.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=419">bug 419</ulink>) (Takuma Hoshiai, Tatsuo Ishii)
+ </para>
+ <para>
+ For <productname>Pgpool-II</productname> 3.7 or before, the password stored in
+ <xref linkend="guc-pool-passwd"> is <literal>MD5</literal> password only.
+ So check the correctness of <xref linkend="guc-pool-passwd"> by scanning entire file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [1457c2a]
+ -->
+ <para>
+ Test: Update <filename>clean.sh</filename> which clean up regression test results. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [964f2d8]
+ -->
+ <para>
+ Add .gitignore files. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-05 [5f915b3]
+ -->
+ <para>
+ Fix segfault when node 0 is in down status in case of both health check
+ and <xref linkend="guc-failover-on-backend-error"> are disabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-19">
+ <title>Release 3.4.19</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-07-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-07-04 [c26135e]
+ -->
+ <para>
+ Fix "write on backend 0 failed with error :"Success"" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=403">bug 403</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Don't treated it as an error if <function>write()</function> returns 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-20 [a393d0e]
+ -->
+ <para>
+ Fix memory leaks related to <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [45df6fd]
+ -->
+ <para>
+ Fix an incorrect declare as bool, rather than int in <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ This led to a segfault issue mentioned on certain platform.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [91f141e]
+ -->
+ <para>
+ Fix segfault in <function>per_node_error_log()</function> on armhf architecture. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Christian Ehrhardt.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-20 [b8228d5]
+ 2018-07-11 [bad92c4]
+ -->
+ <para>
+ Test: Fix 006.memqcache test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-18">
+ <title>Release 3.4.18</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-06-12</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-04-18 [34253a5]
+ -->
+ <para>
+ Prevent <xref linkend="PCP-RECOVERY-NODE"> from recovering "unused" status node. (Tatsuo Ishii)
+ </para>
+ <para>
+ This allowed to try to recovery a node without configuration data,
+ which leads to variety of problems.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-March/006021.html">[pgpool-general: 5963]</ulink>
+ for more details.
+ </para>
+ <para>
+ Also I fixed <function>pgpool_recovery</function> function so that it quotes an
+ empty string argument with double quotes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-17">
+ <title>Release 3.4.17</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-04-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-04-09 [a20855b]
+ -->
+ <para>
+ Test: Add new regression test for node 0 is down. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-08 [dfde4ff]
+ -->
+ <para>
+ Make calls to to_regclass fully schema qualified. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-20 [5fb797e]
+ -->
+ <para>
+ Test: Improve the test script 003.failover. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [d669a0d]
+ -->
+ <para>
+ Allow to support <function>pgpool_switch_xlog</function> <productname>PostgreSQL</productname> 10. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [c90dde1]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> failure in replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-16">
+ <title>Release 3.4.16</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-02-13</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-01-29 [717c4dd]
+ -->
+ <para>
+ Set TCP_NODELAY and non blocking to frontend socket. (Tatsuo Ishii)
+ </para>
+ <para>
+ TCP_NODELAY is employed by <productname>PostgreSQL</>, so do we it.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [0bca7cf]
+ -->
+ <para>
+ Change systemd service file to use <varname>STOP_OPTS=" -m fast"</>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [9dab4b2]
+ -->
+ <para>
+ Change <command>pgpool_setup</> to add restore_command in <filename>recovery.conf</>. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-01-24 [a4f9d5a]
+ -->
+ <para>
+ Fix segfault when %a is in <varname>log_line_prefix</> and debug message is on. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=376">bug 376</ulink>) (Tatsuo Ishii)
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-18 [21451f9]
+ -->
+ <para>
+ Fix queries hanging in <function>parse_before_bind</> with extended protocol and replication + load-balancing. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=377">bug 377</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-15">
+ <title>Release 3.4.15</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-01-09</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-12-22 [ae98493]
+ -->
+ <para>
+ Replace <command>/bin/ed</command> with <command>/bin/sed</command> in <xref linkend="pgpool-setup">, because <command>/bin/sed</command> is included in most distribution's base packages. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-21 [2168564]
+ -->
+ <para>
+ Change the <filename>pgpool.service</filename> and sysconfig files to output <productname>Pgpool-II</productname> log. (Bo Peng)
+ </para>
+ <para>
+ Removing "Type=forking" and add OPTS=" -n" to
+ run <productname>Pgpool-II</productname> with non-daemon mode, because we need to redirect logs.
+ Using <command>"journalctl"</command> command to see <productname>Pgpool-II</productname> systemd log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-18 [f908e30]
+ 2017-12-17 [e799639]
+ -->
+ <para>
+ Fix timestamp data inconsistency by replication mode. (Bo Peng)
+ </para>
+ <para>
+ From <productname>PostgreSQL</productname>10 the column
+ default value such as 'CURRENT_DATE' changes,
+ <productname>Pgpool-II</productname> didn't rewrite
+ timestamp by the added default values. This caused data inconsistency.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-10 [c34517f]
+ -->
+ <para>
+ Fix returning transaction state when "ready for query" message received. (Tatsuo Ishii)
+ </para>
+ <para>
+ We return primary or master node state of ready for query message to
+ frontend. In most cases this is good. However if other than primary
+ node or master node returns an error state (this could happen if load
+ balance node is other than primary or master node and the query is an
+ erroneous SELECT), this should be returned to frontend, because the
+ frontend already received an error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-11-16 [9e21ef9]
+ -->
+ <para>
+ Fix pgpool start message printed multiple times. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-14">
+ <title>Release 3.4.14</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-11-01</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-10-31 [97b08f7]
+ -->
+ <para>
+ Add different pgpool.sysconfig file for RHEL6 and RHEL7. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=343">bug 343</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In RHEL6, the "-n" option is needed to redirect log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-08 [f484c61]
+ -->
+ <para>
+ Fix finding primary node is not working in 3.4.12, 3.4.13. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [eb9347e]
+ -->
+ <para>
+ Fix bug mistakenly overriding global backend status right after failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-September/005786.html">[pgpool-general: 5728]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-11 [588996f]
+ -->
+ <para>
+ Deal with OpenSSL 1.1. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-13">
+ <title>Release 3.4.13</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-09-05</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-08-24 [4bae117]
+ -->
+ <para>
+ Doc: Fix documentation about load-balancing. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-15 [d29d0eb]
+ -->
+ <para>
+ Fix ancient bug of <function>pool_unread()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ When <function>realloc()</function> is called in <function>pool_unread()</function>, it did not update the
+ buffer size. This could cause variety of memory corruption and
+ unexpected data reading from backend. The reason why we did not found
+ that is, probably recently <productname>Pgpool-II</productname> starts extensively to use
+ <function>pool_unread()</function>.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [cd4b6e9]
+ -->
+ <para>
+ Test: Fix Java program in 005.regression test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [be2e8ff]
+ -->
+ <para>
+ Fix for when failover is triggered by worker process, it is possible that wrong DB node could failover. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=303">bug 303</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ This is due to the db_node_id member in the <varname>POLL_CONNECTION</varname> structure is not initialized in the process (in child process the member is properly initialized). To solve the problem, add new function <function>pool_set_db_node_id()</function> to set the structure member variable and call it inside <function>make_persistent_db_connection()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-31 [3fcbf78]
+ -->
+ <para>
+ Fix starting unnecessary transaction when <command>SET</command> command is issued. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [f81d820]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-July/005679.html">[pgpool-general: 5621]</ulink> <function>Failover()</function> function should be executed with health check alarm disabled. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-20 [ce47f4f]
+ -->
+ <para>
+ Allow make dist to include <filename>pgpool.service</filename>. (Yugo Nagata)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-4-12">
+ <title>Release 3.4.12</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-07-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-06-29 [0a1b675]
+ -->
+ <para>
+ Importing the latest changes in the <productname>MemoryManager API</productname> from <productname>PostgreSQL</productname> code. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-21 [8991f6e]
+ -->
+ <para>
+ Fixing <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002390.html">[pgpool-hackers: 2390]</ulink>Problems with the relative paths in daemon mode (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-19 [7b90252]
+ -->
+ <para>
+ Adjust function name change in <productname>PostgreSQL</productname> 10 dev head. (Tatsuo Ishii)
+ </para>
+ <programlisting>
+ pg_current_wal_location -> pg_current_wal_lsn
+ pg_last_wal_replay_location -> pg_last_wal_replay_lsn
+ </programlisting>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [4d2281e]
+ -->
+ <para>
+ Fix query cache hang when used by node.js. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-May/005569.html">[pgpool-general: 5511]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-28 [d313520]
+ -->
+ <para>
+ Deal with <productname>PostgreSQL</productname> 10 in streaming replication delay checking. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-27 [b755fd4]
+ -->
+ <para>
+ Fix query cache memory leak. (Tatsuo Ishii)
+ </para>
+ <para>
+ Clearing cache buffers in case of no oid queries (like <command>BEGIN</command>,
+ <command>CHECKPOINT</command>, <command>VACUUM</command>, etc) should have been done, but it did not.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-10 [e4ce880]
+ -->
+ <para>
+ Fix corner case bug in <productname>Pgpool-II</productname> starting up. (Tatsuo Ishii)
+ </para>
+ <para>
+ It is possible that a failover request is accepted before primary node
+ is searched. This leads <productname>Pgpool-II</productname> to a strange state: there's no
+ primary node if the failed node was a primary node (even if new
+ primary node exists as a result of promotion of existing standby).
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2017-May/002321.html">[pgpool-hackers: 2321]</ulink> for more details.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-4-11">
+ <title>Release 3.4.11</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-04-28</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-04-12 [60ae422]
+ -->
+ <para>
+
+ Fix for 0000299: Errors on the reloading of configuration.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=299">(Bug 299)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-04 [877e7ad]
+ -->
+ <para>
+ Fix coverity warnings. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-31 [6f25856]
+ -->
+ <para>
+ Fix for <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-March/005454.html">[pgpool-general: 5396]</ulink> pam ldap failure. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-24 [1172e6c]
+ -->
+ <para>
+ Fix for 0000296: Pgpool v3.6.2 terminated by systemd because the service Type has been set to 'forking'.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=296">(Bug 296)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-4-10">
+ <title>Release 3.4.10</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-03-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-03-17 [ba1bcc3]
+ -->
+ <para>
+ Add "Wants=network.target" to pgpool.service file.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=294">bug 294</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2017-03-09 [1ddb7f1]
+ -->
+ <para>
+ Fix <link linkend="PCP-PROMOTE-NODE">pcp_promote_node</link> bug that fails promoting node 0. (Yugo Nagata)
+ </para>
+ <para>
+ The master node could not be promoted by pcp_promote_node with
+ the following error;
+ </para>
+
+ <programlisting>
+ FATAL: invalid pgpool mode for process recovery request
+ DETAIL: specified node is already primary node, can't promote node id 0
+ </programlisting>
+
+ <para>
+ In streaming replication mode, there is a case that Pgpool-II
+ regards the status of primary node as "standby" for some reasons,
+ for example, when pg_ctl promote is executed manually during
+ Pgpool-II is running, in which case, it seems to Pgpool-II
+ that the primary node doesn't exist.
+ </para>
+
+ <para>
+ This status mismatch should be fixed by pcp_promote_node, but when the node
+ is the master node (the first alive node), it fails as mentioned above.
+ </para>
+
+ <para>
+ The reason is as following. before changing the status, pcp_promote_node
+ checks if the specified node is already primary or not by comparing the
+ node id with PRIMARY_NODE_ID. However, if the primary doesn't exist from
+ Pgpool-II's view, PRIMARY_NODE_ID is set to 0, which is same as MASTER_NODE_ID.
+ Hence, when the master node is specified to be promoted, pcp_promote_node
+ is confused that this node is already primary and doesn't have to be
+ promoted, and it exits with the error.
+ </para>
+
+ <para>
+ To fix this, pcp_promote_node should check the node id by using
+ REAL_PRIMARY_NODE_ID, which is set -1 when the primary doesn't exist,
+ rather than PRIMARY_NODE_ID.
+
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <!--
+ 2017-02-28 [5b4f78c]
+ -->
+ <para>
+ Add the latest release note link to README file.(Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [2b7217e]
+ -->
+ <para>
+ <productname>Pgpool-II</productname>should not perform ping test after bringing down the VIP. (Muhammad Usama)
+ </para>
+
+ <para>
+ This issue was reported by the reporter of
+ bug:[pgpool-II 0000249]: watchdog sometimes fails de-escalation
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [7ed400b]
+ -->
+ <para>
+ Fix to release shared memory segments when <productname>Pgpool-II</productname>exits.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=272">bug 272</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-14 [c1cd41c]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-February/005373.html">[pgpool-general: 5315]</ulink> pg_terminate_backend (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-06 [8fa731a]
+ -->
+ <para>
+ Adding the missing ExecStop and ExecReload commands to the systemd service configuration file. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [6362ba6]
+ -->
+ <para>
+ Fix for 281: "segmentation fault" when execute <link linkend="PCP-ATTACH-NODE">pcp_attach_node</link>.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=281">bug 281</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [fb58877]
+ -->
+ <para>
+ Fix load balancing bug in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ In an explicit transaction, any SELECT will be load balanced until
+ write query is sent. After writing query is sent, any SELECT should be
+ sent to the primary node. However if a SELECT is sent before a sync
+ message is sent, this does not work since the treatment of writing
+ query is done after ready for query message arrives.
+ </para>
+ <para>
+ Solution is, the treatment for writing query is done in executing the writing query as well.
+ </para>
+
+ <para>
+ The bug has been there since V3.5.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [8371649]
+ -->
+ <para>
+ Fix yet another kind mismatch error in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [4f98bf0]
+ -->
+ <para>
+ Fix <function>do_query()</function>hangs after close message. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [7512482]
+ -->
+ <para>
+ Fixing stack smashing detected. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=280">bug 280</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ It was a buffer overflow in <function>wd_get_cmd</function> function
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-11 [29b61eb]
+ -->
+ <para>
+ Remove elog/ereport calls from signal handlers. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-December/001950.html">[pgpool-hackers: 1950]</ulink> for details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-10 [39d24e7]
+ -->
+ <para>
+ Fix bug failed to create INET domain socket in FreeBSD if listen_addresses = '*'. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=202">bug 202</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [8598d5a]
+ -->
+ <para>
+ Fix for 0000249: watchdog sometimes fails de-escalation. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=249">bug 249</ulink>) (Muhammad Usama)
+ </para>
+
+ <para>
+ The solution is to use the <function>waitpid()</function> system call without WNOHANG option.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [bd92a11]
+ -->
+ <para>
+ Fix connection_life_time broken by authentication_timeout. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-28 [afebadf]
+ -->
+ <para>
+ Fix authentication timeout that can occur right after client connections. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-4-9">
+ <title>Release 3.4.9</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-12-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-12-23 [f5e9a2a]
+ -->
+ <para>
+ Tightening up the watchdog security. (Muhammad Usama)
+ </para>
+
+ <para>
+ Now wd_authkey uses the HMAC SHA-256 hashing.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-22 [79f1ba8]
+ -->
+ <para>
+ Add pgpool_adm extension in <productname>Pgpool-II</productname>RPM. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-20 [888ac16]
+ -->
+ <para>
+ Fix occasional segfault when query cache is enabled. (bug 263) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-27 [f37c592]
+ -->
+ <para>
+ Do not cancel a query when the query resulted in an error other than in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ It was intended to keep the consistency, but there's no point in other
+ than native replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-27 [c9e203d]
+ -->
+ <para>
+ Remove obsoleted option "-c" in pgpool command. (Tatsuo Ishii)
+ </para>
+ <para>
+ Also fix typo in the help message.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-24 [8aa7586]
+ -->
+ <para>
+ Change the default value of search_primary_node_timeout from 10 to 300. (Tatsuo Ishii)
+ </para>
+ <para>
+ Prior default value 10 seconds is sometimes too short for a standby to
+ be promoted.
+ </para>
+ <para>
+ Per [pgpool-general: 5026].
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-21 [b306e04]
+ -->
+ <para>
+ Fix the case when all backends are down then 1 node attached. (bug 248) (Tatsuo Ishii)
+ </para>
+ <para>
+ When all backends are down, no connection is accepted. Then 1
+ PostgreSQL becomes up, and attach the node using pcp_attach_node. It
+ successfully finishes. However, when a new connection arrives, still
+ the connection is refused because pgpool child process looks into the
+ cached status, in which the recovered node is still in down status if
+ mode is streaming replication mode (native replication and other modes
+ are fine). Solution is, if all nodes are down, force to restart all
+ pgpool child.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-09 [8231f65]
+ -->
+ <para>
+ Do not use random() while generating MD5 salt. (Tatsuo Ishii)
+ </para>
+ <para>
+ random() should not be used in security related applications. To
+ replace random(), import PostmasterRandom() from PostgreSQL. Also
+ store current time at the start up of Pgpool-II main process for later
+ use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-06 [891ce0f]
+ -->
+ <para>
+ Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
--- /dev/null
+<!-- doc/src/sgml/release-3.5.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id=release-3-5-28>
+ <title>Release 3.5.28</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-11-19</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-10-03 [d4cd86e]
+ -->
+ <para>
+ <productname>Pgpool-II</productname> doesn't support <acronym>GSSAPI</acronym>.
+ Allow <productname>Pgpool-II</productname> to deal with <acronym>GSSAPI</acronym> encrypted connection request from frontend instead of responding with an error. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is created by me, reviewed and tested by Umar Hayat.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [94cbceb]
+ -->
+ <para>
+ Fix query rewrite syntax error of "INSERT ... ON CONFLICT" in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=654">bug 654</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-30 [0e76626]
+ -->
+ <para>
+ Fix connection counter was not counted down when query is canceled.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=656">bug 656</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-23 [cefb2fc]
+ -->
+ <para>
+ Fix pgpool_setup bugs while checking the version of PostgreSQL. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-27>
+ <title>Release 3.5.27</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-09-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-13 [d35acfc]
+ -->
+ <para>
+ Follow the guide line of <productname>PostgreSQL</productname> 12.4 regarding extensions. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>CREATE OR REPLACE FUNCTION</command> should be avoided. Use <command>CREATE FUNCTION</command> instead.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-14 [7bf7f09]
+ -->
+ <para>
+ Remove unnecessary checks in some code path. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Hou, Zhijie.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-06 [07c8b39]
+ -->
+ <para>
+ Fix relcache query sometimes sent to other than primary. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, relcache queries are supposed to be
+ sent to the primary node. But actually they were not sent to the primary
+ node if primary node was not the master node. Typically this could
+ happen when the primary is not node 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-01 [fcb9ac4]
+ -->
+ <para>
+ Fix <xref linkend="GUC-CONNECTION-LIFE-TIME"> not working when <xref linkend="GUC-SERIALIZE-ACCEPT"> is enabled. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-August/007233.html">[pgpool-general: 7175]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-30 [53457d9]
+ -->
+ <para>
+ Display more informative error message in authentication process. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-21 [310650e]
+ -->
+ <para>
+ Fix segfault in pgpool child process in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ This issue can be reproduced with the following steps:
+ <orderedlist>
+ <listitem>
+ <para>
+ Shutdown all backends.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Connect to pgpool with invalid client. I have used <command>pcp_attach_node</command> with pgpool's port number, not pcp's.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-26>
+ <title>Release 3.5.26</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-08-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-05-22 [a73d5a1]
+ -->
+ <para>
+ Add mention about <literal>hostssl/hostnossl</literal> to <filename>pool_hba.conf</filename> sample file. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [0462d90]
+ -->
+ <para>
+ At pgpool startup, if pid file exists, truncate pid file to zero length before writing. (Bo Peng)
+ </para>
+ <para>
+ Patch is created by maliangzhu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [81b1e3e]
+ -->
+ <para>
+ Fix <xref linkend="guc-connection-life-time"> does not work if primary node is not 0 in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [014458a]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> problem with -r option and <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-31 [ea1a420]
+ -->
+ <para>
+ Change PCP <literal>UNIX_DOMAIN_PATH</literal> of RPM package to <filename>/var/run/postgresql</filename>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [6b31f2e]
+ 2020-07-14 [21bdf08]
+ -->
+ <para>
+ Fix query cache bugs. (Tatsuo Ishii)
+ </para>
+ <para>
+ If query cache is enable, when a table is updated, Pgpool-II should delete all the caches related to the table.
+ However, <command>EXPLAIN ANALYZE</command> and <acronym>CTE</acronym> with data-modifying SQLs
+ were mistakenly treated as normal read only query so that the query caches were not deleted.
+ </para>
+ <para>
+ Patch is created by Hou, Zhijie and modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-09 [4827bd4]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang in a corner case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-26 [5f62ef2]
+ -->
+ <para>
+ If there are parameters other than "user", "database" and "application_name", reading startup packet failed. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-22 [7587851]
+ -->
+ <para>
+ Fix miscount of connections when <function>pg_terminate_backend()</function> is executed. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-04 [4100dbf]
+ -->
+ <para>
+ Fix segmentation fault when application name is included in <xref linkend="GUC-LOG-LINE-PREFIX">. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=615">bug 615</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-25>
+ <title>Release 3.5.25</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-05-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-05-16 [2fd983b]
+ 2020-04-26 [1304dcc]
+ -->
+ <para>
+ Fix build error on some system (Fedora 32). (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [1221a65]
+ -->
+ <para>
+ Fix unnecessary checks. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by sherlockcpp. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007062.html">[pgpool-general: 7004]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-06 [5ce6273]
+ -->
+ <para>
+ Fix watchdog ping probes fail with long hostnames due to small buffer. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=516">bug 516</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-24>
+ <title>Release 3.5.24</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-02-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-01-28 [d60e6b7]
+ -->
+ <para>
+ Check if socket file exists at startup and remove them if PID file doesn't exist to avoid bind() failure. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-02-18 [e20c60b]
+ -->
+ <para>
+ Fix incorrect query rewriting in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=551">bug 551</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-02-08 [97446c3]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to support <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-11 [2f5c9a2]
+ 2020-01-10 [d1d490f]
+ 2020-01-04 [78364ae]
+ 2019-12-31 [0591a76]
+ 2019-12-27 [d4365d8]
+ 2019-12-26 [a308b49]
+ -->
+ <para>
+ Fix occasional regression test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-12-12 [88f1179]
+ -->
+ <para>
+ Fix replication delay worker segfault when application_name in primary_conninfo is an empty string.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=565">bug 565</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-11-18 [2a4be9b]
+ 2019-11-15 [0a7d632]
+ -->
+ <para>
+ Fix the bug with ignored syslog setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-23>
+ <title>Release 3.5.23</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-10-25 [45a3469]
+ -->
+ <para>
+ Fix incorrect query rewrite in replication mode. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-10 [4b726df]
+ -->
+ <para>
+ Fix assorted ancient v2 protocol bugs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-08 [45ac39b]
+ -->
+ <para>
+ Fix problem that <xref linkend="guc-syslog-facility"> doesn't change by reload.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=548">bug 548</ulink>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-03 [fed3d6b]
+ -->
+ <para>
+ Fix Pgpool-II shutdown failed in certain case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-15 [a333a45]
+ -->
+ <para>
+ Fix segfault when executing an erroneous query after DEALLOCATE a named statement.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=546">bug 546</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-16 [956c040]
+ -->
+ <para>
+ Add "-I" option to <xref linkend="guc-arping-cmd"> command default setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-22>
+ <title>Release 3.5.22</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-08-15</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-08-08 [94b0ce1]
+ -->
+ <para>
+ Import some of memory manager debug facilities from <productname>PostgreSQL</productname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-07-24 [d3493f7]
+ -->
+ <para>
+ Use <function>pg_get_expr()</function> instead of <literal>pg_attrdef.adsrc</literal> to support for <productname>PostgreSQL</productname> 12. (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-08-11 [c553e51]
+ 2019-08-08 [94364ad]
+ 2019-07-17 [5730d28]
+ 2019-07-02 [b364caa]
+ -->
+ <para>
+ Enhance shutdown script of <xref linkend="PGPOOL-SETUP">. (Tatsuo Ishii)
+ <itemizedlist>
+ <listitem>
+ <para>
+ Make shutdownall to wait for completion of shutdown of <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If environment variable <varname>CHECK_TIME_WAIT</varname> is set to true, use <command>netstat</command> command to confirm usage of the <literal>TCP/IP</literal> port while executing shutdown script.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-05-22 [57cd1d4]
+ -->
+ <para>
+ Deal <literal>pgpool_adm</literal> extension with <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-08-09 [c896d21]
+ -->
+ <para>
+ Fix "unable to bind. cannot get parse message" error.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=531">bug 531</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-08 [0da5292]
+ -->
+ <para>
+ Fix online-recovery is blocked after a child process exits abnormally with replication mode and watchdog.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=483">bug 483</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-28 [fbe8fdc]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to produce correct follow master command. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [44f8e2d]
+ -->
+ <para>
+ Fix query cache module so that it checks oid array's bound. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [ae45e93]
+ -->
+ <para>
+ Fix off-by-one error in query cache module. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-03 [380d8a5]
+ -->
+ <para>
+ Fix segfault when query cache is enabled. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=525">bug 525</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-02 [b8137d6]
+ -->
+ <para>
+ Down grade LOG "checking zapping sent message ..." to DEBUG5. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006678.html">[pgpool-general: 6620]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-24 [057a635]
+ -->
+ <para>
+ Fix segfault when <literal>samenet</literal> is specified in <filename>pool_hba.conf</filename>. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006659.html">[pgpool-general: 6601]</ulink>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-07 [9d7c5ba]
+ -->
+ <para>
+ Fix to deal with backslashes according to the config of <varname>standard_conforming_strings</varname> in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=467">bug 467</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-14 [0d6fdbc]
+ 2019-05-23 [0e8c1c2]
+ 2019-05-22 [c264275]
+ 2019-05-22 [53e7af0]
+ 2019-05-22 [19cfda2]
+ -->
+ <para>
+ Fix memory leaks. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [827a056]
+ -->
+ <para>
+ Make failover in progress check more aggressively to avoid potential segfault. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-21>
+ <title>Release 3.5.21</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-05-16</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-03 [6a4130f]
+ -->
+ <para>
+ Speed up failover when all of backends are down. (Tatsuo Ishii)
+ </para>
+ <para>
+ If all of the backend are in down status, immediately give up finding
+ primary node regardless search_primary_node_timeout and promptly
+ finish the failover process.
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-May/003321.html">[pgpool-hackers: 3321]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-30 [0cd3d5f]
+ 2019-04-30 [06d9887]
+ -->
+ <para>
+ pgpool-recovery extension and <command>pgpool_setup</> is now ready for the next major release <productname>PostgreSQL</> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-09 [f9536cc]
+ -->
+ <para>
+ Fix the wrong error message "ERROR: connection cache is full", when all backend nodes are down.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=487">bug 487</>) (Bo Peng)
+ </para>
+ <para>
+ When all backend nodes are down, <productname>Pgpool-II</> throws an incorrect
+ error message "ERROR: connection cache is full". Change the error
+ message to "all backend nodes are down, pgpool requires at least one valid node".
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-21 [d2bb1ec]
+ -->
+ <para>
+ Avoid exit/fork storm of pool_worker_child process. (Tatsuo Ishii)
+ </para>
+ <para>
+ pool_worker_child issues query to get WAL position using <function>do_query()</>,
+ which could throws FATAL error. In this case pool_worker_child process
+ exits and <productname>Pgpool-II</> parent immediately forks new process. This cycle
+ indefinitely repeats and gives high load to the system.
+ To avoid the exit/fork storm, sleep <varname>sr_check_period</>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-18 [157c5fe]
+ -->
+ <para>
+ Fix <xref linkend="GUC-WRITE-FUNCTION-LIST">'s broken default value. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-17 [d0b0fd0]
+ -->
+ <para>
+ Fix "not enough space in buffer" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=499">bug 499</>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The error occurred while processing error message returned from
+ backend and the cause is that the query string in question is too
+ big. Problem is, the buffer is in fixed size (8192 bytes).
+ Eliminate the fixed size buffer and use palloced buffer
+ instead. This also saves some memory copy work.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-16 [65f5db4]
+ -->
+ <para>
+ Fix DROP DATABASE failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-10 [c7d8845]
+ -->
+ <para>
+ Fix wrong variable in <function>read_status_file()</> function.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=493">bug 493</>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-02 [8e6176c]
+ -->
+ <para>
+ Abort session if failover/failback is ongoing to prevent potential segfault.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=481">bug 481</ulink>,
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=482">bug 482</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-30 [508f1c4]
+ 2019-03-30 [ab6c527]
+ -->
+ <para>
+ Fix compiler warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-28 [b39953c]
+ -->
+ <para>
+ Fix memory leak in "batch" mode in extended query.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=468">bug 468</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-20>
+ <title>Release 3.5.20</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-03-29</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-27 [4c6d5c3]
+ -->
+ <para>
+ Add new configuration option <xref linkend="guc-ssl-prefer-server-ciphers">. (Muhammad Usama)
+ </para>
+ <para>
+ Add the new setting <xref linkend="guc-ssl-prefer-server-ciphers"> to let users configure if they
+ want client's or server's cipher order to take preference.
+ </para>
+ <para>
+ The default for this parameter is off, which prioritize the client's
+ cipher order as usual. However this is just for keeping backward
+ compatibility, and it is possible that a malicious client uses weak
+ ciphers. For this reason we recommend to set this parameter to on at
+ all times.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-23 [d919f5a]
+ -->
+ <para>
+ Allow to set a client cipher list. (Tatsuo Ishii)
+ </para>
+ <para>
+ For this purpose new parameter <xref linkend="guc-ssl-ciphers">, which specifies the cipher
+ list to be accepted by <productname>Pgpool-II</>, is added.
+ This is already implemented in <productname>PostgreSQL</> and useful to enhance security when SSL is enabled.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-18 [d95f1f6]
+ -->
+ <para>
+ Fix unnecessary <function>fsync()</> to <filename>pgpool_status</> file. (Tatsuo Ishii)
+ </para>
+ <para>
+ Whenever new connections are created to PostgreSQL backend, <function>fsync()</>
+ was issued to <filename>pgpool_status</> file, which could generate excessive I/O
+ in certain conditions.
+ So reduce the chance of issuing <function>fsync()</> so that it is issued only when
+ backend status is changed.
+ </para>
+ <para>
+ Discussion: <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-February/006494.html">[pgpool-general: 6436]</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-19>
+ <title>Release 3.5.19</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-02-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-02-15 [2e4c67f]
+ -->
+ <para>
+ Test: Fix old JDBC functions and typos in regression test 068.memqcache_bug. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-15 [fee0584]
+ -->
+ <para>
+ Doc: Fix configuration change timing regarding <xref linkend="GUC-MEMORY-CACHE-ENABLED">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-12 [8bf96bf]
+ -->
+ <para>
+ Fix online recovery failed due to <xref linkend="GUC-CLIENT-IDLE-LIMIT-IN-RECOVERY"> in certain cases.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=431">bug 431</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-29 [8a94657]
+ -->
+ <para>
+ Fix corner case bug when <function>strip_quote()</function> handle a empty query string. <ulink url="http://www.pgpool.net/mantisbt/view.php?id=458">(bug 458</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-10 [fc47d5f]
+ -->
+ <para>
+ Fix Pgpool child segfault if failover occurs when trying to establish a connection. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-January/003214.html">[pgpool-hackers: 3214]</ulink> for discussion.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-12 [e979e6b]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang if a client sends a extended query message such as close after sync message but before next simple query. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-December/003164.html">[pgpool-hackers: 3164]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-06 [21d6ae8]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when <varname>idle_in_transaction_session_timeout = on</varname>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=448">bug 448</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-5-18>
+ <title>Release 3.5.18</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-11-22</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-11-21 [d8148c5]
+ -->
+
+ <para>
+ Fix to sort startup packet's parameters sent by client.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=444">bug 444</ulink>)(Takuma Hoshiai)
+ </para>
+ <para>
+ If order of startup packet's parameters differ between cached connection
+ pools and connection request, didn't use connection pool ,and created new
+ connection pool.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-13 [f342215]
+ -->
+
+ <para>
+ Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=443">bug 443</ulink>)(Bo Peng)
+ </para>
+ <para>
+ If the number of parameter format codes is specified to one, but the number
+ of the original query's parameter is zero, <function>bind_rewrite_timestamp()</>
+ will call <function>memcpy</> with a negative value.
+ This causes segmentation fault.
+ </para>
+ <para>
+ Patch is provided by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-08 [a92ceba]
+ -->
+
+ <para>
+ Fix a query passed to relcache so that it uses schema qualified table name. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-05 [14878cb]
+ -->
+
+ <para>
+ Fix query cache invalidation bug. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-03 [c466e5c]
+ -->
+
+ <para>
+ Fix segfault in extended query + query cache case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-01 [c47ba42]
+ -->
+ <para>
+ Fix memory leak in extended query + query cache enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-17">
+ <title>Release 3.5.17</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-30 [3d0311b]
+ -->
+ <para>
+ Allow <command>PCP[attach/detach/promote]</command> commands during failover. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [d3c29b7]
+ -->
+ <para>
+ Change <filename>pgpool.spec</filename> file to install extension to DB server which supports LLVM JIT. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-29 [ed8bfa5]
+ -->
+ <para>
+ Test: Add regression test for SSL connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [e41a92a]
+ -->
+ <para>
+ Test: Add definition of PGLIB in <filename>regress.sh</filename>. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-25 [c031a7e]
+ -->
+ <para>
+ Fix typo in <varname>child_max_connections</varname> description of <command>SHOW POOL_STATUS</command> output. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Phil Ramirez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-22 [f1b13a4]
+ -->
+ <para>
+ Fix segmentation fault when error query and Sync message are sent in native replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=434">bug 434</ulink>) (Takuma Hoshiai)
+ </para>
+ <para>
+ In native replication mode, segmentation fault occurs when Sync messages is sent just after a query error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [22e9242]
+ -->
+ <para>
+ Fix syntax error when queries including time functions and <literal>IN (SELECT ...)</literal> in
+ <literal>WHERE</literal> clause in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=433">bug 433</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In native replication mode, queries including time functions (e.g. <function>now()</function>, <function>CURRENT_TIMESTAMP</function> etc.) are rewritten to a timestamp constant value.
+ However, <productname>Pgpool-II</productname> doesn't support queries including time functions and <literal>IN (SELECT ...)</literal> in <literal>WHERE</literal> clause.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-12 [75cff9a]
+ -->
+ <para>
+ Fix occasional less data returned to frontend with extended protocol. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=432">bug432</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The idea for fix is, use pending message data list. It records
+ messages from frontend, and it is expected that we will receive same
+ number of messages.
+ </para>
+ <para>
+ Initial patch is created by Yugo Nagata and fixed by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [be2e21c]
+ -->
+ <para>
+ Fix memory leak in <function>trigger_failover_command()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [ebbdd6f]
+ -->
+ <para>
+ Fix memory leak when query cache enabled in streaming replication mode + extended query case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [5072e78]
+ -->
+ <para>
+ Fix memory leak when memory_cache_enabled = on and write SQLs are sent. (Bo Peng)
+ </para>
+ <para>
+ In a explicit transaction, the <literal>SELECT</literal> results are cached in temporary buffer.
+ If a write <acronym>SQL</acronym> is sent which modifies the table, the temporary buffer should be reset.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [26642f7]
+ -->
+ <para>
+ Fix occasional failure in regression 065.bug152. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-21 [011e56b]
+ -->
+ <para>
+ Test: Add <literal>EXECUTE/DEALLOCATE</literal> regression test. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-19 [576f576]
+ -->
+ <para>
+ Add missing <filename>pgpool_recovery--1.0--1.1.sql</filename> file to update
+ <function>pgpool_recovery()</function> function version to 1.1. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-13 [f771dd1]
+ -->
+ <para>
+ Fix kind mismatch error when <literal>DEALLOCATE</literal> statement is issued. (Bo Peng)
+ </para>
+ <para>
+ <literal>PREPARE</literal> should be add to pool_add_sent_message,
+ so that <literal>EXECUTE</literal> and <literal>DEALLOCATE</literal>
+ can be sent to the same node as <literal>PREPARE</literal>.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-September/006284.html">[pgpool-general: 6226]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-27 [afb0617]
+ -->
+ <para>
+ Do not update <xref linkend="guc-pool-passwd"> if the password length is incorrect.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=419">bug 419</ulink>) (Takuma Hoshiai, Tatsuo Ishii)
+ </para>
+ <para>
+ For <productname>Pgpool-II</productname> 3.7 or before, the password stored in
+ <xref linkend="guc-pool-passwd"> is <literal>MD5</literal> password only.
+ So check the correctness of <xref linkend="guc-pool-passwd"> by scanning entire file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [3d4e5f6]
+ -->
+ <para>
+ Test: Update <filename>clean.sh</filename> which clean up regression test results. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [5abd56e]
+ -->
+ <para>
+ Add .gitignore files. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-05 [d56f618]
+ -->
+ <para>
+ Fix segfault when node 0 is in down status in case of both health check
+ and <xref linkend="guc-failover-on-backend-error"> are disabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-16">
+ <title>Release 3.5.16</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-07-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-07-04 [eec52a4]
+ -->
+ <para>
+ Fix "write on backend 0 failed with error :"Success"" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=403">bug 403</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Don't treated it as an error if <function>write()</function> returns 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-20 [a73a255]
+ -->
+ <para>
+ Fix memory leaks related to <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [bf61ea2]
+ -->
+ <para>
+ Fix an incorrect declare as bool, rather than int in <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ This led to a segfault issue mentioned on certain platform.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [95f32d2]
+ -->
+ <para>
+ Fix segfault in <function>per_node_error_log()</function> on armhf architecture. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Christian Ehrhardt.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-06-20 [cc270ce]
+ 2018-07-11 [b37e629]
+ -->
+ <para>
+ Test: Fix 006.memqcache test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-15">
+ <title>Release 3.5.15</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-06-12</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-05-31 [871c089]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hung if replication delay is too much, when query cache enabled in extended query mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general-jp/2018-May/001533.html">[pgpool-general-jp: 1534]</ulink>
+ for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-24 [c88c336]
+ -->
+ <para>
+ In extended query mode, do not set writing tx flag with SET TRANSACTION READ ONLY. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-18 [7f47596]
+ -->
+ <para>
+ Prevent <xref linkend="PCP-RECOVERY-NODE"> from recovering "unused" status node. (Tatsuo Ishii)
+ </para>
+ <para>
+ This allowed to try to recovery a node without configuration data,
+ which leads to variety of problems.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-March/006021.html">[pgpool-general: 5963]</ulink>
+ for more details.
+ </para>
+ <para>
+ Also I fixed <function>pgpool_recovery</function> function so that it quotes an
+ empty string argument with double quotes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-14">
+ <title>Release 3.5.14</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-04-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-04-09 [b9ff4df]
+ -->
+ <para>
+ Test: Add new regression test for node 0 is down. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-08 [6bd77fe]
+ -->
+ <para>
+ Make calls to to_regclass fully schema qualified. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-20 [06b81ce]
+ -->
+ <para>
+ Test: Improve test script 003.failover. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-14 [cec26d2]
+ -->
+ <para>
+ Deal with "unable to bind D cannot get parse message "S1" error. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [f8c1824]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> failure in replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [c7d2af4]
+ -->
+ <para>
+ Allow to support <function>pgpool_switch_xlog</function> <productname>PostgreSQL</productname> 10. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-13">
+ <title>Release 3.5.13</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-02-13</simpara>
+ </note>
+ <note>
+ <para>
+ This release fixed the bug with socket writing added in Pgpool-II 3.7.0, 3.6.6 and 3.5.10. Due to this bug, when the network load is high, an illegal message may be sent to the frontend or backend. All users using 3.7.x, 3.6.6 or later, 3.5.10 or later versions of Pgpool-II should update as soon as possible.
+ </para>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-02-10 [a61b2bc]
+ -->
+ <para>
+ Allow to build with <literal>libressl</>. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-February/002714.html">[pgpool-hackers: 2714]</ulink> for more details. Patch by Sandino Araico Sanchez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [ca57328]
+ -->
+ <para>
+ Set TCP_NODELAY and non blocking to frontend socket. (Tatsuo Ishii)
+ </para>
+ <para>
+ TCP_NODELAY is employed by <productname>PostgreSQL</>, so do we it.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [e2be15a]
+ -->
+ <para>
+ Change systemd service file to use <varname>STOP_OPTS=" -m fast"</>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [883e0ae]
+ -->
+ <para>
+ Change <command>pgpool_setup</> to add restore_command in <filename>recovery.conf</>. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-02-09 [4ffa279]
+ -->
+ <para>
+ Fix writing transaction flag is accidentally set at commit or rollback. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [cfbde79]
+ -->
+ <para>
+ Fix bug with socket writing. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>pool_write_flush()</function> is responsible for writing to sockets when pgpool's
+ write buffer is full (this function was introduced in 3.6.6 etc). When
+ network write buffer in kernel is full, it does retrying but it forgot
+ to update the internal buffer pointer. As a result, broken data is
+ written to the socket. This results in variety of problems including
+ too large message length.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-24 [5afc059]
+ -->
+ <para>
+ Fix segfault when %a is in <varname>log_line_prefix</> and debug message is on. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=376">bug 376</ulink>) (Tatsuo Ishii)
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-18 [59267e3]
+ -->
+ <para>
+ Fix queries hanging in <function>parse_before_bind</> with extended protocol and replication + load-balancing. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=377">bug 377</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-12">
+ <title>Release 3.5.12</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-01-09</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-12-22 [725e7fb]
+ -->
+ <para>
+ Replace <command>/bin/ed</command> with <command>/bin/sed</command> in <xref linkend="pgpool-setup">, because <command>/bin/sed</command> is included in most distribution's base packages. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-21 [20d83ee]
+ -->
+ <para>
+ Change the <filename>pgpool.service</filename> and sysconfig files to output <productname>Pgpool-II</productname> log. (Bo Peng)
+ </para>
+ <para>
+ Removing "Type=forking" and add OPTS=" -n" to
+ run <productname>Pgpool-II</productname> with non-daemon mode, because we need to redirect logs.
+ Using <command>"journalctl"</command> command to see <productname>Pgpool-II</productname> systemd log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-18 [6aaa2bd]
+ 2017-12-17 [29c26a7]
+ -->
+ <para>
+ Fix timestamp data inconsistency by replication mode. (Bo Peng)
+ </para>
+ <para>
+ From <productname>PostgreSQL</productname>10 the column
+ default value such as 'CURRENT_DATE' changes,
+ <productname>Pgpool-II</productname> didn't rewrite
+ timestamp by the added default values. This caused data inconsistency.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-14 [b590851]
+ -->
+ <para>
+ Downgrade a log message to debug message. (Tatsuo Ishii)
+ </para>
+ <para>
+ That was mistaken left while last development cycle.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [a94ee75]
+ -->
+ <para>
+ Fix for re-sync logic in reading packet from backend. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>read_kind_from_backend()</function>, which reads message kind
+ from backend, re-syncs backend nodes when a ready for query message is
+ received. Unfortunately it forgot to call
+ <function>pool_pending_message_pull_out()</function> to delete sync
+ pending message. This leads to random stuck while reading packets
+ from backend. Fix this to call <function>pool_pending_message_pull_out()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [2124bbd]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hangs. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=370">bug 370</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ If an erroneous query is sent to primary and without a sync message
+ the next query that requires a catalog cache look up is send,
+ <productname>Pgpool-II</productname> hangs in <function>do_query()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [5b2a5dc]
+ -->
+ <para>
+ Add SL_MODE macro for upper compatibility with Pgpool-II 3.7 or later. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-10 [719fb06]
+ -->
+ <para>
+ Fix returning transaction state when "ready for query" message received. (Tatsuo Ishii)
+ </para>
+ <para>
+ We return primary or master node state of ready for query message to
+ frontend. In most cases this is good. However if other than primary
+ node or master node returns an error state (this could happen if load
+ balance node is other than primary or master node and the query is an
+ erroneous SELECT), this should be returned to frontend, because the
+ frontend already received an error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-11-16 [b6c750b]
+ -->
+ <para>
+ Fix pgpool start message printed multiple times. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-11-15 [11d506a]
+ -->
+ <para>
+ Add an execute permission bit to the start/stop script in <xref linkend="watchdog-setup">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-11">
+ <title>Release 3.5.11</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-11-01</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-10-31 [f4e1e93]
+ -->
+ <para>
+ Add different pgpool.sysconfig file for RHEL6 and RHEL7. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=343">bug 343</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In RHEL6, the "-n" option is needed to redirect log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-16 [94b9919]
+ -->
+ <para>
+ Fix for bug in watchdog where sometime failover is not reliably performed. (Muhammad Usama)
+ </para>
+ <para>
+ Currently watchdog process only considers the node's watchdog state before
+ deciding if it can handle the failover and failover-locking requests.
+ </para>
+ <para>
+ But the problem with this technique is that, for the instance when the node has
+ announced itself as a master/coordinator of the cluster and is waiting for the
+ standby nodes to recognise it as a Master node. For that period of time the
+ watchdog state of the node is Master/coordinator, but it is yet not fully
+ capable of handling the failover and failover-locking requests.
+ </para>
+ <para>
+ So sometimes this leads to a situation where a failover is not reliably
+ performed in case when the failover request arrives while watchdog cluster is
+ in the process of electing a leader.
+ </para>
+ <para>
+ The fix for the above situation is to make sure that the node has fully acquired the Master status before accepting the failover and failover-locking requests.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-10 [6cf6ae1]
+ -->
+ <para>
+ Fix bug with handling of 'H' (flush) message in streaming replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=345">bug 345</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ If user expects to read response right after 'H', <productname>Pgpool-II</productname> hangs. The
+ cause was, when 'H' received, extended query mode was reset and
+ pending message was not used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-08 [3c40260]
+ -->
+ <para>
+ Doc: Fix <command>pcp_node_info</command> documents. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [86d1195]
+ -->
+ <para>
+ Fix bug mistakenly overriding global backend status right after failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-September/005786.html">[pgpool-general: 5728]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [3acd553]
+ -->
+ <para>
+ Fix exit signal handlers to not call ereport. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2017-September/002545.html">[pgpool-hackers: 2545]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-11 [dbfbb10]
+ -->
+ <para>
+ Deal with OpenSSL 1.1. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-10">
+ <title>Release 3.5.10</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-09-05</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-09-02 [322eb19]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hanging when error occurs in streaming replication mode and extended query. (Tatsuo Ishii)
+ </para>
+ <para>
+ If backend returns ERROR, <productname>Pgpool-II</productname> reads message from frontend until
+ a <literal>sync</literal> message is sent. Previous code assumed next message is <literal>sync</literal>.
+ However it is possible that more message coming before the <literal>sync</literal>
+ message, it's a low probability though. Fix it to continue reading
+ messages until the <literal>sync</literal> message is read.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-01 [ad90886]
+ -->
+ <para>
+ Fix <varname>wd_authkey</varname> bug in that a request to add new node to the cluster is rejected by master. (Yugo Nagata)
+ </para>
+ <para>
+ This is a bug due to the implementation of 3.5.6 and 3.6.3.
+ </para>
+ <para>
+ This changed the definition of tv_sec that is used to check wd_authkey so
+ that this was affected by the clock of OS. So, if there is a lag between
+ two nodes' clocks, the wd_authkey check fails.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-01 [56dccb4]
+ -->
+ <para>
+ Test: Fix load balance test driver. (Tatsuo Ishii)
+ </para>
+ <para>
+ Some tests only for native replication mode was executed in streaming replication mode as well.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-31 [b380241]
+ -->
+ <para>
+ Fix not working <literal>slony</literal> mode in extended query. (Tatsuo Ishii)
+ </para>
+ <para>
+ When response returned from backend, in progress flag was not reset in <literal>slony</literal> mode, which cause waiting for next message from backend in vain.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-29 [e0d27bd]
+ -->
+ <para>
+ Fix ancient bug of stream write modules. (Tatsuo Ishii)
+ </para>
+ <para>
+ Fix bug with <function>pool_write_noerror()</function> when requested length exceeds remaining write buffer size. This could lead to a buffer overrun problem.
+ </para>
+ <para>
+ When write buffer is full, <function>pool_flush_it()</function> is called, which could write data to socket in the middle of message. To fix the problem directly write requested data if the write buffer is going to be full.
+ </para>
+ <para>
+ Enhance performance of <function>pool_unread()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-24 [661c8d3]
+ -->
+ <para>
+ Test: Some miscellanies small fixes in regression test scripts. (Muhammad Usama)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-24 [7bcd7b8]
+ -->
+ <para>
+ Doc: Fix documentation about load-balancing. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-16 [2db0ded]
+ -->
+ <para>
+ Fix core dump and mishandling of temp tables. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-15 [2f3d3e1]
+ -->
+ <para>
+ Fix ancient bug of <function>pool_unread()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ When <function>realloc()</function> is called in <function>pool_unread()</function>, it did not update the
+ buffer size. This could cause variety of memory corruption and
+ unexpected data reading from backend. The reason why we did not found
+ that is, probably recently <productname>Pgpool-II</productname> starts extensively to use
+ <function>pool_unread()</function>.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-13 [645468e]
+ -->
+ <para>
+ Fix handling of empty queries. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=328">bug 328</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ When empty query (empty string or all comment query) is sent, command
+ complete message was returned to frontend. This is not correct. An
+ empty query response should be returned to frontend.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-09 [e1de72c]
+ -->
+ <para>
+ Fix query cache bug with streaming replication mode and extended query case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [0780efe]
+ -->
+ <para>
+ Fix memory leak with streaming replication mode/extended query case. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=324">bug 324</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [3b298f0]
+ -->
+ <para>
+ Test: Fix Java program in 005.regression test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [49e47ec]
+ -->
+ <para>
+ Fix for when failover is triggered by worker process, it is possible that wrong DB node could failover. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=303">bug 303</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ This is due to the db_node_id member in the <varname>POLL_CONNECTION</varname> structure is not initialized in the process (in child process the member is properly initialized). To solve the problem, add new function <function>pool_set_db_node_id()</function> to set the structure member variable and call it inside <function>make_persistent_db_connection()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-31 [c4a2a44]
+ -->
+ <para>
+ Fix starting unnecessary transaction when <command>SET</command> command is issued. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [6586da8]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-July/005679.html">[pgpool-general: 5621]</ulink> <function>Failover()</function> function should be executed with health check alarm disabled. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [7958f97]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hung up bug or other errors in error case in extended query in replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ And other fixes in this commit.
+ </para>
+ <para>
+ 1) Do not send intended error query to backend in streaming replication mode in <function>ErrorResponse3()</function>.
+ </para>
+ <para>
+ 2) Fix <function>pool_virtual_master_db_node_id()</function> to return the virtual_master_node_id only when query is in progress and query context exists.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-20 [504fb3b]
+ -->
+ <para>
+ Allow make dist to include <filename>pgpool.service</filename>. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-08-09 [50223bc]
+ -->
+ <para>
+ Test: Redirect build log to a log file. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-09 [ea3a958]
+ -->
+ <para>
+ Test: Add more memory leak regression tests. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-9">
+ <title>Release 3.5.9</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-07-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-07-07 [d845be6]
+ -->
+ <para>
+ Fix for <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002400.html">[pgpool-hackers: 2400]</ulink> Garbage output (Muhammad Usama)
+ </para>
+ <para>
+ Mostly the log messages fixes and few code cleanups.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-29 [e83a274]
+ -->
+ <para>
+ Importing the latest changes in the <productname>MemoryManager API</productname> from <productname>PostgreSQL</productname> code. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-21 [cc0b21d]
+ -->
+ <para>
+ Fixing <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002390.html">[pgpool-hackers: 2390]</ulink>Problems with the relative paths in daemon mode (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-19 [d1013ac]
+ -->
+ <para>
+ Adjust function name change in <productname>PostgreSQL</productname> 10 dev head. (Tatsuo Ishii)
+ </para>
+ <programlisting>
+ pg_current_wal_location -> pg_current_wal_lsn
+ pg_last_wal_replay_location -> pg_last_wal_replay_lsn
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-09 [b86e7b7]
+ -->
+ <para>
+ Fix a possible hang with streaming replication and extended protocol (Yugo Nagata)
+ </para>
+ <para>
+ This hang occurred under a certain condition. The following is an example.
+ </para>
+
+ <programlisting>
+ - pgpool.conf is configured so that all read queries are sent to the standby.
+ - First, issue a writing query in a transaction block
+ - After committing the transaction, issue a select query.
+ - When processing the query, send Describe (statement) message just after Parse.
+ </programlisting>
+
+ <para>
+ Without using <productname>JDBC</productname>, we can reproduce the problem by <productname>pgproto</productname> with the following messages.
+ </para>
+
+ <programlisting>
+ 'Q' "DROP TABLE IF EXISTS test_tbl"
+ 'Y'
+ 'Q' "CREATE TABLE test_tbl(i int)"
+ 'Y'
+ 'Q' "INSERT INTO test_tbl VALUES(1)"
+ 'Y'
+
+ 'P' "" "BEGIN" 0
+ 'B' "" "" 0 0 0
+ 'E' "" 0
+ 'S'
+ 'Y'
+
+ 'P' "" "INSERT INTO test_tbl VALUES(1)" 0
+ 'B' "" "" 0 0 0
+ 'E' "" 0
+ 'S'
+ 'Y'
+
+ 'P' "" "COMMIT" 0
+ 'B' "" "" 0 0 0
+ 'E' "" 0
+ 'S'
+ 'Y'
+
+ 'P' "S_1" "SELECT * FROM test_tbl" 0
+ 'D' 'S' "S_1"
+ 'B' "C_1" "S_1" 0 0 0
+ 'E' "C_1" 0
+ 'S'
+ 'Y'
+
+ 'X'
+ </programlisting>
+
+ <para>
+ To fix it, <function>parse_before_bind()</function> should be called only if we are in a transaction block so that we can send <command>Bind</command> and <command>Execute</command> to the right backend.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-07 [378111d]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when used by <productname>erlang</productname> applications. (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>Erlang</productname> client sends "Describe" message followed by "Flush". So the
+ backend returns "Row description." However <productname>Pgpool-II</productname> forgets to reset
+ the query in progress flag upon receiving "Row description" message,
+ then <productname>Pgpool-II</productname> keeps on waiting for response from backend. This is the
+ cause of erlang client hanging.
+ </para>
+ <para>
+ Fix is, just reset the query in progress flag upon receiving "Row
+ description" message. Same thing can be said to "no data" message.
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-June/005613.html">[pgpool-general: 5555]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-07 [cfcb85e]
+ -->
+ <para>
+ Fix bug with sending bind message to wrong target node. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=314">bug 314</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [ba69889]
+ -->
+ <para>
+ Fix query cache hang when used by node.js. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-May/005569.html">[pgpool-general: 5511]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-28 [9de196b]
+ -->
+ <para>
+ Deal with <productname>PostgreSQL</productname> 10 in streaming replication delay checking. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-27 [52769db]
+ -->
+ <para>
+ Fix query cache memory leak. (Tatsuo Ishii)
+ </para>
+ <para>
+ Clearing cache buffers in case of no oid queries (like <command>BEGIN</command>,
+ <command>CHECKPOINT</command>, <command>VACUUM</command>, etc) should have been done, but it did not.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-23 [27a516a]
+ -->
+ <para>
+ Fix extended query hang in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>errlang</productname> PostgreSQL API produces <command>Parse ('P')</command>, <command>Describe ('D')</command>,
+ <command>Flush ('H')</command>, <command>Bind ('B')</command>, and <command>Execute ('E')</command>. Notice the 'H' message (this
+ does not happen in <productname>JDBC</productname>. I suspect that's the reason why this problem
+ is not popular before). After that, <productname>Pgpool-II</productname> dropped the extended
+ query mode, it failed to find which backend to read data. Thus <productname>Pgpool-II</productname> simply tries to read all of backend which causes hang
+ because it may have not send a message to some of backends.
+ </para>
+ <para>
+ Solution is, after receiving the flush message set doing extended query flag.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-10 [7b2ef18]
+ -->
+ <para>
+ Fix corner case bug in <productname>Pgpool-II</productname> starting up. (Tatsuo Ishii)
+ </para>
+ <para>
+ It is possible that a failover request is accepted before primary node
+ is searched. This leads <productname>Pgpool-II</productname> to a strange state: there's no
+ primary node if the failed node was a primary node (even if new
+ primary node exists as a result of promotion of existing standby).
+ </para>
+
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2017-May/002321.html">[pgpool-hackers: 2321]</ulink> for more details.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-8">
+ <title>Release 3.5.8</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-05-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-05-08 [8b92a23]
+ -->
+ <para>
+ Add node 0 failover test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-04 [b97c38f]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> child process segfault reported in <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-May/002312.html">[pgpool-hackers: 2312]</ulink>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-5-7">
+ <title>Release 3.5.7</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-04-28</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-04-12 [0069844]
+ -->
+ <para>
+ Fixing a mistake in the watchdog code. (Muhammad Usama)
+ </para>
+ <para>
+ commit also adds some debug messages in the watchdog code.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [f99053c]
+ -->
+ <para>
+ Fix for 0000299: Errors on the reloading of configuration.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=299">(Bug 299)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-11 [2997b3a]
+ -->
+ <para>
+ Fix for 0000289: Inconsistent backend state.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=289">(Bug 289)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [ab32ae7]
+ -->
+ <para>
+ Enhancing the handling of split-brain scenario by the watchdog. (Muhammad Usama)
+ </para>
+ <para>
+ Previously, the watchdog cluster was used to call for re-election of the
+ master/coordinator node whenever the split-brain situation was detected. And
+ consequently every node was required to rejoin the watchdog network, Which was
+ essentially similar to the re-booting of the whole watchdog cluster.
+ </para>
+ <para>
+ The candidate for the master/coordinator node is selected on the following criteria.
+
+ </para>
+ <para>
+ 1-- When two watchdog nodes are claiming to be the cluster master, the master
+ node that has performed the escalation keeps the master status and the other
+ node is asked to step down.
+ </para>
+ <para>
+
+ 2-- If the conflict could not be resolved by the escalation status of the nodes,
+ The node which holds the quorum remains the master/coordinator.
+ </para>
+ <para>
+
+ 3-- If the quorum status of both contenders is also same. The node with higher
+ number of connected alive nodes get the preference.
+ </para>
+ <para>
+
+ 4-- Finally, if all above three yields no winner, the older master (The node
+ that has the coordinator status for longer duration) remains the master.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-11 [8ffd1fa]
+ -->
+ <para>
+ Enhancing the watchdog internal command mechanism to handle multiple concurrent commands. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [79f219a]
+ -->
+ <para>
+ Add bool encode and decode functions to JSON framework for code compatibility.(Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-06 [7859f06]
+ -->
+ <para>
+ Comment out unsupported Java method in new JDBC drivers to prevent regression failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-05 [436f7a7]
+ -->
+ <para>
+ Downgrade parse before bind log message to debug1. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-04 [aa4e308]
+ 2017-04-04 [24d9770]
+ 2017-04-03 [7d8482a]
+ -->
+ <para>
+ Fix coverity warnings. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-31 [f61e002]
+ -->
+ <para>
+ Fix for <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-March/005454.html">[pgpool-general: 5396]</ulink> pam ldap failure. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-31 [0c16dd1]
+ -->
+ <para>
+ Consider SHOW command as kind of a read query. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, if SHOW is issued then subsequent
+ SELECTs are sent to the primary node in an explicit transaction. This
+ is not a reasonable and unnecessary limitation.
+
+ Also fix hang when parse command returns error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-30 [4b28556]
+ -->
+ <para>
+ Fix memory leak problem caused by commit adcb636. (Tatsuo Ishii)
+ </para>
+ <para>
+ Commit adcb636 introduces "pending message queue". When a message
+ arrives, the info is added to the queue and a copy of object is
+ created at the same time, but forgot to free the object. Fix is,
+ creating a new function pool_pending_message_free_pending_message()
+ and call it after pool_pending_message_add(),
+ pool_pending_message_get() and pool_pending_message_pull_out().
+
+ Problem reported by Sergey Kim.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-29 [a504a9f]
+ -->
+ <para>
+ Mega patch to fix "kind mismatch" (or derived) errors in streaming replication mode.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=271">(Bug 271)</ulink> (Tatsuo Ishii)
+ </para>
+ <para>
+ The errors are caused by wrong prediction in which (or both) database
+ node will send response to Pgpool-II. Previous implementation using
+ "sync map" are weak and sometimes fail in the prediction.
+
+ </para>
+ <para>
+ This patch introduces new implementation using "pending message
+ queue", which records all sent message to backends. The element of the
+ queue stores info regarding messages types
+ (parse/bind/execute/describe/close/sync), to which database node the
+ message was sent and so on. It's a simple FIFO queue. When a message
+ arrives from backend, by looking at the head of the "pending message
+ queue", it is possible to reliably predict what kind of message and
+ from which database node it will arrive. After receiving the message,
+ the element is removed from the queue.
+ </para>
+ <para>
+
+ I would like to thank to Sergey Kim, who has been helping me in
+ testing series of patches.
+
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/mantisbt/view.php?id=271">Bug 271</ulink>
+ and discussion in pgpool-hackers mailing list
+ <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-February/002043.html">[pgpool-hackers: 2043]</ulink> and
+ <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-March/002140.html">[pgpool-hackers: 2140]</ulink>
+ for more details.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-24 [d726c3a]
+ -->
+ <para>
+ Fix for 0000296: Pgpool v3.6.2 terminated by systemd because the service Type has been set to 'forking'.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=296">(Bug 296)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-5-6">
+ <title>Release 3.5.6</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-03-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-03-17 [ba1bcc3]
+ -->
+ <para>
+ Add "Wants=network.target" to pgpool.service file.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=294">bug 294</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-09 [1ddb7f1]
+ -->
+ <para>
+ Fix <link linkend="PCP-PROMOTE-NODE">pcp_promote_node</link> bug that fails promoting node 0. (Yugo Nagata)
+ </para>
+ <para>
+ The master node could not be promoted by pcp_promote_node with
+ the following error;
+ </para>
+
+ <programlisting>
+ FATAL: invalid pgpool mode for process recovery request
+ DETAIL: specified node is already primary node, can't promote node id 0
+ </programlisting>
+
+ <para>
+ In streaming replication mode, there is a case that Pgpool-II
+ regards the status of primary node as "standby" for some reasons,
+ for example, when pg_ctl promote is executed manually during
+ Pgpool-II is running, in which case, it seems to Pgpool-II
+ that the primary node doesn't exist.
+ </para>
+
+ <para>
+ This status mismatch should be fixed by pcp_promote_node, but when the node
+ is the master node (the first alive node), it fails as mentioned above.
+ </para>
+
+ <para>
+ The reason is as following. before changing the status, pcp_promote_node
+ checks if the specified node is already primary or not by comparing the
+ node id with PRIMARY_NODE_ID. However, if the primary doesn't exist from
+ Pgpool-II's view, PRIMARY_NODE_ID is set to 0, which is same as MASTER_NODE_ID.
+ Hence, when the master node is specified to be promoted, pcp_promote_node
+ is confused that this node is already primary and doesn't have to be
+ promoted, and it exits with the error.
+ </para>
+
+ <para>
+ To fix this, pcp_promote_node should check the node id by using
+ REAL_PRIMARY_NODE_ID, which is set -1 when the primary doesn't exist,
+ rather than PRIMARY_NODE_ID.
+
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <!--
+ 2017-02-28 [5b4f78c]
+ -->
+ <para>
+ Add the latest release note link to README file.(Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [2b7217e]
+ -->
+ <para>
+ <productname>Pgpool-II</productname>should not perform ping test after bringing down the VIP. (Muhammad Usama)
+ </para>
+
+ <para>
+ This issue was reported by the reporter of
+ bug:[pgpool-II 0000249]: watchdog sometimes fails de-escalation
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [7ed400b]
+ -->
+ <para>
+ Fix to release shared memory segments when <productname>Pgpool-II</productname>exits.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=272">bug 272</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-14 [c1cd41c]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-February/005373.html">[pgpool-general: 5315]</ulink> pg_terminate_backend (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-06 [8fa731a]
+ -->
+ <para>
+ Adding the missing ExecStop and ExecReload commands to the systemd service configuration file. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [6362ba6]
+ -->
+ <para>
+ Fix for 281: "segmentation fault" when execute <link linkend="PCP-ATTACH-NODE">pcp_attach_node</link>.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=281">bug 281</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [fb58877]
+ -->
+ <para>
+ Fix load balancing bug in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ In an explicit transaction, any SELECT will be load balanced until
+ write query is sent. After writing query is sent, any SELECT should be
+ sent to the primary node. However if a SELECT is sent before a sync
+ message is sent, this does not work since the treatment of writing
+ query is done after ready for query message arrives.
+ </para>
+ <para>
+ Solution is, the treatment for writing query is done in executing the writing query as well.
+ </para>
+
+ <para>
+ The bug has been there since V3.5.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [8371649]
+ -->
+ <para>
+ Fix yet another kind mismatch error in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [4f98bf0]
+ -->
+ <para>
+ Fix <function>do_query()</function>hangs after close message. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [7512482]
+ -->
+ <para>
+ Fixing stack smashing detected. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=280">bug 280</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ It was a buffer overflow in <function>wd_get_cmd</function> function
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-19 [839a709]
+ -->
+ <para>
+ Fixing the issue with the watchdog process restart. (Muhammad Usama)
+ </para>
+ <para>
+ When the watchdog process gets abnormally terminated because of some problem
+ (e.g. Segmentation fault) the new spawned watchdog process fails to start and
+ produces an error "bind on ... failed with reason: Address already in use".
+ </para>
+ <para>
+ Reason is the abnormally terminating watchdog process never gets the time to
+ clean-up the socket it uses for IPC and the new process gets an error because
+ the socket address is already occupied.
+ </para>
+
+ <para>
+ Fix is, the Pgpool main process sets the flag in shared memory to mark the
+ watchdog process was abnormally terminated and at startup when the watchdog
+ process see that the flag is set, it performs the clean up of the socket file and
+ also performs the de-escalation (If the watchdog process was crashed when it
+ was master/coordinator node) if required before initializing itself.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-19 [779d029]
+ -->
+ <para>
+ Fix query cache bug reported in <ulink url="http://www.pgpool.net/pipermail/pgpool-general-jp/2017-January/001440.html">pgpool-general-jp:1441</ulink>. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode with query cache enabled, SELECT hangs
+ in the following scenario:
+ </para>
+
+ <programlisting>
+ 1) a SELECT hits query cache and returns rows from the query cache.
+ 2) following SELECT needs to search meta data and it hangs.
+ </programlisting>
+
+ <para>
+ In #1, while returning the cached result, it misses to call
+ pool_unset_pending_response(), which leave the pending_response flag
+ be set. In #2, do_query() checks the flag and tries to read pending
+ response from backend. Since there's no pending data in backend, it
+ hangs in reading data from backend.
+ </para>
+
+ <para>
+ Fix is, just call <function>pool_unset_pending_response()</function> in #1 to reset the
+ flag.
+ </para>
+
+ <para>
+ Bug report and fix provided by Nobuyuki Nagai.
+
+ New regression test item (068) added by me.
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-11 [29b61eb]
+ -->
+ <para>
+ Remove elog/ereport calls from signal handlers. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-December/001950.html">[pgpool-hackers: 1950]</ulink> for details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-10 [39d24e7]
+ -->
+ <para>
+ Fix bug failed to create INET domain socket in FreeBSD if listen_addresses = '*'.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=202">bug 202</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [8598d5a]
+ -->
+ <para>
+ Fix for 0000249: watchdog sometimes fails de-escalation.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=249">bug 249</ulink>) (Muhammad Usama)
+ </para>
+
+ <para>
+ The solution is to use the <function>waitpid()</function> system call without WNOHANG option.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [bd92a11]
+ -->
+ <para>
+ Fix connection_life_time broken by authentication_timeout. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-28 [afebadf]
+ -->
+ <para>
+ Fix authentication timeout that can occur right after client connections. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+
+
+<sect1 id="release-3-5-5">
+ <title>Release 3.5.5</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-12-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-12-23 [4124e5e]
+ -->
+ <para>
+ Tightening up the watchdog security. (Muhammad Usama)
+ </para>
+
+ <para>
+ Now wd_authkey uses the HMAC SHA-256 hashing.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-22 [f8a157a]
+ -->
+ <para>
+ Add pgpool_adm extension in <productname>Pgpool-II</productname> RPM. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-20 [888ac16]
+ -->
+ <para>
+ Fix occasional segfault when query cache is enabled. (bug 263) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-20 [9274f82]
+ -->
+ <para>
+ Fix packet kind does not match error in extended protocol. (bug 231) (Tatsuo Ishii)
+ </para>
+ <para>
+ According to the bug231, the bug seem to bite you if all of
+ following conditions are met:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Streaming replication mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Load balance node is not node 0
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Extended protocol is used
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SELECT is executed, the statement is closed, then a
+ transaction command is executed
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The sequence of how the problem bites is:
+ <orderedlist>
+ <listitem>
+ <para>
+ SELECT executes on statement S1 on the load balance node 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Frontend send Close statement
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pgpool-II forward it to backend 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Frontend sends Parse, Bind, Execute of COMMIT
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pgpool-II forward it to backend 0 & 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Frontend sends sync message
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pgpool-II forward it to backend 0 & 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Backend 0 replies back Parse complete ("1"), while
+ backend 1 replies back close complete ("3") because of
+ #3.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Kind mismatch occurs
+ </para>
+ </listitem>
+ </orderedlist>
+
+ </para>
+ <para>
+ The solution is, in #3, let Pgpool-II wait for response from backend
+ 1, but do not read the response message. Later on Pgpool-II's state
+ machine will read the response from it before the sync message is sent
+ in #6. With this, backend 1 will reply back "1" in #8, and the kind
+ mismatch error does not occur.
+ </para>
+ <para>
+ Also, fix not calling pool_set_doing_extended_query_message() when
+ receives Close message. (I don't know why it was missed).
+ </para>
+ <para>
+ New regression test "067.bug231" was added.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-06 [336e932]
+ -->
+ <para>
+ Fix a race condition in a signal handler per bug 265. (Tatsuo Ishii)
+ </para>
+ <para>
+ In child.c there's signal handler which calls elog. Since the signal
+ handler is not blocked against other signals while processing, deadlock
+ could occur in the system calls in the pgpool shutdown sequence. To
+ fix the problem, now the signal handler is blocked by using
+ POOL_SETMASK.
+ </para>
+ <para>
+ Ideally we should avoid calling elog in signal handlers though.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-11-26 [045a59f]
+ -->
+ <para>
+ Back porting the improved failover command propagation mechanism from Pgpool-II 3.6 (Muhammad Usama)
+ </para>
+ <para>
+ Overhauling the design of how failover, failback and promote node commands are
+ propagated to the watchdog nodes. Previously the watchdog on pgpool-II node that
+ needs to perform the node command (failover, failback or promote node) used to
+ broadcast the failover command to all attached pgpool-II nodes. And this
+ sometimes makes the synchronization issues, especially when the watchdog cluster
+ contains a large number of nodes and consequently the failover command sometimes
+ gets executed by more than one pgpool-II.
+ </para>
+ <para>
+ Now with this commit all the node commands are forwarded to the
+ master/coordinator watchdog, which in turn propagates to all standby nodes.
+ Apart from above the commit also changes the failover command interlocking
+ mechanism and now only the master/coordinator node can become the lock holder
+ so the failover commands will only get executed on the master/coordinator node.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-27 [f37c592]
+ -->
+ <para>
+ Do not cancel a query when the query resulted in an error other than in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ It was intended to keep the consistency, but there's no point in other
+ than native replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-27 [c9e203d]
+ -->
+ <para>
+ Remove obsoleted option "-c" in pgpool command. (Tatsuo Ishii)
+ </para>
+ <para>
+ Also fix typo in the help message.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-10-18 [8da0e7f]
+ -->
+ <para>
+ Fix authentication failed error when PCP command is cancelled. (bug 252) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-24 [8aa7586]
+ -->
+ <para>
+ Change the default value of search_primary_node_timeout from 10 to 300. (Tatsuo Ishii)
+ </para>
+ <para>
+ Prior default value 10 seconds is sometimes too short for a standby to
+ be promoted.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-21 [b306e04]
+ -->
+ <para>
+ Fix the case when all backends are down then 1 node attached. (bug 248) (Tatsuo Ishii)
+ </para>
+ <para>
+ When all backends are down, no connection is accepted. Then 1
+ PostgreSQL becomes up, and attach the node using pcp_attach_node. It
+ successfully finishes. However, when a new connection arrives, still
+ the connection is refused because pgpool child process looks into the
+ cached status, in which the recovered node is still in down status if
+ mode is streaming replication mode (native replication and other modes
+ are fine). Solution is, if all nodes are down, force to restart all
+ pgpool child.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-20 [a38fa09]
+ -->
+ <para>
+ Fix for: [pgpool-general: 4997] Avoiding downtime when pgpool changes require a restart (Muhammad Usama)
+ </para>
+ <para>
+ To fix this, The verification mechanism of configuration parameter values is
+ reversed, previously the standby nodes used to verify their parameter values
+ against the respective values on the master pgpool-II node and when the
+ inconsistency was found the FATAL error was thrown, now with this commit the
+ verification responsibility is delegated to the master pgpool-II node.
+ Now the master node will verify the configuration parameter values of each
+ joining standby node against its local values and will produce
+ a WARNING message instead of an error in case of a difference.
+ This way the nodes having the different configurations will also be allowed to
+ join the watchdog cluster and the user has to manually look out for the
+ configuration inconsistency warnings in the master pgpool-II log to avoid the
+ surprises at the time of pgpool-II master switch over.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-13 [1c99580]
+ -->
+ <para>
+ Add compiler flag "-fno-strict-aliasing" in configure.ac to fix compiler error. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-09 [8231f65]
+ -->
+ <para>
+ Do not use random() while generating MD5 salt. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>random()</function> should not be used in security related applications. To
+ replace <function>random()</function>, import <function>PostmasterRandom()</function> from PostgreSQL. Also
+ store current time at the start up of <productname>Pgpool-II</productname> main process for later
+ use.
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-06 [891ce0f]
+ -->
+ <para>
+ Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
--- /dev/null
+<!-- doc/src/sgml/release-3.6.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id=release-3-6-24>
+ <title>Release 3.6.24</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-11-19</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-10-03 [cc11de6]
+ -->
+ <para>
+ Doc: mention that <acronym>GSSAPI</acronym> is not supported. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [bcb7167]
+ -->
+ <para>
+ <productname>Pgpool-II</productname> doesn't support <acronym>GSSAPI</acronym>.
+ Allow <productname>Pgpool-II</productname> to deal with <acronym>GSSAPI</acronym> encrypted connection request from frontend instead of responding with an error. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is created by me, reviewed and tested by Umar Hayat.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [94cbceb]
+ -->
+ <para>
+ Fix query rewrite syntax error of "INSERT ... ON CONFLICT" in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=654">bug 654</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-30 [79831b3]
+ -->
+ <para>
+ Fix connection counter was not counted down when query is canceled.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=656">bug 656</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-30 [af67e9b]
+ -->
+ <para>
+ Doc: fix usable versions of PostgreSQL to be 7.4 or later. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-23>
+ <title>Release 3.6.23</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-09-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-13 [824ef05]
+ -->
+ <para>
+ Follow the guide line of <productname>PostgreSQL</productname> 12.4 regarding extensions. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>CREATE OR REPLACE FUNCTION</command> should be avoided. Use <command>CREATE FUNCTION</command> instead.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-24 [f68e230]
+ -->
+ <para>
+ Replace "PGBIN" and "LPATH" in <xref linkend="PGPOOL-SETUP"> and <xref linkend="WATCHDOG-SETUP"> using PostgreSQL's bin path and lib path. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-16 [957d3b3]
+ -->
+ <para>
+ Doc: fix the incorrect description regarding the running modes of Pgpool-II in which online recovery is available. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-14 [bc35527]
+ -->
+ <para>
+ Remove unnecessary checks in some code path. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Hou, Zhijie.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-06 [2ebc8ac]
+ -->
+ <para>
+ Fix relcache query sometimes sent to other than primary. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, relcache queries are supposed to be
+ sent to the primary node. But actually they were not sent to the primary
+ node if primary node was not the master node. Typically this could
+ happen when the primary is not node 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-01 [87910d6]
+ -->
+ <para>
+ Fix <xref linkend="GUC-CONNECTION-LIFE-TIME"> not working when <xref linkend="GUC-SERIALIZE-ACCEPT"> is enabled. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-August/007233.html">[pgpool-general: 7175]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-30 [3dbb808]
+ -->
+ <para>
+ Display more informative error message in authentication process. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-21 [9ae9bee]
+ -->
+ <para>
+ Fix segfault in pgpool child process in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ This issue can be reproduced with the following steps:
+ <orderedlist>
+ <listitem>
+ <para>
+ Shutdown all backends.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Connect to pgpool with invalid client. I have used <command>pcp_attach_node</command> with pgpool's port number, not pcp's.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-22>
+ <title>Release 3.6.22</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-08-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [9de4de2]
+ -->
+ <para>
+ Doc: mention that <xref linkend="GUC-SSL-CIPHERS"> only affects to TLS 1.2 and lower. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [1437d3b]
+ -->
+ <para>
+ Doc: Improve the description of <xref linkend="GUC-WD-PRIORITY">. (Bo Peng)
+ </para>
+ <para>
+ Patch is provided by Kenichiro Tanaka.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [422336a]
+ -->
+ <para>
+ Add mention about <literal>hostssl/hostnossl</literal> to <filename>pool_hba.conf</filename> sample file. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-17 [44096e2]
+ 2020-07-16 [5115de1]
+ 2020-06-30 [8941202]
+ 2020-05-30 [6f128fc]
+ 2020-05-23 [dde82d3]
+ 2020-05-23 [7a73705]
+ 2020-07-28 [1e13a96]
+ -->
+ <para>
+ Doc: documentation improvements. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [1b57486]
+ -->
+ <para>
+ At pgpool startup, if pid file exists, truncate pid file to zero length before writing. (Bo Peng)
+ </para>
+ <para>
+ Patch is created by maliangzhu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [2e3048f]
+ -->
+ <para>
+ Doc: fix error in <xref linkend="GUC-FAILBACK-COMMAND"> parameter description. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [68b6b36]
+ -->
+ <para>
+ Fix <xref linkend="guc-connection-life-time"> does not work if primary node is not 0 in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [566a48e]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> problem with -r option and <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-31 [f8510a4]
+ -->
+ <para>
+ Change PCP <literal>UNIX_DOMAIN_PATH</literal> of RPM package to <filename>/var/run/postgresql</filename>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [0cc495d]
+ 2020-07-14 [24fb5d6]
+ -->
+ <para>
+ Fix query cache bugs. (Tatsuo Ishii)
+ </para>
+ <para>
+ If query cache is enable, when a table is updated, Pgpool-II should delete all the caches related to the table.
+ However, <command>EXPLAIN ANALYZE</command> and <acronym>CTE</acronym> with data-modifying SQLs
+ were mistakenly treated as normal read only query so that the query caches were not deleted.
+ </para>
+ <para>
+ Patch is created by Hou, Zhijie and modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-09 [1152b26]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang in a corner case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-26 [28e2885]
+ -->
+ <para>
+ If there are parameters other than "user", "database" and "application_name", reading startup packet failed. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-22 [3525bc2]
+ -->
+ <para>
+ Fix miscount of connections when <function>pg_terminate_backend()</function> is executed. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-04 [9873af0]
+ -->
+ <para>
+ Fix segmentation fault when application name is included in <xref linkend="GUC-LOG-LINE-PREFIX">. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=615">bug 615</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-02 [1bdaccf]
+ -->
+ <para>
+ Fix incorrectly performing failover when <function>pg_terminate_backend()</function> is executed in native replication mode. (Takuma Hoshiai)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-21>
+ <title>Release 3.6.21</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-05-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-05-16 [2fd983b]
+ 2020-04-26 [1304dcc]
+ -->
+ <para>
+ Fix build error on some system (Fedora 32). (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [1221a65]
+ -->
+ <para>
+ Fix unnecessary checks. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by sherlockcpp. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007062.html">[pgpool-general: 7004]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [8ea84b9]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Umar Hayat. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-April/003587.html">[pgpool-hackers: 3587]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-16 [75432c0]
+ -->
+ <para>
+ Fix for segmentation fault in PCP process. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=598">bug 598</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-12 [237793e]
+ 2020-04-06 [225290a]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii, Bo Peng)
+ </para>
+ <para>
+ Patch provided by sherlockcpp.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-11 [a639141]
+ -->
+ <para>
+ Fix possible data inconsistency in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussions:
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-March/006954.html">[pgpool-general: 6896]</ulink>
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-March/003540.html">[pgpool-hackers: 3540]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-06 [5ce6273]
+ -->
+ <para>
+ Fix watchdog ping probes fail with long hostnames due to small buffer. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=516">bug 516</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-20>
+ <title>Release 3.6.20</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-02-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-01-28 [d60e6b7]
+ -->
+ <para>
+ Check if socket file exists at startup and remove them if PID file doesn't exist to avoid bind() failure. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-02-18 [8b9eb65]
+ -->
+ <para>
+ Fix incorrect query rewriting in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=551">bug 551</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-18 [c5df050]
+ 2020-02-04 [8d2949a]
+ -->
+ <para>
+ Doc: Update documentation and fix documentation typos. (Takuma Hoshiai, Tatsuo Ishii, Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-08 [0a5e38e]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to support <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-11 [2f5c9a2]
+ 2020-01-10 [d1d490f]
+ 2020-01-04 [78364ae]
+ 2019-12-31 [0591a76]
+ 2019-12-27 [d4365d8]
+ 2019-12-26 [a308b49]
+ -->
+ <para>
+ Fix occasional regression test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-12-12 [dc4f169]
+ -->
+ <para>
+ Fix replication delay worker segfault when application_name in primary_conninfo is an empty string.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=565">bug 565</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-11-18 [3a19033]
+ 2019-11-15 [0cc9caf]
+ -->
+ <para>
+ Fix the bug with ignored syslog setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-19>
+ <title>Release 3.6.19</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-10-25 [45a3469]
+ -->
+ <para>
+ Fix incorrect query rewrite in replication mode. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-15 [339bd21]
+ -->
+ <para>
+ Doc: add <xref linkend="guc-failover-command"> description when all standby nodes are down. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-11 [32a9f5d]
+ -->
+ <para>
+ Doc: add note not to assign <productname>PostgreSQL</productname> servers to <xref linkend="guc-trusted-servers">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-10 [4b726df]
+ -->
+ <para>
+ Fix assorted ancient v2 protocol bugs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-08 [45ac39b]
+ -->
+ <para>
+ Fix problem that <xref linkend="guc-syslog-facility"> doesn't change by reload.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=548">bug 548</ulink>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-03 [fed3d6b]
+ -->
+ <para>
+ Fix Pgpool-II shutdown failed in certain case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-29 [94b96ed]
+ -->
+ <para>
+ Allow the lost standby node to rejoin the master watchdog node when it gets rediscovered by the lifecheck.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=545">bug 545</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-15 [a333a45]
+ -->
+ <para>
+ Fix segfault when executing an erroneous query after DEALLOCATE a named statement.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=546">bug 546</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-04 [3ba4e73]
+ -->
+ <para>
+ Doc: mention that VIP will not be brought up if quorum does not exist. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-16 [956c040]
+ -->
+ <para>
+ Add "-I" option to <xref linkend="guc-arping-cmd"> command default setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-18>
+ <title>Release 3.6.18</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-08-15</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-08-08 [94b0ce1]
+ -->
+ <para>
+ Import some of memory manager debug facilities from <productname>PostgreSQL</productname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-07-24 [d3493f7]
+ -->
+ <para>
+ Use <function>pg_get_expr()</function> instead of <literal>pg_attrdef.adsrc</literal> to support for <productname>PostgreSQL</productname> 12. (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-08-11 [c553e51]
+ 2019-08-08 [94364ad]
+ 2019-07-17 [5730d28]
+ 2019-07-02 [b364caa]
+ -->
+ <para>
+ Enhance shutdown script of <xref linkend="PGPOOL-SETUP">. (Tatsuo Ishii)
+ <itemizedlist>
+ <listitem>
+ <para>
+ Make shutdownall to wait for completion of shutdown of <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If environment variable <varname>CHECK_TIME_WAIT</varname> is set to true, use <command>netstat</command> command to confirm usage of the <literal>TCP/IP</literal> port while executing shutdown script.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-06-02 [45f0160]
+ -->
+ <para>
+ Doc: add description to <xref linkend="PG-MD5"> man page how to show <filename>pool_passwd</filename> hashed string. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-26 [e21e7a9]
+ -->
+ <para>
+ Doc: add general description about failover. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-05-22 [57cd1d4]
+ -->
+ <para>
+ Deal <literal>pgpool_adm</literal> extension with <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-08-09 [c896d21]
+ -->
+ <para>
+ Fix "unable to bind. cannot get parse message" error.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=531">bug 531</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-08 [0da5292]
+ -->
+ <para>
+ Fix online-recovery is blocked after a child process exits abnormally with replication mode and watchdog.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=483">bug 483</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-29 [9b830d9]
+ -->
+ <para>
+ Fix <xref linkend="WATCHDOG-SETUP"> command <literal>mode</literal> option to work correctly. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-28 [fbe8fdc]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to produce correct follow master command. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [44f8e2d]
+ -->
+ <para>
+ Fix query cache module so that it checks oid array's bound. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [ae45e93]
+ -->
+ <para>
+ Fix off-by-one error in query cache module. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-05 [27c2476]
+ -->
+ <para>
+ Allow health check process to reload. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-03 [380d8a5]
+ -->
+ <para>
+ Fix segfault when query cache is enabled. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=525">bug 525</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-02 [b8137d6]
+ -->
+ <para>
+ Down grade LOG "checking zapping sent message ..." to DEBUG5. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006678.html">[pgpool-general: 6620]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-24 [057a635]
+ -->
+ <para>
+ Fix segfault when <literal>samenet</literal> is specified in <filename>pool_hba.conf</filename>. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006659.html">[pgpool-general: 6601]</ulink>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-20 [957e3f8]
+ 2019-06-19 [79ae3f7]
+ -->
+ <para>
+ Doc: Fix document typos. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-07 [9d7c5ba]
+ -->
+ <para>
+ Fix to deal with backslashes according to the config of <varname>standard_conforming_strings</varname> in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=467">bug 467</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [81b9c11]
+ -->
+ <para>
+ Fix compile error on FreeBSD.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=512">bug 512</ulink>,
+ <ulink url="https://www.pgpool.net/mantisbt/view.php?id=519">bug 519</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-14 [0d6fdbc]
+ 2019-05-23 [0e8c1c2]
+ 2019-05-22 [c264275]
+ 2019-05-22 [53e7af0]
+ 2019-05-22 [19cfda2]
+ -->
+ <para>
+ Fix memory leaks. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [827a056]
+ -->
+ <para>
+ Make failover in progress check more aggressively to avoid potential segfault. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-17>
+ <title>Release 3.6.17</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-05-16</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-04 [02962d8]
+ -->
+ <para>
+ Doc: Improve <xref linkend="PCP-COMMANDS"> document. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-03 [a0952b7]
+ -->
+ <para>
+ Speed up failover when all of backends are down. (Tatsuo Ishii)
+ </para>
+ <para>
+ If all of the backend are in down status, immediately give up finding
+ primary node regardless search_primary_node_timeout and promptly
+ finish the failover process.
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-May/003321.html">[pgpool-hackers: 3321]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-30 [e7c925f]
+ 2019-04-30 [b60e726]
+ -->
+ <para>
+ pgpool-recovery extension and <command>pgpool_setup</> is now ready for the next major release <productname>PostgreSQL</> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-04-10 [c845e30]
+ 2019-04-09 [5d2078b]
+ -->
+ <para>
+ Doc: add <xref linkend="RESTRICTIONS"> entry. (Takuma Hoshiai)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-09 [5ec997d]
+ -->
+ <para>
+ Fix the wrong error message "ERROR: connection cache is full", when all backend nodes are down.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=487">bug 487</>) (Bo Peng)
+ </para>
+ <para>
+ When all backend nodes are down, <productname>Pgpool-II</> throws an incorrect
+ error message "ERROR: connection cache is full". Change the error
+ message to "all backend nodes are down, pgpool requires at least one valid node".
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-24 [9898f82]
+ -->
+ <para>
+ Remove unused .sgml file. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-21 [90238be]
+ -->
+ <para>
+ Avoid exit/fork storm of pool_worker_child process. (Tatsuo Ishii)
+ </para>
+ <para>
+ pool_worker_child issues query to get WAL position using <function>do_query()</>,
+ which could throws FATAL error. In this case pool_worker_child process
+ exits and <productname>Pgpool-II</> parent immediately forks new process. This cycle
+ indefinitely repeats and gives high load to the system.
+ To avoid the exit/fork storm, sleep <varname>sr_check_period</>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-18 [f3742eb]
+ -->
+ <para>
+ Fix <xref linkend="GUC-WRITE-FUNCTION-LIST">'s broken default value. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-17 [4f2c299]
+ -->
+ <para>
+ Fix "not enough space in buffer" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=499">bug 499</>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The error occurred while processing error message returned from
+ backend and the cause is that the query string in question is too
+ big. Problem is, the buffer is in fixed size (8192 bytes).
+ Eliminate the fixed size buffer and use palloced buffer
+ instead. This also saves some memory copy work.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-16 [d037d82]
+ -->
+ <para>
+ Fix DROP DATABASE failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-10 [98f0f4d]
+ -->
+ <para>
+ Fix wrong variable in <function>read_status_file()</> function.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=493">bug 493</>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-08 [0425c2e]
+ -->
+ <para>
+ Add missing <filename>test/watchdog_setup</> to EXTRA_DIST. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=470">bug 470</>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-07 [a613206]
+ -->
+ <para>
+ Doc: mention that multi-statement queries are sent to primary node only. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=492">bug 492</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-02 [ab34ba7]
+ -->
+ <para>
+ Abort session if failover/failback is ongoing to prevent potential segfault.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=481">bug 481</ulink>,
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=482">bug 482</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-30 [508f1c4]
+ 2019-03-30 [ae4ecbb]
+ -->
+ <para>
+ Fix compiler warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-28 [67d08ab]
+ -->
+ <para>
+ Fix memory leak in "batch" mode in extended query.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=468">bug 468</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-16>
+ <title>Release 3.6.16</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-03-29</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-27 [85267e7]
+ -->
+ <para>
+ Add new configuration option <xref linkend="guc-ssl-prefer-server-ciphers">. (Muhammad Usama)
+ </para>
+ <para>
+ Add the new setting <xref linkend="guc-ssl-prefer-server-ciphers"> to let users configure if they
+ want client's or server's cipher order to take preference.
+ </para>
+ <para>
+ The default for this parameter is off, which prioritize the client's
+ cipher order as usual. However this is just for keeping backward
+ compatibility, and it is possible that a malicious client uses weak
+ ciphers. For this reason we recommend to set this parameter to on at
+ all times.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-27 [a5c9df7]
+ 2019-03-23 [c9ac35d]
+ -->
+ <para>
+ Allow to set a client cipher list. (Tatsuo Ishii, Yugo Nagata)
+ </para>
+ <para>
+ For this purpose new parameter <xref linkend="guc-ssl-ciphers">, which specifies the cipher
+ list to be accepted by <productname>Pgpool-II</>, is added.
+ This is already implemented in <productname>PostgreSQL</> and useful to enhance security when SSL is enabled.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-18 [ca4cd88]
+ -->
+ <para>
+ Fix unnecessary <function>fsync()</> to <filename>pgpool_status</> file. (Tatsuo Ishii)
+ </para>
+ <para>
+ Whenever new connections are created to PostgreSQL backend, <function>fsync()</>
+ was issued to <filename>pgpool_status</> file, which could generate excessive I/O
+ in certain conditions.
+ So reduce the chance of issuing <function>fsync()</> so that it is issued only when
+ backend status is changed.
+ </para>
+ <para>
+ Discussion: <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-February/006494.html">[pgpool-general: 6436]</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-15>
+ <title>Release 3.6.15</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-02-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-02-15 [84e0496]
+ -->
+ <para>
+ Test: Fix old JDBC functions and typos in regression test 068.memqcache_bug. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-15 [8ae3dfa]
+ -->
+ <para>
+ Doc: Fix configuration change timing regarding <xref linkend="GUC-MEMORY-CACHE-ENABLED">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-12 [3aac064]
+ -->
+ <para>
+ Fix online recovery failed due to <xref linkend="GUC-CLIENT-IDLE-LIMIT-IN-RECOVERY"> in certain cases.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=431">bug 431</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-29 [f7d0c96]
+ -->
+ <para>
+ Fix corner case bug when <function>strip_quote()</function> handle a empty query string. <ulink url="http://www.pgpool.net/mantisbt/view.php?id=458">(bug 458</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-27 [d6b4f02]
+ -->
+ <para>
+ Doc: Mention that schema qualifications cannot be used in white/black_function_list. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-23 [76ac6bb]
+ -->
+ <para>
+ Fix typo about wd_priority in <command>watchdog_setup</command>. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-10 [776ee0a]
+ -->
+ <para>
+ Fix Pgpool child segfault if failover occurs when trying to establish a connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-03 [79ef2b0]
+ -->
+ <para>
+ Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-12 [733852e]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang if a client sends a extended query message such as close after sync message but before next simple query. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-December/003164.html">[pgpool-hackers: 3164]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-06 [f8f8e3d]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when <varname>idle_in_transaction_session_timeout = on</varname>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=448">bug 448</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-12-05 [6a37de1]
+ -->
+ <para>
+ Doc: Fix Japanese document typo in <xref linkend="PCP-COMMON-OPTIONS">. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-6-14>
+ <title>Release 3.6.14</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-11-22</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-11-21 [de263d9]
+ -->
+
+ <para>
+ Fix to sort startup packet's parameters sent by client.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=444">bug 444</ulink>)(Takuma Hoshiai)
+ </para>
+ <para>
+ If order of startup packet's parameters differ between cached connection
+ pools and connection request, didn't use connection pool ,and created new
+ connection pool.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-13 [b502d75]
+ -->
+
+ <para>
+ Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=443">bug 443</ulink>)(Bo Peng)
+ </para>
+ <para>
+ If the number of parameter format codes is specified to one, but the number
+ of the original query's parameter is zero, <function>bind_rewrite_timestamp()</>
+ will call <function>memcpy</> with a negative value.
+ This causes segmentation fault.
+ </para>
+ <para>
+ Patch is provided by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-08 [24189a1]
+ -->
+
+ <para>
+ Fix a query passed to relcache so that it uses schema qualified table name. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-05 [75560b6]
+ -->
+
+ <para>
+ Fix query cache invalidation bug. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-03 [974ce02]
+ -->
+
+ <para>
+ Fix segfault in extended query + query cache case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-01 [96cc513]
+ -->
+ <para>
+ Fix memory leak in extended query + query cache enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-13">
+ <title>Release 3.6.13</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-30 [3d0311b]
+ -->
+ <para>
+ Allow <command>PCP[attach/detach/promote]</command> commands during failover. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [8042f5c]
+ -->
+ <para>
+ Change <filename>pgpool.spec</filename> file to install extension to DB server which supports LLVM JIT. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-10 [d184ab3]
+ -->
+ <para>
+ Doc: Add note to online recovery doc. (Tatsuo Ishii)
+ </para>
+ <para>
+ This warns that <xref linkend="guc-client-idle-limit-in-recovery"> must be smaller than <xref linkend="guc-recovery-timeout">.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-29 [ad930c8]
+ -->
+ <para>
+ Test: Add regression test for SSL connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-22 [23c555a]
+ -->
+ <para>
+ Doc: Add notes regarding failover script. (Tatsuo Ishii)
+ </para>
+ <para>
+ It's not recommended to access against <productname>Pgpool-II</productname> itself from failover/failback scripts.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-14 [dce5116]
+ -->
+ <para>
+ Doc: Improve <xref linkend="PG-MD5"> docs and error message. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen and modified by me.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [a0b5106]
+ -->
+ <para>
+ Test: Add definition of PGLIB in <filename>regress.sh</filename>. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-25 [f043360]
+ -->
+ <para>
+ Fix typo in <varname>child_max_connections</varname> description of <command>SHOW POOL_STATUS</command> output. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Phil Ramirez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-22 [e57e9d8]
+ -->
+ <para>
+ Fix segmentation fault when error query and Sync message are sent in native replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=434">bug 434</ulink>) (Takuma Hoshiai)
+ </para>
+ <para>
+ In native replication mode, segmentation fault occurs when Sync messages is sent just after a query error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [b656944]
+ -->
+ <para>
+ Fix syntax error when queries including time functions and <literal>IN (SELECT ...)</literal> in
+ <literal>WHERE</literal> clause in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=433">bug 433</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In native replication mode, queries including time functions (e.g. <function>now()</function>, <function>CURRENT_TIMESTAMP</function> etc.) are rewritten to a timestamp constant value.
+ However, <productname>Pgpool-II</productname> doesn't support queries including time functions and <literal>IN (SELECT ...)</literal> in <literal>WHERE</literal> clause.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-12 [f1b6572]
+ -->
+ <para>
+ Fix occasional less data returned to frontend with extended protocol. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=432">bug432</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The idea for fix is, use pending message data list. It records
+ messages from frontend, and it is expected that we will receive same
+ number of messages.
+ </para>
+ <para>
+ Initial patch is created by Yugo Nagata and fixed by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [4d6371a]
+ -->
+ <para>
+ Fix memory leak when query cache enabled in streaming replication mode + extended query case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [88f63b0]
+ -->
+ <para>
+ Fix memory leak in <function>trigger_failover_command()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [eee60a0]
+ -->
+ <para>
+ Fix memory leak when memory_cache_enabled = on and write SQLs are sent. (Bo Peng)
+ </para>
+ <para>
+ In a explicit transaction, the <literal>SELECT</literal> results are cached in temporary buffer.
+ If a write <acronym>SQL</acronym> is sent which modifies the table, the temporary buffer should be reset.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [6406b3b]
+ -->
+ <para>
+ Fix occasional failure in regression 065.bug152. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-21 [3a56b21]
+ -->
+ <para>
+ Test: Add <literal>EXECUTE/DEALLOCATE</literal> regression test. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-19 [e3cd328]
+ -->
+ <para>
+ Add missing <filename>pgpool_recovery--1.0--1.1.sql</filename> file to update
+ <function>pgpool_recovery()</function> function version to 1.1. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-13 [4bdf973]
+ -->
+ <para>
+ Fix kind mismatch error when <literal>DEALLOCATE</literal> statement is issued. (Bo Peng)
+ </para>
+ <para>
+ <literal>PREPARE</literal> should be add to pool_add_sent_message,
+ so that <literal>EXECUTE</literal> and <literal>DEALLOCATE</literal>
+ can be sent to the same node as <literal>PREPARE</literal>.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-September/006284.html">[pgpool-general: 6226]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-27 [75feb8c]
+ -->
+ <para>
+ Do not update <xref linkend="guc-pool-passwd"> if the password length is incorrect.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=419">bug 419</ulink>) (Takuma Hoshiai, Tatsuo Ishii)
+ </para>
+ <para>
+ For <productname>Pgpool-II</productname> 3.7 or before, the password stored in
+ <xref linkend="guc-pool-passwd"> is <literal>MD5</literal> password only.
+ So check the correctness of <xref linkend="guc-pool-passwd"> by scanning entire file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-20 [900afee]
+ -->
+ <para>
+ Doc: Change <xref linkend="GUC-FOLLOW-PRIMARY-COMMAND"> description "new master" to "new primary". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-16 [c7990a9]
+ -->
+ <para>
+ Fix newer version of gcc warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [58db070]
+ -->
+ <para>
+ Test: Update <filename>clean.sh</filename> which clean up regression test results. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [96e740f]
+ -->
+ <para>
+ Add .gitignore files. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-05 [129566a]
+ -->
+ <para>
+ Fix segfault when node 0 is in down status in case of both health check
+ and <xref linkend="guc-failover-on-backend-error"> are disabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-03 [c7f1aab]
+ -->
+ <para>
+ Doc: Fix typos in documents and scripts. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-01 [861d535]
+ -->
+ <para>
+ Doc: Fix document mistakes of <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> and <xref linkend="GUC-RECOVERY-2ND-STAGE-COMMAND">. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-12">
+ <title>Release 3.6.12</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-07-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-07-04 [06a1d33]
+ -->
+ <para>
+ Fix "write on backend 0 failed with error :"Success"" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=403">bug 403</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Don't treated it as an error if <function>write()</function> returns 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-03 [7f9aad9]
+ -->
+ <para>
+ Fix for 0000409: worker process is not restarted after failover on standby.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=409">bug 409</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ Patch contributed by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-20 [9956328]
+ -->
+ <para>
+ Fix memory leaks related to <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [8aadbd3]
+ -->
+ <para>
+ Fix an incorrect declare as bool, rather than int in <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ This led to a segfault issue mentioned on certain platform.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [ff2260f]
+ -->
+ <para>
+ Fix segfault in <function>per_node_error_log()</function> on armhf architecture. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Christian Ehrhardt.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-24 [68f9645]
+ -->
+ <para>
+ Doc: Improve documents of "MD5 Password Authentication", "Installing Pgpool-II" and "pg_md5".(Bo Peng)
+ </para>
+ <para>
+ Patch provided by Takuma Hoshiai.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-20 [7c4aff8]
+ 2018-07-11 [893b1ef]
+ -->
+ <para>
+ Test: Fix 006.memqcache test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-11">
+ <title>Release 3.6.11</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-06-12</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-05-31 [abb1260]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hung if replication delay is too much, when query cache enabled in extended query mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general-jp/2018-May/001533.html">[pgpool-general-jp: 1534]</ulink>
+ for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-30 [8574062]
+ -->
+ <para>
+ Doc: Fix document typo of PCP commands option "-U". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-24 [75348b5]
+ -->
+ <para>
+ Delete some debug code. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-24 [b28ae33]
+ -->
+ <para>
+ In extended query mode, do not set writing tx flag with SET TRANSACTION READ ONLY. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-09 [eb427b7]
+ -->
+ <para>
+ Doc: Update outdated <xref linkend="PCP-PROC-INFO"> manual. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-04 [5231624]
+ -->
+ <para>
+ Doc: Enhance online recovery document to Clarify
+ that <xref linkend="guc-recovery-2nd-stage-command"> is only required in native replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-18 [53a5b1a]
+ -->
+ <para>
+ Prevent <xref linkend="PCP-RECOVERY-NODE"> from recovering "unused" status node. (Tatsuo Ishii)
+ </para>
+ <para>
+ This allowed to try to recovery a node without configuration data,
+ which leads to variety of problems.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-March/006021.html">[pgpool-general: 5963]</ulink>
+ for more details.
+ </para>
+ <para>
+ Also I fixed <function>pgpool_recovery</function> function so that it quotes an
+ empty string argument with double quotes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-10">
+ <title>Release 3.6.10</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-04-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-04-09 [56dcc8d]
+ -->
+ <para>
+ Test: Add new regression test for node 0 is down. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-08 [62cd287]
+ -->
+ <para>
+ Make calls to to_regclass fully schema qualified. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-04 [61dbb77]
+ -->
+ <para>
+ Doc: Improve watchdog documents. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-20 [a144e9a]
+ -->
+ <para>
+ Test: Improve test script 003.failover. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-14 [95ed081]
+ -->
+ <para>
+ Deal with "unable to bind D cannot get parse message "S1" error. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-02 [426c2df]
+ -->
+ <para>
+ Doc: Mention that users can avoid failover using backend_flag even PostgreSQL admin shutdown. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-28 [3cc5422]
+ -->
+ <para>
+ Doc: Fix document typos. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [bfb46bc]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> failure in replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [4a47d33]
+ -->
+ <para>
+ Allow to support <function>pgpool_switch_xlog</function> <productname>PostgreSQL</productname> 10. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-14 [41978bf]
+ -->
+ <para>
+ Doc: Fix <link linkend="pgpool-adm"> pgpool_adm</link> family functions examples. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-9">
+ <title>Release 3.6.9</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-02-13</simpara>
+ </note>
+ <note>
+ <para>
+ This release fixed the bug with socket writing added in Pgpool-II 3.7.0, 3.6.6 and 3.5.10. Due to this bug, when the network load is high, an illegal message may be sent to the frontend or backend. All users using 3.7.x, 3.6.6 or later, 3.5.10 or later versions of Pgpool-II should update as soon as possible.
+ </para>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-02-10 [8a6e181]
+ -->
+ <para>
+ Allow to build with <literal>libressl</>. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-February/002714.html">[pgpool-hackers: 2714]</ulink> for more details. Patch by Sandino Araico Sanchez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [6d83d12]
+ -->
+ <para>
+ Set TCP_NODELAY and non blocking to frontend socket. (Tatsuo Ishii)
+ </para>
+ <para>
+ TCP_NODELAY is employed by <productname>PostgreSQL</>, so do we it.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [cc4b56c]
+ -->
+ <para>
+ Change systemd service file to use <varname>STOP_OPTS=" -m fast"</>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [b083cdc]
+ -->
+ <para>
+ Change <command>pgpool_setup</> to add restore_command in <filename>recovery.conf</>. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-02-09 [fc1a744]
+ -->
+ <para>
+ Fix writing transaction flag is accidentally set at commit or rollback. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-31 [114632b]
+ -->
+ <para>
+ Doc: Fix document typos. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [361b9da]
+ -->
+ <para>
+ Fix bug with socket writing. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>pool_write_flush()</function> is responsible for writing to sockets when pgpool's
+ write buffer is full (this function was introduced in 3.6.6 etc). When
+ network write buffer in kernel is full, it does retrying but it forgot
+ to update the internal buffer pointer. As a result, broken data is
+ written to the socket. This results in variety of problems including
+ too large message length.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-24 [29bd679]
+ -->
+ <para>
+ Fix segfault when %a is in <varname>log_line_prefix</> and debug message is on. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=376">bug 376</ulink>) (Tatsuo Ishii)
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-18 [235b9a6]
+ -->
+ <para>
+ Fix queries hanging in <function>parse_before_bind</> with extended protocol and replication + load-balancing. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=377">bug 377</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-8">
+ <title>Release 3.6.8</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-01-09</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-01-06 [f355084]
+ 2017-12-21 [b34623e]
+ -->
+ <para>
+ Doc: Fix document typo and mistakes. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-22 [5c6922f]
+ -->
+ <para>
+ Replace <command>/bin/ed</command> with <command>/bin/sed</command> in <xref linkend="pgpool-setup">, because <command>/bin/sed</command> is included in most distribution's base packages. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-21 [c963cb1]
+ -->
+ <para>
+ Change the <filename>pgpool.service</filename> and sysconfig files to output <productname>Pgpool-II</productname> log. (Bo Peng)
+ </para>
+ <para>
+ Removing "Type=forking" and add OPTS=" -n" to
+ run <productname>Pgpool-II</productname> with non-daemon mode, because we need to redirect logs.
+ Using <command>"journalctl"</command> command to see <productname>Pgpool-II</productname> systemd log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-19 [9c61ded]
+ -->
+ <para>
+ Add documentation <link linkend="install-docs">"Compiling and installing documents"</link> for SGML document build. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-17 [38e6a35]
+ 2017-12-18 [c74f4d4]
+ -->
+ <para>
+ Fix timestamp data inconsistency by replication mode. (Bo Peng)
+ </para>
+ <para>
+ From <productname>PostgreSQL</productname>10 the column
+ default value such as 'CURRENT_DATE' changes,
+ <productname>Pgpool-II</productname> didn't rewrite
+ timestamp by the added default values. This caused data inconsistency.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-14 [b959b35]
+ -->
+ <para>
+ Doc: Fix <xref linkend="watchdog-setup"> doc. (Tatsuo Ishii)
+ </para>
+ <para>
+ It lacked to mention that it supports logical replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-14 [7ac5acc]
+ -->
+ <para>
+ Downgrade a log message to debug message. (Tatsuo Ishii)
+ </para>
+ <para>
+ That was mistaken left while last development cycle.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [911d6e7]
+ -->
+ <para>
+ Fix for re-sync logic in reading packet from backend. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>read_kind_from_backend()</function>, which reads message kind
+ from backend, re-syncs backend nodes when a ready for query message is
+ received. Unfortunately it forgot to call
+ <function>pool_pending_message_pull_out()</function> to delete sync
+ pending message. This leads to random stuck while reading packets
+ from backend. Fix this to call <function>pool_pending_message_pull_out()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [921421c]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hangs. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=370">bug 370</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ If an erroneous query is sent to primary and without a sync message
+ the next query that requires a catalog cache look up is send,
+ <productname>Pgpool-II</productname> hangs in <function>do_query()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [6e51410]
+ -->
+ <para>
+ Add SL_MODE macro for upper compatibility with Pgpool-II 3.7 or later. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-10 [522dacd]
+ -->
+ <para>
+ Fix returning transaction state when "ready for query" message received. (Tatsuo Ishii)
+ </para>
+ <para>
+ We return primary or master node state of ready for query message to
+ frontend. In most cases this is good. However if other than primary
+ node or master node returns an error state (this could happen if load
+ balance node is other than primary or master node and the query is an
+ erroneous SELECT), this should be returned to frontend, because the
+ frontend already received an error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-11-16 [beade50]
+ -->
+ <para>
+ Fix pgpool start message printed multiple times. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-11-15 [11d506a]
+ -->
+ <para>
+ Add an execute permission bit to the start/stop script in <xref linkend="watchdog-setup">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-7">
+ <title>Release 3.6.7</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-11-01</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-10-31 [f652ec4]
+ -->
+ <para>
+ Add different <filename>pgpool.sysconfig</filename> file for RHEL6 and RHEL7. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=343">bug 343</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In RHEL6, the "-n" option is needed to redirect log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-25 [43e0994]
+ -->
+ <para>
+ Fixing an issue in the handling of <function>pg_terminate_backend()</function>. (Muhammad Usama)
+ </para>
+ <para>
+ In some cases <function>pg_terminate_backend()</function> can cause failover even when
+ the call is properly issued through <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-16 [f6ac530]
+ -->
+ <para>
+ Fix for bug in watchdog where sometime failover is not reliably performed. (Muhammad Usama)
+ </para>
+ <para>
+ Currently watchdog process only considers the node's watchdog state before
+ deciding if it can handle the failover and failover-locking requests.
+ </para>
+ <para>
+ But the problem with this technique is that, for the instance when the node has
+ announced itself as a master/coordinator of the cluster and is waiting for
+ the standby nodes to recognise it as a Master node. For that period of time
+ the watchdog state of the node is Master/coordinator, but it is yet not fully
+ capable of handling the failover and failover-locking requests.
+ </para>
+ <para>
+ So sometimes this leads to a situation where a failover is not reliably
+ performed in case when the failover request arrives while watchdog cluster
+ is in the process of electing a leader.
+ </para>
+ <para>
+ The fix for the above situation is to make sure that the node has fully acquired
+ the Master status before accepting the failover and failover-locking requests.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-10 [dc858b9]
+ -->
+ <para>
+ Fix bug with handling of 'H' (flush) message in streaming replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=345">bug 345</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ If user expects to read response right after 'H', <productname>Pgpool-II</productname> hangs. The
+ cause was, when 'H' received, extended query mode was reset and
+ pending message was not used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-04 [3dc6bc1]
+ -->
+ <para>
+ Doc: Fix <command>pcp_node_info</command> documents. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [21047aa]
+ -->
+ <para>
+ Fix bug mistakenly overriding global backend status right after failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-September/005786.html">[pgpool-general: 5728]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [2ead26d]
+ -->
+ <para>
+ Fix exit signal handlers to not call ereport. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2017-September/002545.html">[pgpool-hackers: 2545]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-11 [1349bec]
+ -->
+ <para>
+ Deal with OpenSSL 1.1. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-05 [288baea]
+ -->
+ <para>
+ Doc: Fix table about replicate_select behavior (Yugo Nagata)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-6">
+ <title>Release 3.6.6</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-09-05</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-09-02 [3a19f77]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hanging when error occurs in streaming replication mode and extended query. (Tatsuo Ishii)
+ </para>
+ <para>
+ If backend returns ERROR, <productname>Pgpool-II</productname> reads message from frontend until
+ a <literal>sync</literal> message is sent. Previous code assumed next message is <literal>sync</literal>.
+ However it is possible that more message coming before the <literal>sync</literal>
+ message, it's a low probability though. Fix it to continue reading
+ messages until the <literal>sync</literal> message is read.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-01 [b661a8b]
+ -->
+ <para>
+ Fix <varname>wd_authkey</varname> bug in that a request to add new node to the cluster is rejected by master. (Yugo Nagata)
+ </para>
+ <para>
+ This is a bug due to the implementation of 3.5.6 and 3.6.3.
+ </para>
+ <para>
+ This changed the definition of tv_sec that is used to check wd_authkey so
+ that this was affected by the clock of OS. So, if there is a lag between
+ two nodes' clocks, the wd_authkey check fails.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-01 [83c35ea]
+ -->
+ <para>
+ Test: Fix load balance test driver. (Tatsuo Ishii)
+ </para>
+ <para>
+ Some tests only for native replication mode was executed in streaming replication mode as well.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-31 [3914c90]
+ -->
+ <para>
+ Fix not working <literal>slony</literal> mode in extended query. (Tatsuo Ishii)
+ </para>
+ <para>
+ When response returned from backend, in progress flag was not reset in <literal>slony</literal> mode, which cause waiting for next message from backend in vain.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-29 [d7347f1]
+ -->
+ <para>
+ Fix ancient bug of stream write modules. (Tatsuo Ishii)
+ </para>
+ <para>
+ Fix bug with <function>pool_write_noerror()</function> when requested length exceeds remaining write buffer size. This could lead to a buffer overrun problem.
+ </para>
+ <para>
+ When write buffer is full, <function>pool_flush_it()</function> is called, which could write data to socket in the middle of message. To fix the problem directly write requested data if the write buffer is going to be full.
+ </para>
+ <para>
+ Enhance performance of <function>pool_unread()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-24 [03a221c]
+ -->
+ <para>
+ Test: Some miscellanies small fixes in regression test scripts. (Muhammad Usama)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-24 [62275b5]
+ -->
+ <para>
+ Doc: Fix documentation about load-balancing. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-16 [1793074]
+ -->
+ <para>
+ Fix core dump and mishandling of temp tables. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-15 [da75d24]
+ -->
+ <para>
+ Fix ancient bug of <function>pool_unread()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ When <function>realloc()</function> is called in <function>pool_unread()</function>, it did not update the
+ buffer size. This could cause variety of memory corruption and
+ unexpected data reading from backend. The reason why we did not found
+ that is, probably recently <productname>Pgpool-II</productname> starts extensively to use
+ <function>pool_unread()</function>.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-13 [55d1ed0]
+ -->
+ <para>
+ Fix handling of empty queries. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=328">bug 328</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ When empty query (empty string or all comment query) is sent, command
+ complete message was returned to frontend. This is not correct. An
+ empty query response should be returned to frontend.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-09 [730a545]
+ -->
+ <para>
+ Fix query cache bug with streaming replication mode and extended query case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [5fe66ad]
+ -->
+ <para>
+ Fix memory leak with streaming replication mode/extended query case. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=324">bug 324</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [bcbca37]
+ -->
+ <para>
+ Test: Fix Java program in 005.regression test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-03 [8f00811]
+ -->
+ <para>
+ Fix for when failover is triggered by worker process, it is possible that wrong DB node could failover. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=303">bug 303</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ This is due to the db_node_id member in the <varname>POLL_CONNECTION</varname> structure is not initialized in the process (in child process the member is properly initialized). To solve the problem, add new function <function>pool_set_db_node_id()</function> to set the structure member variable and call it inside <function>make_persistent_db_connection()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-31 [7469f45]
+ -->
+ <para>
+ Fix starting unnecessary transaction when <command>SET</command> command is issued. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [45e4df4]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-July/005679.html">[pgpool-general: 5621]</ulink> <function>Failover()</function> function should be executed with health check alarm disabled. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-27 [6881a5a]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hung up bug or other errors in error case in extended query in replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ And other fixes in this commit.
+ </para>
+ <para>
+ 1) Do not send intended error query to backend in streaming replication mode in <function>ErrorResponse3()</function>.
+ </para>
+ <para>
+ 2) Fix <function>pool_virtual_master_db_node_id()</function> to return the virtual_master_node_id only when query is in progress and query context exists.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-25 [431811b]
+ -->
+ <para>
+ Doc: Fix <productname>Pgpool-II</productname> document typo. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-20 [a9ada5c]
+ -->
+ <para>
+ Allow make dist to include <filename>pgpool.service</filename>. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-08-21 [1812a84]
+ -->
+ <para>
+ Doc: Add new English and Japanese documents of <link linkend="example-cluster">Pgpool-II + Watchdog Setup Example</link>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-09 [34890b2]
+ -->
+ <para>
+ Test: Add more memory leak regression tests. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-5">
+ <title>Release 3.6.5</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-07-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-07-07 [33fd84c]
+ -->
+ <para>
+ Fix for <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002400.html">[pgpool-hackers: 2400]</ulink> Garbage output (Muhammad Usama)
+ </para>
+ <para>
+ Mostly the log messages fixes and few code cleanups.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-29 [85392b8]
+ -->
+ <para>
+ Importing the latest changes in the <productname>MemoryManager API</productname> from <productname>PostgreSQL</productname> code. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-24 [2ad4abd]
+ -->
+ <para>
+ Fixing 0000306: Pgpool steals back MASTER status. <ulink url="http://www.pgpool.net/mantisbt/view.php?id=306">(bug 306)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-21 [045e516]
+ -->
+ <para>
+ Fixing <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-June/002390.html">[pgpool-hackers: 2390]</ulink>Problems with the relative paths in daemon mode (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-19 [16db1f1]
+ -->
+ <para>
+ Adjust function name change in <productname>PostgreSQL</productname> 10 dev head. (Tatsuo Ishii)
+ </para>
+ <programlisting>
+ pg_current_wal_location -> pg_current_wal_lsn
+ pg_last_wal_replay_location -> pg_last_wal_replay_lsn
+ </programlisting>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-09 [d9b0b83]
+ -->
+ <para>
+ Fix a possible hang with streaming replication and extended protocol. (Yugo Nagata)
+ </para>
+
+ <para>
+ This hang occurred under a certain condition. The following is an example.
+ </para>
+
+ <programlisting>
+ - pgpool.conf is configured so that all read queries are sent to the standby.
+ - First, issue a writing query in a transaction block
+ - After commiting the transaction, issue a select query.
+ - When processing the query, send Describe (statement) message just after Parse.
+ </programlisting>
+
+ <para>
+ Without using <productname>JDBC</productname>, we can reproduce the problem by <productname>pgproto</productname> with the following messages.
+ </para>
+
+ <programlisting>
+ 'Q' "DROP TABLE IF EXISTS test_tbl"
+ 'Y'
+ 'Q' "CREATE TABLE test_tbl(i int)"
+ 'Y'
+ 'Q' "INSERT INTO test_tbl VALUES(1)"
+ 'Y'
+
+ 'P' "" "BEGIN" 0
+ 'B' "" "" 0 0 0
+ 'E' "" 0
+ 'S'
+ 'Y'
+
+ 'P' "" "INSERT INTO test_tbl VALUES(1)" 0
+ 'B' "" "" 0 0 0
+ 'E' "" 0
+ 'S'
+ 'Y'
+
+ 'P' "" "COMMIT" 0
+ 'B' "" "" 0 0 0
+ 'E' "" 0
+ 'S'
+ 'Y'
+
+ 'P' "S_1" "SELECT * FROM test_tbl" 0
+ 'D' 'S' "S_1"
+ 'B' "C_1" "S_1" 0 0 0
+ 'E' "C_1" 0
+ 'S'
+ 'Y'
+
+ 'X'
+ </programlisting>
+
+ <para>
+ To fix it, <function>parse_before_bind()</function> should be called only if we are in a transaction block so that we can send <command>Bind</command> and <command>Execute</command> to the right backend.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-07 [204b08e]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when used by <productname>erlang</productname> applications. (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>Erlang</productname> client sends "Describe" message followed by "Flush". So the
+ backend returns "Row description." However <productname>Pgpool-II</productname> forgets to reset
+ the query in progress flag upon receiving "Row description" message,
+ then <productname>Pgpool-II</productname> keeps on waiting for response from backend. This is the
+ cause of erlang client hanging.
+ </para>
+ <para>
+ Fix is, just reset the query in progress flag upon receiving "Row
+ description" message. Same thing can be said to "no data" message.
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-June/005613.html">[pgpool-general: 5555]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-06-07 [e310167]
+ -->
+ <para>
+ Fix bug with sending bind message to wrong target node. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=314">bug 314</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [bc84c0b]
+ -->
+ <para>
+ Fix query cache hang when used by node.js. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-May/005569.html">[pgpool-general: 5511]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-28 [6e6b022]
+ -->
+ <para>
+ Deal with <productname>PostgreSQL</productname> 10 in streaming replication delay checking. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-27 [e4f37e4]
+ -->
+ <para>
+ Fix query cache memory leak. (Tatsuo Ishii)
+ </para>
+ <para>
+ Clearing cache buffers in case of no oid queries (like <command>BEGIN</command>,
+ <command>CHECKPOINT</command>, <command>VACUUM</command>, etc) should have been done, but it did not.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-23 [f1b8877]
+ -->
+ <para>
+ Fix extended query hang in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>errlang</productname> PostgreSQL API produces <command>Parse ('P')</command>, <command>Describe ('D')</command>,
+ <command>Flush ('H')</command>, <command>Bind ('B')</command>, and <command>Execute ('E')</command>. Notice the 'H' message (this
+ does not happen in <productname>JDBC</productname>. I suspect that's the reason why this problem
+ is not popular before). After that, <productname>Pgpool-II</productname> dropped the extended
+ query mode, it failed to find which backend to read data. Thus <productname>Pgpool-II</productname> simply tries to read all of backend which causes hang
+ because it may have not send a message to some of backends.
+ </para>
+ <para>
+ Solution is, after receiving the flush message set doing extended query flag.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-23 [512fbae]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2017-May/002354.html">[pgpool-hackers: 2354]</ulink> segfault with <command>pg_md5</command>. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [02ad737]
+ 2017-05-17 [6fe79be]
+ -->
+ <para>
+ Fix descriptions of <function>white/black_memcache_table_list</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ They are far from actual implementations.
+ </para>
+ <para>
+ See <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-May/005537.html">[pgpool-general: 5479]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-10 [c901024]
+ -->
+ <para>
+ Fix corner case bug in <productname>Pgpool-II</productname> starting up. (Tatsuo Ishii)
+ </para>
+ <para>
+ It is possible that a failover request is accepted before primary node
+ is searched. This leads <productname>Pgpool-II</productname> to a strange state: there's no
+ primary node if the failed node was a primary node (even if new
+ primary node exists as a result of promotion of existing standby).
+ </para>
+
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2017-May/002321.html">[pgpool-hackers: 2321]</ulink> for more details.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-4">
+ <title>Release 3.6.4</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-05-11</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-05-10 [c99e0fc]
+ -->
+ <para>
+ Fixing a few corner cases in the failover request handling of the watchdog. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-10 [ee0a415]
+ -->
+ <para>
+ Tightening up the watchdog cluster membership criteria. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-10 [54aa688]
+ -->
+ <para>
+ Enhance document for load balancing. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-08 [eb83f0b]
+ -->
+ <para>
+ Add node 0 failover test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-04 [2b0edb1]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> child process segfault reported in <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-May/002312.html">[pgpool-hackers: 2312]</ulink>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-6-3">
+ <title>Release 3.6.3</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-04-28</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-04-18 [b8eb551]
+ -->
+ <para>
+ Fix "show pool_cache" segfault when memcached is used.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=301">(Bug 301)</ulink> (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-14 [bedb509]
+ -->
+ <para>
+ Fix for some more code warnings. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-14 [8b25ca3]
+ -->
+ <para>
+ Fixing some annoying compiler warnings. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-14 [50fb9a4]
+ -->
+ <para>
+ Removing the function defined but not used warnings from pool_config_variable.c (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-14 [9007558]
+ -->
+ <para>
+ Removing the references of obsolete debug_level configuration parameter. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [7105243]
+ -->
+ <para>
+ Fixing a mistake in the watchdog code. (Muhammad Usama)
+ </para>
+ <para>
+ commit also adds some debug messages in the watchdog code.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [f5f42be]
+ -->
+ <para>
+
+ Fix for 0000299: Errors on the reloading of configuration.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=299">(Bug 299)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [32b7c6d]
+ 2017-04-11 [d47add6]
+ 2017-04-11 [02a6f45]
+ -->
+ <para>
+ Add pgpool_adm English and Japanese docs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-11 [a6cc0c9]
+ -->
+ <para>
+ Fix document indentation. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-11 [2997b3a]
+ -->
+ <para>
+ Fix for 0000289: Inconsistent backend state.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=289">(Bug 289)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-30 [be9d634]
+ -->
+ <para>
+ Enhancing the handling of split-brain scenario by the watchdog. (Muhammad Usama)
+ </para>
+ <para>
+ Previously, the watchdog cluster was used to call for re-election of the
+ master/coordinator node whenever the split-brain situation was detected. And
+ consequently every node was required to rejoin the watchdog network, Which was
+ essentially similar to the re-booting of the whole watchdog cluster.
+ </para>
+ <para>
+ The candidate for the master/coordinator node is selected on the following criteria.
+
+ </para>
+ <para>
+ 1-- When two watchdog nodes are claiming to be the cluster master, the master
+ node that has performed the escalation keeps the master status and the other
+ node is asked to step down.
+ </para>
+ <para>
+
+ 2-- If the conflict could not be resolved by the escalation status of the nodes,
+ The node which holds the quorum remains the master/coordinator.
+ </para>
+ <para>
+
+ 3-- If the quorum status of both contenders is also same. The node with higher
+ number of connected alive nodes get the preference.
+ </para>
+ <para>
+
+ 4-- Finally, if all above three yields no winner, the older master (The node
+ that has the coordinator status for longer duration) remains the master.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-21 [deaa822]
+ -->
+ <para>
+ Enhancing the watchdog internal command mechanism to handle multiple concurrent commands. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-07 [e989242]
+ -->
+ <para>
+ Fix compiler warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-06 [d87f93d]
+ -->
+ <para>
+ Comment out unsupported Java method in new JDBC drivers to prevent regression failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-05 [e5541d7]
+ -->
+ <para>
+ Downgrade parse before bind log message to debug1. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-04 [aa4e308]
+ 2017-04-04 [24d9770]
+ 2017-04-03 [7d8482a]
+ -->
+ <para>
+ Fix coverity warnings. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-31 [c4f816b]
+ -->
+ <para>
+ Fix for <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2017-March/005454.html">[pgpool-general: 5396]</ulink> pam ldap failure. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-31 [6899b7d]
+ -->
+ <para>
+ Mention that SQL type commands cannot be used in extended query mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-31 [9cd2f8a]
+ -->
+ <para>
+ Consider SHOW command as kind of a read query. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, if SHOW is issued then subsequent
+ SELECTs are sent to the primary node in an explicit transaction. This
+ is not a reasonable and unnecessary limitation.
+
+ Also fix hang when parse command returns error.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-30 [9aaec32]
+ -->
+ <para>
+ Fix memory leak problem caused by commit adcb636. (Tatsuo Ishii)
+ </para>
+ <para>
+ Commit adcb636 introduces "pending message queue". When a message
+ arrives, the info is added to the queue and a copy of object is
+ created at the same time, but forgot to free the object. Fix is,
+ creating a new function pool_pending_message_free_pending_message()
+ and call it after pool_pending_message_add(),
+ pool_pending_message_get() and pool_pending_message_pull_out().
+
+ Problem reported by Sergey Kim.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-29 [18f9501]
+ -->
+ <para>
+ Mega patch to fix "kind mismatch" (or derived) errors in streaming replication mode.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=271">(Bug 271)</ulink> (Tatsuo Ishii)
+ </para>
+ <para>
+ The errors are caused by wrong prediction in which (or both) database
+ node will send response to Pgpool-II. Previous implementation using
+ "sync map" are weak and sometimes fail in the prediction.
+
+ </para>
+ <para>
+ This patch introduces new implementation using "pending message
+ queue", which records all sent message to backends. The element of the
+ queue stores info regarding messages types
+ (parse/bind/execute/describe/close/sync), to which database node the
+ message was sent and so on. It's a simple FIFO queue. When a message
+ arrives from backend, by looking at the head of the "pending message
+ queue", it is possible to reliably predict what kind of message and
+ from which database node it will arrive. After receiving the message,
+ the element is removed from the queue.
+ </para>
+ <para>
+
+ I would like to thank to Sergey Kim, who has been helping me in
+ testing series of patches.
+
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/mantisbt/view.php?id=271">Bug 271</ulink>
+ and discussion in pgpool-hackers mailing list
+ <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-February/002043.html">[pgpool-hackers: 2043]</ulink> and
+ <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2017-March/002140.html">[pgpool-hackers: 2140]</ulink>
+ for more details.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-24 [c2a0cc5]
+ -->
+ <para>
+ Fix for 0000296: Pgpool v3.6.2 terminated by systemd because the service Type has been set to 'forking'.
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=296">(Bug 296)</ulink> (Muhammad Usama)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-6-2">
+ <title>Release 3.6.2</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-03-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-03-17 [ba1bcc3]
+ -->
+ <para>
+ Add "Wants=network.target" to pgpool.service file.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=294">bug 294</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-09 [1ddb7f1]
+ -->
+ <para>
+ Fix <link linkend="PCP-PROMOTE-NODE">pcp_promote_node</link> bug that fails promoting node 0. (Yugo Nagata)
+ </para>
+ <para>
+ The master node could not be promoted by pcp_promote_node with
+ the following error;
+ </para>
+
+ <programlisting>
+ FATAL: invalid pgpool mode for process recovery request
+ DETAIL: specified node is already primary node, can't promote node id 0
+ </programlisting>
+
+ <para>
+ In streaming replication mode, there is a case that Pgpool-II
+ regards the status of primary node as "standby" for some reasons,
+ for example, when pg_ctl promote is executed manually during
+ Pgpool-II is running, in which case, it seems to Pgpool-II
+ that the primary node doesn't exist.
+ </para>
+
+ <para>
+ This status mismatch should be fixed by pcp_promote_node, but when the node
+ is the master node (the first alive node), it fails as mentioned above.
+ </para>
+
+ <para>
+ The reason is as following. before changing the status, pcp_promote_node
+ checks if the specified node is already primary or not by comparing the
+ node id with PRIMARY_NODE_ID. However, if the primary doesn't exist from
+ Pgpool-II's view, PRIMARY_NODE_ID is set to 0, which is same as MASTER_NODE_ID.
+ Hence, when the master node is specified to be promoted, pcp_promote_node
+ is confused that this node is already primary and doesn't have to be
+ promoted, and it exits with the error.
+ </para>
+
+ <para>
+ To fix this, pcp_promote_node should check the node id by using
+ REAL_PRIMARY_NODE_ID, which is set -1 when the primary doesn't exist,
+ rather than PRIMARY_NODE_ID.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-28 [b1060bd]
+ 2017-01-10 [1e4e494]
+ 2017-02-09 [767eff3]
+ -->
+ <para>
+ Fix document error. (Tatsuo Ishii, Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [2b7217e]
+ -->
+ <para>
+ <productname>Pgpool-II</productname>should not perform ping test after bringing down the VIP. (Muhammad Usama)
+ </para>
+
+ <para>
+ This issue was reported by the reporter of
+ bug:[pgpool-II 0000249]: watchdog sometimes fails de-escalation
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-23 [7ed400b]
+ -->
+ <para>
+ Fix to release shared memory segments when <productname>Pgpool-II</productname>exits. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=272">bug 272</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-14 [c1cd41c]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2017-February/005373.html">[pgpool-general: 5315]</ulink> pg_terminate_backend (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-02-06 [8fa731a]
+ -->
+ <para>
+ Adding the missing ExecStop and ExecReload commands to the systemd service configuration file. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [6362ba6]
+ -->
+ <para>
+ Fix for 281: "segmentation fault" when execute <link linkend="PCP-ATTACH-NODE">pcp_attach_node</link>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=281">bug 281</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [fb58877]
+ -->
+ <para>
+ Fix load balancing bug in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ In an explicit transaction, any SELECT will be load balanced until
+ write query is sent. After writing query is sent, any SELECT should be
+ sent to the primary node. However if a SELECT is sent before a sync
+ message is sent, this does not work since the treatment of writing
+ query is done after ready for query message arrives.
+ </para>
+ <para>
+ Solution is, the treatment for writing query is done in executing the writing query as well.
+ </para>
+
+ <para>
+ The bug has been there since V3.5.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-30 [8371649]
+ -->
+ <para>
+ Fix yet another kind mismatch error in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [4f98bf0]
+ -->
+ <para>
+ Fix <function>do_query()</function>hangs after close message. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-27 [7512482]
+ -->
+ <para>
+ Fixing stack smashing detected. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=280">bug 280</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ It was a buffer overflow in <function>wd_get_cmd</function> function
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-19 [839a709]
+ -->
+ <para>
+ Fixing the issue with the watchdog process restart. (Muhammad Usama)
+ </para>
+ <para>
+ When the watchdog process gets abnormally terminated because of some problem
+ (e.g. Segmentation fault) the new spawned watchdog process fails to start and
+ produces an error "bind on ... failed with reason: Address already in use".
+ </para>
+ <para>
+ Reason is the abnormally terminating watchdog process never gets the time to
+ clean-up the socket it uses for IPC and the new process gets an error because
+ the socket address is already occupied.
+ </para>
+
+ <para>
+ Fix is, the Pgpool main process sets the flag in shared memory to mark the
+ watchdog process was abnormally terminated and at startup when the watchdog
+ process see that the flag is set, it performs the clean up of the socket file and
+ also performs the de-escalation (If the watchdog process was crashed when it
+ was master/coordinator node) if required before initializing itself.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-19 [779d029]
+ -->
+ <para>
+ Fix query cache bug reported in <ulink url="http://www.pgpool.net/pipermail/pgpool-general-jp/2017-January/001440.html">pgpool-general-jp:1441</ulink>. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode with query cache enabled, SELECT hangs
+ in the following scenario:
+ </para>
+
+ <programlisting>
+ 1) a SELECT hits query cache and returns rows from the query cache.
+ 2) following SELECT needs to search meta data and it hangs.
+ </programlisting>
+
+ <para>
+ In #1, while returning the cached result, it misses to call
+ pool_unset_pending_response(), which leave the pending_response flag
+ be set. In #2, do_query() checks the flag and tries to read pending
+ response from backend. Since there's no pending data in backend, it
+ hangs in reading data from backend.
+ </para>
+
+ <para>
+ Fix is, just call <function>pool_unset_pending_response()</function> in #1 to reset the
+ flag.
+ </para>
+
+ <para>
+ Bug report and fix provided by Nobuyuki Nagai.
+
+ New regression test item (068) added by me.
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-11 [29b61eb]
+ -->
+ <para>
+ Remove elog/ereport calls from signal handlers. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-December/001950.html">[pgpool-hackers: 1950]</ulink> for details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-10 [39d24e7]
+ -->
+ <para>
+ Fix bug failed to create INET domain socket in FreeBSD if listen_addresses = '*'.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=202">bug 202</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [8598d5a]
+ -->
+ <para>
+ Fix for 0000249: watchdog sometimes fails de-escalation. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=249">bug 249</ulink>) (Muhammad Usama)
+ </para>
+
+ <para>
+ The solution is to use the <function>waitpid()</function> system call without WNOHANG option.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-04 [bd92a11]
+ -->
+ <para>
+ Fix connection_life_time broken by authentication_timeout. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-28 [afebadf]
+ -->
+ <para>
+ Fix authentication timeout that can occur right after client connections. (Yugo Nagata)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+<sect1 id="release-3-6-1">
+ <title>Release 3.6.1</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-12-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-12-23 [4124e5e]
+ -->
+ <para>
+ Tightening up the watchdog security. (Muhammad Usama)
+ </para>
+
+ <para>
+ Now wd_authkey uses the HMAC SHA-256 hashing.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-22 [f8a157a]
+ -->
+ <para>
+ Add pgpool_adm extension in <productname>Pgpool-II</productname> RPM. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-20 [888ac16]
+ -->
+ <para>
+ Fix occasional segfault when query cache is enabled. (bug 263) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-20 [9274f82]
+ -->
+ <para>
+ Fix packet kind does not match error in extended protocol. (bug 231) (Tatsuo Ishii)
+ </para>
+ <para>
+ According to the bug231, the bug seem to bite you if all of
+ following conditions are met:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Streaming replication mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Load balance node is not node 0
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Extended protocol is used
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SELECT is executed, the statement is closed, then a
+ transaction command is executed
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The sequence of how the problem bites is:
+ <orderedlist>
+ <listitem>
+ <para>
+ SELECT executes on statement S1 on the load balance node 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Frontend send Close statement
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pgpool-II forward it to backend 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Frontend sends Parse, Bind, Execute of COMMIT
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pgpool-II forward it to backend 0 & 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Frontend sends sync message
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pgpool-II forward it to backend 0 & 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Backend 0 replies back Parse complete ("1"), while
+ backend 1 replies back close complete ("3") because of
+ #3.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Kind mismatch occurs
+ </para>
+ </listitem>
+ </orderedlist>
+
+ </para>
+ <para>
+ The solution is, in #3, let Pgpool-II wait for response from backend
+ 1, but do not read the response message. Later on Pgpool-II's state
+ machine will read the response from it before the sync message is sent
+ in #6. With this, backend 1 will reply back "1" in #8, and the kind
+ mismatch error does not occur.
+ </para>
+ <para>
+ Also, fix not calling pool_set_doing_extended_query_message() when
+ receives Close message. (I don't know why it was missed).
+ </para>
+ <para>
+ New regression test "067.bug231" was added.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-12-06 [336e932]
+ -->
+ <para>
+ Fix a race condition in a signal handler. (bug 265) (Tatsuo Ishii)
+ </para>
+ <para>
+ In child.c there's signal handler which calls elog. Since the signal
+ handler is not blocked against other signals while processing, deadlock
+ could occur in the system calls in the pgpool shutdown sequence. To
+ fix the problem, now the signal handler is blocked by using
+ POOL_SETMASK.
+ </para>
+ <para>
+ Ideally we should avoid calling elog in signal handlers though.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-11-24 [cc452ad]
+ -->
+ <para>
+ Fix wrong minimum configuration value for client_idle_limit_in_recovery. (bug 264) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-11-22 [94d9378]
+ -->
+ <para>
+ Allow to execute "make xslthtml" under doc.ja. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
+
+<sect1 id="release-3-6">
+ <title>Release 3.6</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2016-11-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Overview</title>
+
+ <para>
+ Major enhancements in <productname>Pgpool-II</productname> 3.6 include:
+ </para>
+
+ <!-- Items in this list summarize one or more items below -->
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Improve the behavior of failover. In the steaming
+ replication mode, client sessions will not be disconnected
+ when a failover occurs any more if the session does not use
+ the failed standby server. If the primary server goes down,
+ still all sessions will be disconnected. Also it is possible
+ to connect to <productname>Pgpool-II</productname> even if
+ it is doing health checking retries. Before all attempt of
+ connecting to <productname>Pgpool-II</productname> failed
+ while doing health checking retries.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ New PGPOOL SET command has been introduced. Certain
+ configuration parameters now can be changed on the fly in a
+ session.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Watchdog is significantly enhanced. It becomes more reliable
+ than previous releases.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Handling of extended query protocol (e.g. used by Java
+ applications) in streaming replication mode speeds up if
+ many rows are returned in a result set.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Import parser of PostgreSQL 9.6.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ In some cases pg_terminate_backend() now does not trigger a
+ failover.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Change documentation format from raw HTML to SGML.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ The above items are explained in more detail in the sections below.
+ </para>
+
+ </sect2>
+
+ <sect2>
+ <title>Major Enhancements</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-04-17 [259cdf9] Do not restart child process if certain conditions met
+ 2016-04-21 [9cc243a] Minimize the chance of session disconnection while failover
+ 2016-05-05 [0d66032] Allow to access to pgpool while doing health checking
+ -->
+ <para>
+ Improve the behavior of failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ In the steaming replication mode, client sessions will not
+ be disconnected when a failover occurs any more if the
+ session does not use the failed standby server. If the
+ primary server goes down, still all sessions will be
+ disconnected. Health check timeout case will also cause the
+ full session disconnection. Other health check error,
+ including retry over case does not trigger full session
+ disconnection.
+ </para>
+
+ <para>
+ For user's convenience, "show pool_nodes" command shows the
+ session local load balance node info since this is important
+ for users in case of failover. If the load balance node is
+ not the failed node, the session will not be affected by
+ failover.
+ </para>
+
+ <para>
+ Also now it is possible to connect
+ to <productname>Pgpool-II</productname> even if it is doing
+ health checking retries. Before all attempt of connecting
+ to <productname>Pgpool-II</productname> failed while doing
+ health checking retries. Before any attempt to connect to
+ <productname>Pgpool-II</productname> fails if it is doing a
+ health check against failed node even if
+ <xref linkend="guc-failover-on-backend-error"> is off
+ because <productname>Pgpool-II</productname> child first
+ tries to connect to all backend including the failed one and
+ exits if it fails to connect to a backend (of course it
+ fails). This is a temporary situation and will be resolved
+ once pgpool executes failover. However if the health check
+ is retrying, the temporary situation keeps longer depending
+ on the setting
+ of <xref linkend="guc-health-check-max-retries"> and
+ <xref linkend="guc-health-check-retry-delay">. This is not
+ good. Attached patch tries to mitigate the problem:
+ </para>
+ <para>
+ When an attempt to connect to backend fails, give up
+ connecting to the failed node and skip to other node, rather
+ than exiting the process if operating in streaming
+ replication mode and the node is not primary node.
+ </para>
+ <para>
+ Mark the local status of the failed node to "down". This
+ will let the primary node be selected as a load balance node
+ and every queries will be sent to the primary node. If
+ there's other healthy standby nodes, one of them will be
+ chosen as the load balance node.
+ </para>
+ <para>
+ After the session is over, the child process will suicide to
+ not retain the local status.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-05-22 [b9955ce] Adding new PGPOOL SET and PGPOOL RESET commands.
+ 2016-05-11 [25dc79e] Adding new SHOW command for pgpool-II configuration parameters.
+ -->
+ <para>
+ Add <link linkend="SQL-PGPOOL-SHOW">PGPOOL
+ SHOW</link>, <link linkend="SQL-PGPOOL-SET">PGPOOL
+ SET</link> and
+ <link linkend="SQL-PGPOOL-RESET">PGPOOL RESET</link>
+ commands. (Muhammad Usama)
+ </para>
+ <para>
+ These are similar to the PostgreSQL's SET and SHOW commands
+ for GUC variables, adding the functionality
+ in <productname>Pgpool-II</productname> to set and reset the
+ value of config parameters for the current session, and for
+ that it adds a new syntax
+ in <productname>Pgpool-II</productname> which is similar to
+ PostgreSQL's SET and RESET variable syntax with an addition
+ of <literal>PGPOOL</literal> keyword at the start.
+ </para>
+ <para>
+ Currently supported configuration parameters by PGPOOL
+ SHOW/SET/RESET are: <xref linkend="guc-log-statement">,
+ <xref linkend="guc-log-per-node-statement">, <xref linkend="guc-check-temp-table">,
+ <xref linkend="guc-check-unlogged-table">, <xref linkend="guc-allow-sql-comments">,
+ <xref linkend="guc-client-idle-limit">, <xref linkend="guc-log-error-verbosity">,
+ <xref linkend="guc-client-min-messages">, <xref linkend="guc-log-min-messages">,
+ <xref linkend="guc-client-idle-limit-in-recovery">.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-08-02 [bda946e] Fix for 218: Inconsistent status of
+ Postgresql nodes in pgPool instances after
+ restart. Watchdog not syncing status.
+ -->
+ <para>
+ Sync inconsistent status
+ of <productname>PostgreSQL</productname> nodes
+ in <productname>Pgpool-II</productname> instances after
+ restart. (bug 218) (Muhammad Usama)
+ </para>
+ <para>
+ Watchdog does not synchronize status.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-09-06 [c0eb0ee] Enhance performance of SELECT when lots of rows involved.
+ -->
+ <para>
+ Enhance performance of SELECT when lots of rows involved.
+ (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> flushes data to network
+ (calling write(2)) every time it sends a row data ("Data
+ Row" message) to frontend. For example, if 10,000 rows
+ needed to be transfer, 10,000 times write()s are
+ issued. This is pretty expensive. Since after repeating to
+ send row data, "Command Complete" message is sent, it's
+ enough to issue a write() with the command complete
+ message. Also there are unnecessary flushing are in handling
+ the command complete message.
+ </para>
+ <para>
+ <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-September/001784.html">Quick
+ testing</ulink> showed that from 47% to 62% performance
+ enhancements were achieved in some cases.
+ </para>
+ <para>
+ Unfortunately, performance in workloads where transferring
+ few rows, will not be enhanced since such rows are needed to
+ flush to network anyway.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-08-26 [d768944] import PostgreSQL 9.6 parser
+ -->
+ <para>
+ Import <productname>PostgreSQL</productname> 9.6's SQL
+ parser. (Bo Peng)
+ </para>
+ <para>
+ This allows <productname>Pgpool-II</productname> to fully
+ understand the newly added SQL syntax such as <literal>COPY
+ INSERT RETURNING</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-08-26 [f284be4] Handling of pg_terminate_backend for simple query protocol
+ -->
+ <para>
+ In some cases <function>pg_terminate_backend()</function> now does not trigger a failover. (Muhammad Usama)
+ </para>
+ <para>
+ Because PostgreSQL returns exactly the same error code as postmaster
+ down case and <function>pg_terminate_backend()</function> case, using
+ <function>pg_terminate_backend()</function> raises a failover which user might not want. To
+ fix this, now <productname>Pgpool-II</productname> finds a pid of backend which is the target of
+ <function>pg_terminate_backend()</function> and does not trigger failover if so.
+ </para>
+ <para>
+ This functions is limited to the case of simple protocol and the pid
+ is given to <function>pg_terminate_backend()</function> as a constant. So if you call
+ <function>pg_terminate_backend()</function> via extended protocol (e.g. Java) still
+ <function>pg_terminate_backend()</function> triggers a failover.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-03-15 [47d9af9] Mega patch to add SGML docs.
+ -->
+ <para>
+ HTML documents are now generated from SGML documents.
+ (Muhammad Usama, Tatsuo Ishii, Bo Peng)
+ </para>
+ <para>
+ It is intended to have better construction, contents and
+ maintainability. Also man pages are now generated from SGML.
+ However, still there's tremendous room to
+ enhance the SGML documents. Please help us!
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Other Enhancements</title>
+
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2016-08-24 [0f4d1de] Make authentication error message more user friendly.
+ -->
+
+ <para>
+ Make authentication error message more user friendly. (Tatsuo Ishii)
+ </para>
+ <para>
+ When attempt to connect to backend (including health
+ checking), emit error messages from backend something like
+ "sorry, too many clients already" instead of "invalid
+ authentication message response type, Expecting 'R' and
+ received '%c'"
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-08-22 [2088a17] Tighten up health check timer expired condition in pool_check_fd()
+ -->
+ <para>
+ Tighten up health check timer expired condition in pool_check_fd(). (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-07-29 [6ff2ac0] Add new script called "watchdog_setup".
+ 2016-08-18 [d3211dc] Let watchdog_setup to be installed.
+ -->
+ <para>
+ Add new script called "watchdog_setup". (Tatsuo Ishii)
+ </para>
+ <para>
+ <xref linkend="WATCHDOG-SETUP"> is a command to create a
+ temporary installation
+ of <productname>Pgpool-II</productname> clusters with
+ watchdog for mainly testings.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-07-29 [cf319c4] Add "-pg" option to pgpool_setup.
+ 2016-08-16 [d5c3cf2] Let pgpool_setup install into dist bin.
+ -->
+ <para>
+ Add "-pg" option to pgpool_setup. (Tatsuo Ishii)
+ </para>
+ <para>
+ This is useful when you want to assign specific port numbers to
+ <productname>PostgreSQL</productname> while
+ using <xref linkend="PGPOOL-SETUP">. Also
+ now <command>pgpool_setup</command> is installed in the
+ standard bin directory which is same
+ as <command>pgpool</command>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-08-12 [9db83a8] Add "replication delay" column to "show pool_nodes".
+ -->
+ <para>
+ Add "replication delay" column to "show pool_nodes". (Tatsuo Ishii)
+ </para>
+ <para>
+ This column
+ shows the <link linkend="runtime-streaming-replication-check">
+ replication delay</link> value in bytes if operated in
+ streaming replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-07-12 [726cb5d] Do not update status file if all backend nodes are in down status.
+ -->
+ <para>
+ Do not update status file if all backend nodes are in down status. (Chris Pacejo, Tatsuo Ishii)
+ </para>
+ <para>
+ This commit tries to remove the data inconsistency in
+ replication mode found
+ in <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2015-August/003974.html">[pgpool-general:
+ 3918]</ulink> by not recording the status file when all
+ backend nodes are in down status. This surprisingly simple
+ but smart solution was provided by Chris Pacejo.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-05-23 [9342472] Permit pgpool to support multiple SSL cipher protocols
+ -->
+ <para>
+ Allow to use multiple SSL cipher protocols. (Muhammad Usama)
+ </para>
+ <para>
+ By replacing TLSv1_method() with SSLv23_method() while
+ initializing the SSL session, we can use more protocols than
+ TLSv1 protocol.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-04-07 [0e01d32] removing the limit on the maximum number
+ of items in the black_function_list and white_function_list lists.
+ -->
+ <para>
+ Allow to use arbitrary number of items in the
+ black_function_list/white_function_list. (Muhammad Usama)
+ </para>
+ <para>
+ Previously there were fixed limits for those.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-02-17 [f2a5081] Properly process empty query (all comments)
+ -->
+ <para>
+ Properly process empty queries (all comments). (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> now recognizes an empty
+ query consisted of all comments (for example "/* DBD::Pg
+ ping test v3.5.3 */") (note that no ';') as an empty query.
+ </para>
+ <para>
+ Before such that query was recognized an error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-02-01 [342471f] Add some warning messages for wd_authkey hash calculation failure
+ -->
+ <para>
+ Add some warning messages for wd_authkey hash calculation failure. (Yugo Nagata)
+ </para>
+ <para>
+ Sometimes wd_authkey calculation fails for some reason other
+ than authkey mismatch. The additional messages make these
+ distinguishable for each other.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+ <sect2>
+ <title>Changes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2016-11-09 [f6ec434] Fix the broken log_destination = syslog functionality.
+ -->
+ <para>
+ Fix the broken log_destination = syslog functionality. (Muhammad Usama)
+ </para>
+ <para>
+ Fixing the logging to the syslog destination, which got broken by the
+ PGPOOL SET/SHOW command commit, and also enhancing the log_destination
+ configuration parameter to be assigned with the comma separated list of multiple
+ destinations for the <productname>Pgpool-II</productname> log. Now, after this commit log_destination can
+ be set to any combination of 'syslog' and 'stderr' log destinations.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-24 [cc33fe3] Change the default value of search_primary_node_timeout from 10 to 300.
+ -->
+ <para>
+ Change the default value of
+ <xref linkend="guc-search-primary-node-timeout"> from 10 to 300. (Tatsuo Ishii)
+ </para>
+ <para>
+ Prior default value 10 seconds is sometimes too short for a standby to
+ be promoted.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2016-06-09 [7671794] Change the Makefile under directory src/sql/,that is proposed by [pgpool-hackers: 1611]
+ -->
+ <para>
+ Change the <filename>Makefile</filename> under directory
+ <filename>src/sql/</filename>, that is proposed by
+ <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-June/001611.html">
+ [pgpool-hackers: 1611]</ulink>. (Bo Peng)
+ </para>
+
+ </listitem>
+ <listitem>
+ <!--
+ 2016-04-20 [883d761] Change the PID length of pcp_proc_count command output to 6 characters long
+ -->
+ <para>
+ Change the PID length of <link linkend="PCP-PROC-COUNT">pcp_proc_count</link> command output to 6 characters long. (Bo Peng)
+ </para>
+ <para>
+ If the <productname>Pgpool-II</productname> process ID are over 5 characters, the 6th character of each process ID
+ will be removed. This commit changes the process ID length of <link linkend="PCP-PROC-COUNT">pcp_proc_count</link> command
+ output to 6 characters long.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-04-15 [9b62eca] Redirect all user queries to primary server
+ -->
+ <para>
+ Redirect all user queries to primary server. (Tatsuo Ishii)
+ </para>
+ <para>
+ Up to now some user queries are sent to other than the primary server
+ even if <xref linkend="guc-load-balance-mode"> = off. This commit changes the behavior: if
+ load_balance_mode = off in streaming replication mode, now all the
+ user queries are sent to the primary server only.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2016-11-14 [266b67a] Fixing a potential crash in pool_stream functions.
+ -->
+ <para>
+ Fixing a potential crash in pool_stream functions. (Muhammad Usama)
+ </para>
+ <para>
+ POOL_CONNECTION->con_info should be checked for null value before de-referencing
+ when read or write fails on backend socket.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-11-14 [ef6c0c8] Fixing the design of failover command propagation on watchdog cluster
+ -->
+ <para>
+ Fixing the design of failover command propagation on watchdog cluster. (Muhammad Usama)
+ </para>
+ <para>
+ Overhauling the design of how failover, failback and promote node commands are
+ propagated to the watchdog nodes. Previously the watchdog on pgpool-II node that
+ needs to perform the node command (failover, failback or promote node) used to
+ broadcast the failover command to all attached pgpool-II nodes. And this
+ sometimes makes the synchronization issues, especially when the watchdog cluster
+ contains a large number of nodes and consequently the failover command sometimes
+ gets executed by more than one <productname>Pgpool-II</productname>.
+ </para>
+ <para>
+ Now with this commit all the node commands are forwarded to the
+ master/coordinator watchdog, which in turn propagates to all standby nodes.
+ Apart from above the commit also changes the failover command interlocking
+ mechanism and now only the master/coordinator node can become the lock holder
+ so the failover commands will only get executed on the master/coordinator node.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-27 [a7e459f] Fix the case when all backends are down then 1 node attached.
+ -->
+ <para>
+ Fix the case when all backends are down then 1 node attached. (Tatsuo Ishii)
+ </para>
+ <para>
+ When all backends are down, no connection is accepted. Then 1
+ <productname>PostgreSQL</productname> becomes up, and attach the node using pcp_attach_node. It
+ successfully finishes. However, when a new connection arrives, still
+ the connection is refused because<productname>Pgpool-II</productname> child process looks into the
+ cached status, in which the recovered node is still in down status if
+ mode is streaming replication mode (native replication and other modes
+ are fine). Solution is, if all nodes are down, force to restart all
+ pgpool child.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-19 [e89e365] Fix for: [pgpool-general: 4997] Avoiding downtime when pgpool changes require a restart
+ -->
+ <para>
+ Fix for avoiding downtime when <productname>Pgpool-II</productname> changes require a restart. (Muhammad Usama)
+ </para>
+ <para>
+ To fix this, the verification mechanism of configuration parameter values is
+ reversed, previously the standby nodes used to verify their parameter values
+ against the respective values on the master <productname>Pgpool-II</productname> node and when the
+ inconsistency was found the FATAL error was thrown, now with this commit the
+ verification responsibility is delegated to the master <productname>Pgpool-II</productname> node.
+ Now the master node will verify the configuration parameter values of each
+ joining standby node against its local values and will produce
+ a WARNING message instead of an error in case of a difference.
+ This way the nodes having the different configurations will also be allowed to
+ join the watchdog cluster and the user has to manually look out for the
+ configuration inconsistency warnings in the master <productname>Pgpool-II</productname> log to avoid the
+ surprises at the time of <productname>Pgpool-II</productname> master switch over.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-19 [233ae46] Fixing a problem with the watchdog failover_command locking mechanism
+ -->
+ <para>
+ Fix a problem with the watchdog <xref linkend="guc-failover-command"> locking mechanism. (Muhammad Usama)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-12 [b412da2] Disable strict aliasing optimization.
+ -->
+ <para>
+ Add compiler flag "-fno-strict-aliasing" in <filename>configure.ac</filename> to fix compiler error. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-09 [650c660] Do not use random() while generating MD5 salt.
+ -->
+ <para>
+ Do not use <function>random()</function> while generating MD5 salt. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>random()</function> should not be used in security related applications. To
+ replace <function>random()</function>, import <function>PostmasterRandom()</function> from PostgreSQL. Also
+ store current time at the start up of <productname>Pgpool-II</productname> main process for later
+ use.
+ </para>
+
+ </listitem>
+ <listitem>
+ <!--
+ 2016-09-05 [455df3d] Don't ignore sync message from frontend when query cache is enabled.
+ -->
+ <para>
+ Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-29 [4c23c9b] Fix for 237: Pgpool-II fails to start if listen_addresses is empty string
+ -->
+ <para>
+ Fix bug that <productname>Pgpool-II</productname> fails to start if <xref linkend="guc-listen-addresses"> is empty string. (bug 237) (Muhammad Usama)
+ </para>
+ <para>
+ The socket descriptor array (fds[]) was not getting the array end marker
+ when TCP listen addresses are not used.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-22 [879d16a] Create regression log directory if it does not exist yet.
+ -->
+ <para>
+ Create regression log directory if it does not exist yet. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-17 [37e376e] Fixing the error messages when the socket operation fails
+ -->
+ <para>
+ Fixing the error messages when the socket operation fails. (Muhammad Usama)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-15 [f2b5d17] Fix regression failure of 003.failover.
+ -->
+ <para>
+ Update regression test 003.failover to reflect the changes made to
+ <link linkend="SQL-SHOW-POOL-NODES">show pool_nodes</link>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-09 [a7bc4c8] Fix hang when portal suspend received
+ -->
+ <para>
+ Fix hang when portal suspend received. (bug 230) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-04 [3b2db66] Fix for 228: pgpool doesn't de-escalate IP in case network restored
+ -->
+ <para>
+ Fix pgpool doesn't de-escalate IP in case network restored. (bug 228) (Muhammad Usama)
+ </para>
+ <para>
+ set_state function is made to de-escalate, when it is changing the local node's
+ state from the coordinator state to some other state.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-02 [9b122ab] SIGUSR1 signal handler should be installed before watchdog initialization.
+ -->
+ <para>
+ SIGUSR1 signal handler should be installed before watchdog initialization. (Muhammad Usama)
+ </para>
+ <para>
+ Since there can be a case where a failover request from other watchdog nodes
+ arrive at the same time when the watchdog has just been initialized,
+ and if we wait any longer to install a SIGUSR1 signal handler, it can
+ result in a potential crash
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-08-01 [024eaea] Fix for 215: pgpool doesnt escalate ip in case of another node unavailability
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> doesn't escalate ip in case of another node unavailability. (bug 215) (Muhammad Usama)
+ </para>
+ <para>
+ The heartbeat receiver fails to identify the heartbeat sender watchdog node when
+ the heartbeat destination is specified in terms of an IP address while
+ wd_hostname is configured as a hostname string or vice versa.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-07-29 [5bce300] Fixing a coding mistake in watchdog code.
+ -->
+ <para>
+ Fixing a coding mistake in watchdog code. (Muhammad Usama)
+ </para>
+ <para>
+ <function>wd_issue_failover_lock_command()</function> function is supposed to forward command type
+ passed in as an argument to the <function>wd_send_failover_sync_command()</function> function instead
+ it was passing the NODE_FAILBACK_CMD command type.
+ </para>
+ <para>
+ The commit also contains some log message enhancements.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-07-28 [541451e] Display human readable output for backend node status.
+ -->
+ <para>
+ Display human readable output for backend node status. (Muhammad Usama)
+ </para>
+ <para>
+ Changed the output of <link linkend="PCP-PROC-INFO">pcp_node_info</link> utility and show commands display human
+ readable backend status string instead of internal status code.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-07-27 [3cbce4e] Replace "MAJOR" macro to prevent occasional failure.
+ -->
+ <para>
+ Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
+ </para>
+ <para>
+ The macro calls <function>pool_virtual_master_db_node_id()</function> and then access
+ backend->slots[id]->con using the node id returned. In rare cases, it
+ could point to 0 (in case when the DB node is not connected), which
+ gives access to con->major, then it causes a segfault.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-07-14 [866575c] Fix for [pgpool-hackers: 1501] kind does not match error
+ -->
+ <para>
+ Fix "kind mismatch" error message in <productname>Pgpool-II</productname>. (Muhammad Usama)
+ </para>
+ <para>
+ Many of "kind mismatch..." errors are caused by notice/warning
+ messages produced by one or more of the DB nodes. In this case now
+ <productname>Pgpool-II</productname> forwards the messages to frontend, rather than throwing the
+ "kind mismatch..." error. This would reduce the chance of "kind
+ mismatch..." errors.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-07-14 [680e329] Fix handling of pcp_listen_addresses config parameter.
+ -->
+ <para>
+ Fix handling of <xref linkend="guc-pcp-listen-addresses"> config parameter. (Muhammad Usama)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-07-07 [e245587] Save and restore errno in each signal handler.
+ -->
+ <para>
+ Save and restore errno in each signal handler. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ commit 0d1cdf96feb77de6f1dfc2d46ecd7467325d1f79
+ 2016-07-07 [0d1cdf9] Fix usage of wait(2) in pgpool main process
+ -->
+ <para>
+ Fix usage of <function>wait(2)</function> in pgpool main process. (Tatsuo Ishii)
+ </para>
+ <para>
+ The usage of <function>wait(2)</function> in <productname>Pgpool-II</productname>
+ main could cause infinite wait in the system call. Solution is,
+ to use <function>waitpid(2)</function> instead of <function>wait(2)</function>.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-06-28 [bb41a1e] Fix confusing error messages.
+ -->
+ <para>
+ Fix that <function>pool_read()</function> does not emit error messages when <function>read(2)</function> returns -1 if
+ <xref linkend="guc-failover-on-backend-error"> is off. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-06-24 [a01624f] Fix buffer over run problem in "show pool_nodes".
+ -->
+ <para>
+ Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
+ </para>
+ <para>
+ While processing "show pool_nodes", the buffer for hostname was too
+ short. It should be same size as the buffer used for <filename>pgpool.conf</filename>.
+ Problem reported by a twitter user who is using pgpool on AWS (which
+ could have very long hostname).
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-06-17 [4c63d10] Fixing [pgpool-hackers: 1638] pgpool-II does not use default configuration
+ -->
+ <para>
+ Fix <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-June/001638.html">
+ [pgpool-hackers: 1638]</ulink> pgpool-II does not use default configuration. (Muhammad Usama)
+ </para>
+ <para>
+ Configuration file not found should just throw a WARNING message
+ instead of ERROR or FATAL.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-06-15 [226a21b] Fix bug with load balance node id info on shmem
+ -->
+ <para>
+ Fix bug with load balance node id info on shmem. (Tatsuo Ishii)
+ </para>
+ <para>
+ There are few places where the load balance node was mistakenly put on
+ wrong place. It should be placed on:
+ <programlisting>
+ ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node].
+ </programlisting>
+ In fact it was placed on:
+ <programlisting>
+ *con_info[child id, connection pool_id, 0].load_balancing_node].
+ </programlisting>
+ </para>
+ <para>
+ As long as the backend id in question is 0, it is ok. However while
+ testing <productname>Pgpool-II</productname> 3.6's enhancement regarding failover, if primary
+ node is 1 (which is the load balance node) and standby is 0, a client
+ connecting to node 1 is disconnected when failover happens on node
+ 0. This is unexpected and the bug was revealed.
+ </para>
+ <para>
+ It seems the bug was there since long time ago but it had not found
+ until today by the reason above.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-06-09 [6ae42e7] fix for 0000197: pgpool hangs connections to database.
+ -->
+ <para>
+ Fix for bug that pgpool hangs connections to database. (bug 197) (Muhammad Usama)
+ </para>
+ <para>
+ The client connection was getting stuck when backend node and remote <productname>Pgpool-II</productname>
+ node becomes unavailable at the same time. The reason was a missing command
+ timeout handling in the function that sends the IPC commands to watchdog.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-06-08 [294cf4a] Fix a possible hang during health checking
+ -->
+ <para>
+ Fix a possible hang during health checking. (bug 204) (Yugo Nagata)
+ </para>
+ <para>
+ Health checking was hang when any data wasn't sent
+ from backend after <function>connect(2)</function> succeeded. To fix this,
+ <function>pool_check_fd()</function> returns 1 when <function>select(2)</function> exits with
+ EINTR due to SIGALRM while health checking is performed.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-05-25 [a2d04ab] Deal with the case when the primary is not node 0 in streaming replication mode.
+ -->
+ <para>
+ Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=194#c837">
+ http://www.pgpool.net/mantisbt/view.php?id=194#c837</ulink> reported that if
+ primary is not node 0, then statement timeout could occur even after
+ bug194-3.3.diff was applied. After some investigation, it appeared
+ that MASTER macro could return other than primary or load balance
+ node, which was not supposed to happen, thus <function>do_query()</function> sends queries
+ to wrong node (this is not clear from the report but I confirmed it in
+ my investigation).
+ </para>
+ <para>
+ <function>pool_virtual_master_db_node_id()</function>, which is called in MASTER macro
+ returns query_context->virtual_master_node_id if query context
+ exists. This could return wrong node if the variable has not been set
+ yet. To fix this, the function is modified: if the variable is not
+ either load balance node or primary node, the primary node id is
+ returned.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-05-24 [69d3fae] If statement timeout is enabled on backend and do_query() sends a
+ -->
+ <para>
+ If statement timeout is enabled on backend and <function>do_query()</function> sends a query to primary node, and all of following user queries are sent to
+ standby, it is possible that the next command, for example END, could
+ cause a statement timeout error on the primary, and a kind mismatch
+ error on pgpool-II is raised. (bug 194) (Tatsuo Ishii)
+ </para>
+ <para>
+ This fix tries to mitigate the problem by sending sync message instead
+ of flush message in <function>do_query()</function>, expecting that the sync message reset
+ the statement timeout timer if we are in an explicit transaction. We
+ cannot use this technique for implicit transaction case, because the
+ sync message removes the unnamed portal if there's any.
+ </para>
+ <para>
+ Plus, pg_stat_statement will no longer show the query issued by
+ do_query() as "running".
+ </para>
+ <para>
+ Plus, pg_stat_statement will no longer show the query issued by
+ <function>do_query()</function> as "running".
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-05-22 [0c0e727] Fix extended protocol handling in raw mode
+ -->
+ <para>
+ Fix extended protocol handling in raw mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ Bug152 reveals that extended protocol handling in raw mode (actually
+ other than in stream mode) was wrong in <function>Describe(</function>) and <function>Close()</function>.
+ Unlike stream mode, they should wait for backend response.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-05-20 [78c5d56] Fix confusing comments in pgpool.conf
+ -->
+ <para>
+ Fix confusing comments in <filename>pgpool.conf</filename>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-05-11 [de905f6] Fix documentation bug about raw mode
+ -->
+ <para>
+ Fix Japanese and Chinese documentation bug about raw mode. (Yugo Nagata, Bo Peng)
+ </para>
+ <para>
+ Connection pool is available in raw mode.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-05-09 [9512999] Fix is_set_transaction_serializable() when
+ SET default_transaction_isolation TO 'serializable'.
+ -->
+ <para>
+ Fix is_<function>set_transaction_serializable()</function> when
+ SET default_transaction_isolation TO 'serializable'. (bug 191) (Bo Peng)
+ </para>
+ <para>
+ SET default_transaction_isolation TO 'serializable' is sent to
+ not only primary but also to standby server in streaming replication mode,
+ and this causes an error. Fix is, in streaming replication mode,
+ SET default_transaction_isolation TO 'serializable' is sent only to the
+ primary server.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-04-13 [a5fdf78] Fix extended protocol hang with empty query
+ -->
+ <para>
+ Fix extended protocol hang with empty query. (bug 190) (Tatsuo Ishii)
+ </para>
+ <para>
+ The fixes related to extended protocol cases in 3.5.1 broke the case
+ of empty query. In this case backend replies with "empty query
+ response" which is same meaning as a command complete message. Problem
+ is, when empty query response is received, pgpool does not reset the
+ query in progress flag thus keeps on waiting for backend. However,
+ backend will not send the ready for query message until it receives a
+ sync message. Fix is, resetting the in progress flag after receiving
+ the empty query response and reads from frontend expecting it sends a
+ sync message.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-04-05 [64696fd] Fix for [pgpool-general: 4569] PGPoolII-3.5 : segfault
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2016-March/004627.html">
+ [pgpool-general: 4569]</ulink> segfault during trusted_servers check. (Muhammad Usama)
+ </para>
+ <para>
+ PostgreSQL's memory and exception manager APIs adopted by the <productname>Pgpool-II</productname> 3.4 are not
+ thread safe and are causing the segmentation fault in the watchdog lifecheck
+ process, as it uses the threads to ping configured trusted hosts for checking
+ the upstream connections.
+ Fix is to remove threads and use the child process approach instead.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-03-29 [f7723c8] Validating the PCP packet length
+ -->
+ <para>
+ Validating the PCP packet length. (Muhammad Usama)
+ </para>
+ <para>
+ Without the validation check, a malformed PCP packet can crash the PCP child
+ and/or can run the server out of memory by sending the packet with a
+ very large data size.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-03-26 [d1c03f2] Fix pgpool_setup to not confuse log output
+ -->
+ <para>
+ Fix <link linkend="PGPOOL-SETUP">pgpool_setup </link> to not confuse log output. (Tatsuo Ishii)
+ </para>
+ <para>
+ Before it simply redirects the stdout and stderr of pgpool process to
+ a log file. This could cause log contents being garbled or even
+ missed because of race condition caused by multiple process being
+ writing concurrently. I and Usama found this while investigating the
+ regression failure of 004.watchdog.
+
+ To fix this, <link linkend="PGPOOL-SETUP">pgpool_setup </link> now generates startall script so that pgpool
+ now sends stdout/stderr to cat command and cat writes to the log file
+ (It seems the race condition does not occur when writing to a pipe).
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-03-07 [e55c230] Fix for [pgpool-general: 4519] Worker Processes Exit and Are Not Re-spawned
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2016-March/004577.html">
+ [pgpool-general: 4519]</ulink> Worker Processes Exit and Are Not Re-spawned. (Muhammad Usama)
+ </para>
+ <para>
+ The problem was due to a logical mistake in the code for checking the exiting
+ child process type when the watchdog is enabled.
+ I have also changed the severity of the message from FATAL to LOG, emitted
+ for child exits due to max connection reached.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-03-04 [67ac541] Fix pgpool hung after receiving error state from backend
+ -->
+ <para>
+ Fix pgpool hung after receiving error state from backend. (bug #169) (Tatsuo Ishii)
+ </para>
+ <para>
+ This could happen if we execute an extended protocol query and it
+ fails.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-03-03 [bb295a2] Fix query stack problems in extended protocol case.
+ -->
+ <para>
+ Fix query stack problems in extended protocol case. (bug 167, 168) (Tatsuo Ishii)
+ </para>
+ <para>
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-03-03 [63a0b70] Fix yet another reset query stuck problem
+ -->
+ <para>
+ Fix <ulink url="http://www.pgpool.net/pipermail/pgpool-hackers/2016-March/001440.html">
+ [pgpool-hackers: 1440]</ulink> yet another reset query stuck problem. (Tatsuo Ishii)
+ </para>
+ <para>
+ After receiving X message from frontend, if <productname>Pgpool-II</productname> detects EOF on
+ the connection before sending reset query, <productname>Pgpool-II</productname> could wait for
+ backend which had not received the reset query. To fix this, if EOF
+ received, treat this as FRONTEND_ERROR, rather than ERROR.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-02-22 [f1cfeb6] Yet another reset query stuck problem fix. [pgpool-general: 4265]
+ -->
+ <para>
+ Fix for <ulink url="http://www.pgpool.net/pipermail/pgpool-general/2015-December/004323.html">
+ [pgpool-general: 4265]</ulink> another reset query stuck problem. (Muhammad Usama)
+ </para>
+ <para>
+ The solution is to report FRONTEND_ERROR instead of simple ERROR when
+ pool_flush on front-end socket fails.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-02-12 [c50f357] Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6
+ -->
+ <para>
+ Fixing pgpool-recovery module compilation issue with <productname>PostgreSQL</productname> 9.6. (Muhammad Usama)
+ </para>
+ <para>
+ Incorporating the change of function signature for
+ <function>GetConfigOption()</function> functions in <productname>PostgreSQL</productname> 9.6
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-02-03 [48e9d4b] Fix for [pgpool-II 0000166]: compile issue on FreeBSD
+ -->
+ <para>
+ Fix compile issue on FreeBSD. (Muhammad Usama)
+ </para>
+ <para>
+ Add missing include files. The patch is contributed by
+ the bug reporter and enhanced a little by me.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-02-01 [6688332] Fix regression test to check timeout of each test
+ -->
+ <para>
+ Fix regression test to check timeout of each test. (Yugo Nagata)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-02-01 [44f43cc] Add some warning messages for wd_authkey hash calculation failure
+ -->
+ <para>
+ Add some warning messages for <xref linkend="guc-wd-authkey"> hash calculation failure. (Yugo Nagata)
+ </para>
+ <para>
+ Sometimes <xref linkend="guc-wd-authkey"> calculation fails for some reason other than
+ authkey mismatch. The additional messages make these distinguishable
+ for each other.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
+
--- /dev/null
+<!-- doc/src/sgml/release-3.7.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id=release-3-7-17>
+ <title>Release 3.7.17</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-11-19</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [6382452]
+ -->
+ <para>
+ Doc: update "Aurora Configuration Example". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [1b81b2c]
+ -->
+ <para>
+ Doc: mention that <acronym>GSSAPI</acronym> is not supported. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [0b7a180]
+ -->
+ <para>
+ <productname>Pgpool-II</productname> doesn't support <acronym>GSSAPI</acronym>.
+ Allow <productname>Pgpool-II</productname> to deal with <acronym>GSSAPI</acronym> encrypted connection request from frontend instead of responding with an error. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is created by me, reviewed and tested by Umar Hayat.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [94cbceb]
+ -->
+ <para>
+ Fix query rewrite syntax error of "INSERT ... ON CONFLICT" in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=654">bug 654</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-30 [a33017b]
+ -->
+ <para>
+ Fix connection counter was not counted down when query is canceled.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=656">bug 656</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-30 [03abedd]
+ -->
+ <para>
+ Doc: fix usable versions of PostgreSQL to be 7.4 or later. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-16>
+ <title>Release 3.7.16</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-09-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-13 [89a0ec1]
+ -->
+ <para>
+ Follow the guide line of <productname>PostgreSQL</productname> 12.4 regarding extensions. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>CREATE OR REPLACE FUNCTION</command> should be avoided. Use <command>CREATE FUNCTION</command> instead.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-24 [c267748]
+ -->
+ <para>
+ Replace "PGBIN" and "LPATH" in <xref linkend="PGPOOL-SETUP"> and <xref linkend="WATCHDOG-SETUP"> using PostgreSQL's bin path and lib path. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-16 [957d3b3]
+ -->
+ <para>
+ Doc: fix the incorrect description regarding the running modes of Pgpool-II in which online recovery is available. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-14 [355bfb9]
+ -->
+ <para>
+ Remove unnecessary checks in some code path. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Hou, Zhijie.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-06 [0883832]
+ -->
+ <para>
+ Fix relcache query sometimes sent to other than primary. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, relcache queries are supposed to be
+ sent to the primary node. But actually they were not sent to the primary
+ node if primary node was not the master node. Typically this could
+ happen when the primary is not node 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-01 [89ce1e5]
+ -->
+ <para>
+ Fix <xref linkend="GUC-CONNECTION-LIFE-TIME"> not working when <xref linkend="GUC-SERIALIZE-ACCEPT"> is enabled. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-August/007233.html">[pgpool-general: 7175]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-30 [fd27549]
+ -->
+ <para>
+ Display more informative error message in authentication process. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-21 [442f683]
+ -->
+ <para>
+ Fix segfault in pgpool child process in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ This issue can be reproduced with the following steps:
+ <orderedlist>
+ <listitem>
+ <para>
+ Shutdown all backends.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Connect to pgpool with invalid client. I have used <command>pcp_attach_node</command> with pgpool's port number, not pcp's.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-15>
+ <title>Release 3.7.15</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-08-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [a88d1f6]
+ -->
+ <para>
+ Doc: mention that <xref linkend="GUC-SSL-CIPHERS"> only affects to TLS 1.2 and lower. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [e84853c]
+ -->
+ <para>
+ Doc: Improve the description of <xref linkend="GUC-WD-PRIORITY">. (Bo Peng)
+ </para>
+ <para>
+ Patch is provided by Kenichiro Tanaka.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [52d6e2d]
+ -->
+ <para>
+ Add mention about <literal>hostssl/hostnossl</literal> to <filename>pool_hba.conf</filename> sample file. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-17 [44096e2]
+ 2020-07-16 [5115de1]
+ 2020-06-30 [8941202]
+ 2020-05-30 [6f128fc]
+ 2020-05-23 [dde82d3]
+ 2020-05-23 [7a73705]
+ 2020-07-28 [1e13a96]
+ -->
+ <para>
+ Doc: documentation improvements. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [8afa83b]
+ -->
+ <para>
+ At pgpool startup, if pid file exists, truncate pid file to zero length before writing. (Bo Peng)
+ </para>
+ <para>
+ Patch is created by maliangzhu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [610b983]
+ -->
+ <para>
+ Doc: fix error in <xref linkend="GUC-FAILBACK-COMMAND"> parameter description. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [b47a050]
+ -->
+ <para>
+ Fix <xref linkend="guc-connection-life-time"> does not work if primary node is not 0 in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [25e5292]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> problem with -r option and <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-31 [c8944c1]
+ -->
+ <para>
+ Change PCP <literal>UNIX_DOMAIN_PATH</literal> of RPM package to <filename>/var/run/postgresql</filename>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [126e62f]
+ 2020-07-14 [5655394]
+ -->
+ <para>
+ Fix query cache bugs. (Tatsuo Ishii)
+ </para>
+ <para>
+ If query cache is enable, when a table is updated, Pgpool-II should delete all the caches related to the table.
+ However, <command>EXPLAIN ANALYZE</command> and <acronym>CTE</acronym> with data-modifying SQLs
+ were mistakenly treated as normal read only query so that the query caches were not deleted.
+ </para>
+ <para>
+ Patch is created by Hou, Zhijie and modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-09 [c96e7d4]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang in a corner case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-26 [25b3ca4]
+ -->
+ <para>
+ If there are parameters other than "user", "database" and "application_name", reading startup packet failed. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-22 [b6cc86f]
+ -->
+ <para>
+ Fix miscount of connections when <function>pg_terminate_backend()</function> is executed. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-04 [607665b]
+ -->
+ <para>
+ Fix segmentation fault when application name is included in <xref linkend="GUC-LOG-LINE-PREFIX">. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=615">bug 615</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-02 [5108456]
+ -->
+ <para>
+ Fix incorrectly performing failover when <function>pg_terminate_backend()</function> is executed in native replication mode. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-27 [75158b1]
+ -->
+ <para>
+ Fix 004.watchdog test crash on IBM Z hardware. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=614">bug 614</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by gregn123, slightly modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-14>
+ <title>Release 3.7.14</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-05-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-05-16 [2fd983b]
+ 2020-04-26 [1304dcc]
+ -->
+ <para>
+ Fix build error on some system (Fedora 32). (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [1221a65]
+ -->
+ <para>
+ Fix unnecessary checks. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by sherlockcpp. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007062.html">[pgpool-general: 7004]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [8ea84b9]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Umar Hayat. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-April/003587.html">[pgpool-hackers: 3587]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-16 [75432c0]
+ -->
+ <para>
+ Fix for segmentation fault in PCP process. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=598">bug 598</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-12 [237793e]
+ 2020-04-06 [225290a]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii, Bo Peng)
+ </para>
+ <para>
+ Patch provided by sherlockcpp.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-31 [9151b53]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hangs when an Execute message is issued right after Sync message and query cache hits. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-13 [a558287]
+ -->
+ <para>
+ Fix problems in watchdog source code processing json data. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=596">bug 596</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by Greg Nancarrow (Fujitsu Australia).
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-11 [a639141]
+ -->
+ <para>
+ Fix possible data inconsistency in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussions:
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-March/006954.html">[pgpool-general: 6896]</ulink>
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-March/003540.html">[pgpool-hackers: 3540]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-06 [5ce6273]
+ -->
+ <para>
+ Fix watchdog ping probes fail with long hostnames due to small buffer. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=516">bug 516</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-13>
+ <title>Release 3.7.13</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-02-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2020-02-18 [49ece42]
+ -->
+ <para>
+ Disallowing the quorum aware failover option for the native replication mode. (Muhammad Usama)
+ </para>
+ <para>
+ In native replication mode, <productname>Pgpool-II</productname>. is responsible for replicating the data
+ on all backend nodes, and if a node becomes <literal>quarantined</literal> then Pgpool-II stops
+ sending the writes to that node. This is dangerous since it can cause data inconsistency.
+ </para>
+ <para>
+ So as per the discussion, we reached the conclusion to disallow
+ <xref linkend="GUC-FAILOVER-WHEN-QUORUM-EXISTS"> with the native replication mode so that backend
+ node should never get into quarantine when Pgpool-II is configured in the replication mode.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-28 [abbba81]
+ -->
+ <para>
+ Check if socket file exists at startup and remove them if PID file doesn't exist to avoid bind() failure. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-02-18 [91c142d]
+ -->
+ <para>
+ Fix incorrect query rewriting in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=551">bug 551</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-18 [47fc7fc]
+ 2020-02-17 [44249e9]
+ 2020-02-04 [b8ff41f]
+ -->
+ <para>
+ Doc: Update documentation and fix documentation typos. (Takuma Hoshiai, Tatsuo Ishii, Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-02-12 [8712e69]
+ -->
+ <para>
+ Fix child process segfault after reload if <xref linkend="GUC-HEALTH-CHECK-DATABASE"> is empty.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=571">bug 571</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-02-08 [84cdb02]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to support <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-11 [433a7da]
+ 2020-01-10 [c440468]
+ 2020-01-04 [8b5d7f5]
+ 2019-12-31 [21777b9]
+ 2019-12-27 [ce58ddc]
+ 2019-12-26 [9f5a2d6]
+ -->
+ <para>
+ Fix occasional regression test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-12-12 [5f6410d]
+ -->
+ <para>
+ Fix replication delay worker segfault when application_name in primary_conninfo is an empty string.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=565">bug 565</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-12-03 [c959c8b]
+ -->
+ <para>
+ Fix <xref linkend="SQL-PGPOOL-SHOW"> command doesn't display <literal>ALWAYS_MASTER</literal>,
+ when <xref linkend="GUC-BACKEND-FLAG"> = 'ALWAYS_MASTER'. (Takuma Hoshiai)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-11-18 [f906d26]
+ 2019-11-15 [d8c1242]
+ -->
+ <para>
+ Fix the bug with ignored syslog setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-12>
+ <title>Release 3.7.12</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-10-25 [45a3469]
+ -->
+ <para>
+ Fix incorrect query rewrite in replication mode. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-21 [1d87df7]
+ -->
+ <para>
+ Fix that health check timeout does work in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-October/003458.html">[pgpool-hackers: 3458]</ulink>, <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-October/003459.html">[pgpool-hackers: 3459]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-15 [339bd21]
+ -->
+ <para>
+ Doc: add <xref linkend="guc-failover-command"> description when all standby nodes are down. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-11 [32a9f5d]
+ -->
+ <para>
+ Doc: add note not to assign <productname>PostgreSQL</productname> servers to <xref linkend="guc-trusted-servers">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-14 [30aed19]
+ -->
+ <para>
+ Fix for miscellaneous watchdog issues. (Muhammad Usama)
+ </para>
+ <para>
+ The lost nodes reported by life-check are treated as hard failures even when the node
+ is reachable from the watchdog core.
+ </para>
+ <para>
+ In the case of network partitioning or partial life-check failure,
+ the kicked out standby node was too aggressive in trying to connect
+ to the master or become a master itself so that potentially put the
+ unnecessary burden on the network and the cluster nodes.
+ Fix is to make the isolated node a bit calm and wait between trying to connect to
+ master or become a master.
+ </para>
+ <para>
+ See details:
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=547">bug 547</ulink>),
+ <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-August/006730.html">[pgpool-general: 6672]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-10 [4b726df]
+ -->
+ <para>
+ Fix assorted ancient v2 protocol bugs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-08 [45ac39b]
+ -->
+ <para>
+ Fix problem that <xref linkend="guc-syslog-facility"> doesn't change by reload.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=548">bug 548</ulink>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-03 [fed3d6b]
+ -->
+ <para>
+ Fix Pgpool-II shutdown failed in certain case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-29 [94b96ed]
+ -->
+ <para>
+ Allow the lost standby node to rejoin the master watchdog node when it gets rediscovered by the lifecheck.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=545">bug 545</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-25 [8e9cf76]
+ -->
+ <para>
+ Overhaul health check debug facility. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-15 [a333a45]
+ -->
+ <para>
+ Fix segfault when executing an erroneous query after DEALLOCATE a named statement.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=546">bug 546</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-04 [3ba4e73]
+ -->
+ <para>
+ Doc: mention that VIP will not be brought up if quorum does not exist. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-16 [956c040]
+ -->
+ <para>
+ Add "-I" option to <xref linkend="guc-arping-cmd"> command default setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-11>
+ <title>Release 3.7.11</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-08-15</simpara>
+ </note>
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-08-08 [94b0ce1]
+ -->
+ <para>
+ Import some of memory manager debug facilities from <productname>PostgreSQL</productname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-07-24 [d3493f7]
+ -->
+ <para>
+ Use <function>pg_get_expr()</function> instead of <literal>pg_attrdef.adsrc</literal> to support for <productname>PostgreSQL</productname> 12. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-11 [c553e51]
+ 2019-08-08 [94364ad]
+ 2019-07-17 [5730d28]
+ 2019-07-02 [b364caa]
+ -->
+ <para>
+ Enhance shutdown script of <xref linkend="PGPOOL-SETUP">. (Tatsuo Ishii)
+ <itemizedlist>
+ <listitem>
+ <para>
+ Make shutdownall to wait for completion of shutdown of <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If environment variable <varname>CHECK_TIME_WAIT</varname> is set to true, use <command>netstat</command> command to confirm usage of the <literal>TCP/IP</literal> port while executing shutdown script.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-02 [45f0160]
+ -->
+ <para>
+ Doc: add description to <xref linkend="PG-MD5"> man page how to show <filename>pool_passwd</filename> hashed string. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-26 [e21e7a9]
+ -->
+ <para>
+ Doc: add general description about failover. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-05-22 [57cd1d4]
+ -->
+ <para>
+ Deal <literal>pgpool_adm</literal> extension with <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-08-09 [c896d21]
+ -->
+ <para>
+ Fix "unable to bind. cannot get parse message" error.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=531">bug 531</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-08 [0da5292]
+ -->
+ <para>
+ Fix online-recovery is blocked after a child process exits abnormally with replication mode and watchdog.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=483">bug 483</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-16 [0dbf6eb]
+ -->
+ <para>
+ Fix for keep the backend health check running on quarantined nodes. (Muhammad Usama)
+ </para>
+ <para>
+ Pgpool should keep the backend health check running on quarantined nodes so
+ that when the connectivity resumes, they should automatically get removed
+ from the quarantine.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-April/003295.html">[pgpool-hackers: 3295]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-07 [2d7702c]
+ -->
+ <para>
+ Fix for no primary on standby pgpool when primary is quarantined on master. (Muhammad Usama)
+ </para>
+ <para>
+ Master watchdog Pgpool sends the backend status sync message if the primary node is quarantined on it.
+ So standby watchdog pgpool must not update its status when the status of current primary node
+ is not DOWN.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-29 [9b830d9]
+ -->
+ <para>
+ Fix <xref linkend="WATCHDOG-SETUP"> command <literal>mode</literal> option to work correctly. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-28 [fbe8fdc]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to produce correct follow master command. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [44f8e2d]
+ -->
+ <para>
+ Fix query cache module so that it checks oid array's bound. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [ae45e93]
+ -->
+ <para>
+ Fix off-by-one error in query cache module. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-05 [27c2476]
+ -->
+ <para>
+ Allow health check process to reload. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-03 [380d8a5]
+ -->
+ <para>
+ Fix segfault when query cache is enabled. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=525">bug 525</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-02 [b8137d6]
+ -->
+ <para>
+ Down grade LOG "checking zapping sent message ..." to DEBUG5. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006678.html">[pgpool-general: 6620]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-24 [057a635]
+ -->
+ <para>
+ Fix segfault when <literal>samenet</literal> is specified in <filename>pool_hba.conf</filename>. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006659.html">[pgpool-general: 6601]</ulink>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-20 [957e3f8]
+ 2019-06-19 [79ae3f7]
+ 2019-06-19 [df42ac3]
+ -->
+ <para>
+ Doc: Fix documentation mistakes in <filename>follow_master.sh</filename> script and typos. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-11 [b9ee841]
+ -->
+ <para>
+ Fix health check process is not shutting down in certain cases. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-07 [9d7c5ba]
+ -->
+ <para>
+ Fix to deal with backslashes according to the config of <varname>standard_conforming_strings</varname> in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=467">bug 467</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [81b9c11]
+ -->
+ <para>
+ Fix compile error on FreeBSD.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=512">bug 512</ulink>,
+ <ulink url="https://www.pgpool.net/mantisbt/view.php?id=519">bug 519</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-14 [0d6fdbc]
+ 2019-05-23 [0e8c1c2]
+ 2019-05-22 [c264275]
+ 2019-05-22 [53e7af0]
+ 2019-05-22 [19cfda2]
+ -->
+ <para>
+ Fix memory leaks. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [827a056]
+ -->
+ <para>
+ Make failover in progress check more aggressively to avoid potential segfault. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-10>
+ <title>Release 3.7.10</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-05-16</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-04 [9088c76]
+ -->
+ <para>
+ Doc: Improve <xref linkend="PCP-COMMANDS"> document. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-03 [7a6ddad]
+ -->
+ <para>
+ Speed up failover when all of backends are down. (Tatsuo Ishii)
+ </para>
+ <para>
+ If all of the backend are in down status, immediately give up finding
+ primary node regardless search_primary_node_timeout and promptly
+ finish the failover process.
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-May/003321.html">[pgpool-hackers: 3321]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-30 [b77a5b9]
+ 2019-04-30 [843e1c5]
+ -->
+ <para>
+ pgpool-recovery extension and <command>pgpool_setup</> is now ready for the next major release <productname>PostgreSQL</> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-04-10 [c845e30]
+ 2019-04-09 [5d2078b]
+ -->
+ <para>
+ Doc: add <xref linkend="RESTRICTIONS"> entry. (Takuma Hoshiai)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-09 [1f5c59d]
+ -->
+ <para>
+ Fix the wrong error message "ERROR: connection cache is full", when all backend nodes are down.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=487">bug 487</>) (Bo Peng)
+ </para>
+ <para>
+ When all backend nodes are down, <productname>Pgpool-II</> throws an incorrect
+ error message "ERROR: connection cache is full". Change the error
+ message to "all backend nodes are down, pgpool requires at least one valid node".
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-24 [3ea843d]
+ -->
+ <para>
+ Remove unused .sgml file. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-21 [5085343]
+ -->
+ <para>
+ Avoid exit/fork storm of pool_worker_child process. (Tatsuo Ishii)
+ </para>
+ <para>
+ pool_worker_child issues query to get WAL position using <function>do_query()</>,
+ which could throws FATAL error. In this case pool_worker_child process
+ exits and <productname>Pgpool-II</> parent immediately forks new process. This cycle
+ indefinitely repeats and gives high load to the system.
+ To avoid the exit/fork storm, sleep <varname>sr_check_period</>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-18 [56a1fd8]
+ -->
+ <para>
+ Fix <xref linkend="GUC-WRITE-FUNCTION-LIST">'s broken default value. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-17 [cd6525b]
+ -->
+ <para>
+ Fix "not enough space in buffer" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=499">bug 499</>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The error occurred while processing error message returned from
+ backend and the cause is that the query string in question is too
+ big. Problem is, the buffer is in fixed size (8192 bytes).
+ Eliminate the fixed size buffer and use palloced buffer
+ instead. This also saves some memory copy work.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-16 [97924be]
+ -->
+ <para>
+ Fix DROP DATABASE failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-10 [85cef44]
+ -->
+ <para>
+ Fix wrong variable in <function>read_status_file()</> function.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=493">bug 493</>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-08 [60ec0cb]
+ -->
+ <para>
+ Add missing <filename>test/watchdog_setup</> to EXTRA_DIST. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=470">bug 470</>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-07 [c4d8988]
+ -->
+ <para>
+ Doc: mention that multi-statement queries are sent to primary node only. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=492">bug 492</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-03 [713abae]
+ -->
+ <para>
+ Test: Fix occasional regression test failure of 014.watchdog_test_quorum_bypass. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-02 [00001c4]
+ -->
+ <para>
+ Abort session if failover/failback is ongoing to prevent potential segfault.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=481">bug 481</ulink>,
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=482">bug 482</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-30 [508f1c4]
+ 2019-03-30 [d96aef8]
+ -->
+ <para>
+ Fix compiler warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-28 [852f8b5]
+ -->
+ <para>
+ Fix memory leak in "batch" mode in extended query.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=468">bug 468</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-9>
+ <title>Release 3.7.9</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-03-29</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-27 [14e516c]
+ -->
+ <para>
+ Add new configuration option <xref linkend="guc-ssl-prefer-server-ciphers">. (Muhammad Usama)
+ </para>
+ <para>
+ Add the new setting <xref linkend="guc-ssl-prefer-server-ciphers"> to let users configure if they
+ want client's or server's cipher order to take preference.
+ </para>
+ <para>
+ The default for this parameter is off, which prioritize the client's
+ cipher order as usual. However this is just for keeping backward
+ compatibility, and it is possible that a malicious client uses weak
+ ciphers. For this reason we recommend to set this parameter to on at
+ all times.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-27 [c4cf944]
+ 2019-03-23 [baba568]
+ -->
+ <para>
+ Allow to set a client cipher list. (Tatsuo Ishii, Yugo Nagata)
+ </para>
+ <para>
+ For this purpose new parameter <xref linkend="guc-ssl-ciphers">, which specifies the cipher
+ list to be accepted by <productname>Pgpool-II</>, is added.
+ This is already implemented in <productname>PostgreSQL</> and useful to enhance security when SSL is enabled.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-18 [486a766]
+ -->
+ <para>
+ Fix unnecessary <function>fsync()</> to <filename>pgpool_status</> file. (Tatsuo Ishii)
+ </para>
+ <para>
+ Whenever new connections are created to PostgreSQL backend, <function>fsync()</>
+ was issued to <filename>pgpool_status</> file, which could generate excessive I/O
+ in certain conditions.
+ So reduce the chance of issuing <function>fsync()</> so that it is issued only when
+ backend status is changed.
+ </para>
+ <para>
+ Discussion: <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-February/006494.html">[pgpool-general: 6436]</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-8>
+ <title>Release 3.7.8</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-02-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-02-15 [e462e7c]
+ -->
+ <para>
+ Test: Fix old JDBC functions and typos in regression test 068.memqcache_bug. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-15 [b79d7ce]
+ -->
+ <para>
+ Doc: Fix configuration change timing regarding <xref linkend="GUC-MEMORY-CACHE-ENABLED">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-12 [c27204b]
+ -->
+ <para>
+ Fix online recovery failed due to <xref linkend="GUC-CLIENT-IDLE-LIMIT-IN-RECOVERY"> in certain cases.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=431">bug 431</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-05 [576d1b0]
+ -->
+ <para>
+ Reduce memory usage when large data set is returned from backend.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=462">bug 462</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-05 [3ed77b7]
+ -->
+ <para>
+ Test: Fix syntax error in extended query test script. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-29 [3645252]
+ -->
+ <para>
+ Fix corner case bug when <function>strip_quote()</function> handle a empty query string. <ulink url="http://www.pgpool.net/mantisbt/view.php?id=458">(bug 458</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-27 [30840d7]
+ -->
+ <para>
+ Doc: Mention that schema qualifications cannot be used in white/black_function_list. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-23 [2bce812]
+ -->
+ <para>
+ Fix typo about wd_priority in <command>watchdog_setup</command>. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-10 [3a27f10]
+ -->
+ <para>
+ Fix Pgpool child segfault if failover occurs when trying to establish a connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-03 [520649b]
+ -->
+ <para>
+ Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-12 [5625f06]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang if a client sends a extended query message such as close after sync message but before next simple query. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-December/003164.html">[pgpool-hackers: 3164]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-06 [f3da002]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when <varname>idle_in_transaction_session_timeout = on</varname>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=448">bug 448</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-12-05 [6a37de1]
+ -->
+ <para>
+ Doc: Fix Japanese document typo in <xref linkend="PCP-COMMON-OPTIONS">. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-3-7-7>
+ <title>Release 3.7.7</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-11-22</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-11-21 [14af2f3]
+ -->
+
+ <para>
+ Fix to sort startup packet's parameters sent by client.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=444">bug 444</ulink>)(Takuma Hoshiai)
+ </para>
+ <para>
+ If order of startup packet's parameters differ between cached connection
+ pools and connection request, didn't use connection pool ,and created new
+ connection pool.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-13 [2f5942f]
+ -->
+
+ <para>
+ Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=443">bug 443</ulink>)(Bo Peng)
+ </para>
+ <para>
+ If the number of parameter format codes is specified to one, but the number
+ of the original query's parameter is zero, <function>bind_rewrite_timestamp()</> will call <function>memcpy</> with a negative value.
+ This causes segmentation fault.
+ </para>
+ <para>
+ Patch is provided by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-08 [fe23abd]
+ -->
+
+ <para>
+ Fix a query passed to relcache so that it uses schema qualified table name. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-05 [b6dd79b]
+ -->
+
+ <para>
+ Fix query cache invalidation bug. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-03 [d0bdefa]
+ -->
+
+ <para>
+ Fix segfault in extended query + query cache case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-01 [c04d979]
+ -->
+ <para>
+ Fix memory leak in extended query + query cache enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-7-6">
+ <title>Release 3.7.6</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-30 [3d0311b]
+ -->
+ <para>
+ Allow <command>PCP[attach/detach/promote]</command> commands during failover. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [8cc799a]
+ -->
+ <para>
+ Change <filename>pgpool.spec</filename> file to install extension to DB server which supports LLVM JIT. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-10 [1cff05c]
+ -->
+ <para>
+ Doc: Add note to online recovery doc. (Tatsuo Ishii)
+ </para>
+ <para>
+ This warns that <xref linkend="guc-client-idle-limit-in-recovery"> must be smaller than <xref linkend="guc-recovery-timeout">.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-29 [209ef0e]
+ -->
+ <para>
+ Test: Add regression test for SSL connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-22 [760e6eb]
+ -->
+ <para>
+ Doc: Add notes regarding failover script. (Tatsuo Ishii)
+ </para>
+ <para>
+ It's not recommended to access against <productname>Pgpool-II</productname> itself from failover/failback scripts.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-14 [2c15faa]
+ -->
+ <para>
+ Doc: Improve <xref linkend="PG-MD5"> docs and error message. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen and modified by me.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [0e3b085]
+ -->
+ <para>
+ Test: Add definition of PGLIB in <filename>regress.sh</filename>. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-25 [1bea94d]
+ -->
+ <para>
+ Fix typo in <varname>child_max_connections</varname> description of <command>SHOW POOL_STATUS</command> output. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Phil Ramirez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-22 [5bbce64]
+ -->
+ <para>
+ Fix segmentation fault when error query and Sync message are sent in native replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=434">bug 434</ulink>) (Takuma Hoshiai)
+ </para>
+ <para>
+ In native replication mode, segmentation fault occurs when Sync messages is sent just after a query error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-18 [d532925]
+ -->
+ <para>
+ Fix syntax error when queries including time functions and <literal>IN (SELECT ...)</literal> in
+ <literal>WHERE</literal> clause in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=433">bug 433</ulink>) (Bo Peng)
+ </para>
+ <para>
+ In native replication mode, queries including time functions (e.g. <function>now()</function>, <function>CURRENT_TIMESTAMP</function> etc.) are rewritten to a timestamp constant value.
+ However, <productname>Pgpool-II</productname> doesn't support queries including time functions and <literal>IN (SELECT ...)</literal> in <literal>WHERE</literal> clause.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-12 [7a58317]
+ -->
+ <para>
+ Fix occasional less data returned to frontend with extended protocol. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=432">bug432</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The idea for fix is, use pending message data list. It records
+ messages from frontend, and it is expected that we will receive same
+ number of messages.
+ </para>
+ <para>
+ Initial patch is created by Yugo Nagata and fixed by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [d620888]
+ -->
+ <para>
+ Fix memory leak when query cache enabled in streaming replication mode + extended query case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-11 [1413c7f]
+ -->
+ <para>
+ Fix memory leak in <function>trigger_failover_command()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [43e25be]
+ -->
+ <para>
+ Fix memory leak when memory_cache_enabled = on and write SQLs are sent. (Bo Peng)
+ </para>
+ <para>
+ In a explicit transaction, the <literal>SELECT</literal> results are cached in temporary buffer.
+ If a write <acronym>SQL</acronym> is sent which modifies the table, the temporary buffer should be reset.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-09 [e2cdd31]
+ -->
+ <para>
+ Test: Fix occasional failure in regression 065.bug152. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-21 [9f0528b]
+ -->
+ <para>
+ Test: Add <literal>EXECUTE/DEALLOCATE</literal> regression test. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-19 [cdd734e]
+ -->
+ <para>
+ Add missing <filename>pgpool_recovery--1.0--1.1.sql</filename> file to update
+ <function>pgpool_recovery()</function> function version to 1.1. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-09-13 [e22933a]
+ -->
+ <para>
+ Fix kind mismatch error when <literal>DEALLOCATE</literal> statement is issued. (Bo Peng)
+ </para>
+ <para>
+ <literal>PREPARE</literal> should be add to pool_add_sent_message,
+ so that <literal>EXECUTE</literal> and <literal>DEALLOCATE</literal>
+ can be sent to the same node as <literal>PREPARE</literal>.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-September/006284.html">[pgpool-general: 6226]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-27 [7e9c385]
+ -->
+ <para>
+ Do not update <xref linkend="guc-pool-passwd"> if the password length is incorrect.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=419">bug 419</ulink>) (Takuma Hoshiai, Tatsuo Ishii)
+ </para>
+ <para>
+ For <productname>Pgpool-II</productname> 3.7 or before, the password stored in
+ <xref linkend="guc-pool-passwd"> is <literal>MD5</literal> password only.
+ So check the correctness of <xref linkend="guc-pool-passwd"> by scanning entire file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-20 [57b43ae]
+ -->
+ <para>
+ Doc: Change <xref linkend="GUC-FOLLOW-PRIMARY-COMMAND"> description "new master" to "new primary". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-16 [bca1eaa]
+ -->
+ <para>
+ Fix newer version of gcc warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [2aae169]
+ -->
+ <para>
+ Test: Update <filename>clean.sh</filename> which clean up regression test results. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-10 [6c261b3]
+ -->
+ <para>
+ Add .gitignore files. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-05 [a2f3ac6]
+ -->
+ <para>
+ Fix segfault when node 0 is in down status in case of both health check
+ and <xref linkend="guc-failover-on-backend-error"> are disabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-03 [09a3ae1]
+ -->
+ <para>
+ Doc: Fix typos in documents and scripts. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Jesper Pedersen.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-01 [f5eddf0]
+ -->
+ <para>
+ Doc: Fix document mistakes of <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> and <xref linkend="GUC-RECOVERY-2ND-STAGE-COMMAND">. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+
+<sect1 id="release-3-7-5">
+ <title>Release 3.7.5</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-07-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-07-10 [3a3045f]
+ -->
+ <para>
+ Allow not to use <filename>pool_passwd</> in raw mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=411">bug 411</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Since in raw there's only 1 backend is actually involved, there's no
+ need to use pool_passwd with <literal>md5</> authentication.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-04 [17be8d4]
+ -->
+ <para>
+ Fix "write on backend 0 failed with error :"Success"" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=403">bug 403</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Don't treated it as an error if <function>write()</function> returns 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-03 [bbdf0d9]
+ -->
+ <para>
+ Fix for 0000409: worker process is not restarted after failover on standby <productname>Pgpool-II</>.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=409">bug 409</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ Patch contributed by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-28 [1648cb8]
+ -->
+ <para>
+ Fix for 0000406: failover called with wrong old-primary.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=406">bug 406</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-22 [07380e4]
+ -->
+ <para>
+ Fixed that the health check process was not started after failed back.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=407">bug 407</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-20 [a50025b]
+ -->
+ <para>
+ Fix memory leaks related to <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [02c49ae]
+ -->
+ <para>
+ Fix an incorrect declare as bool, rather than int in <function>pool_extract_error_message()</function>. (Tatsuo Ishii)
+ </para>
+ <para>
+ This led to a segfault issue mentioned on certain platform.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-19 [cada384]
+ -->
+ <para>
+ Fix segfault in <function>per_node_error_log()</function> on armhf architecture. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Christian Ehrhardt.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-14 [3c02bd0]
+ -->
+ <para>
+ Fix for wrong backend roles on standby after the failover. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-24 [68f9645]
+ -->
+ <para>
+ Doc: Improve documents of "MD5 Password Authentication", "Installing Pgpool-II" and "pg_md5".(Bo Peng)
+ </para>
+ <para>
+ Patch provided by Takuma Hoshiai.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-06-20 [2e87b18]
+ 2018-07-11 [801927a]
+ -->
+ <para>
+ Test: Fix 006.memqcache test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-7-4">
+ <title>Release 3.7.4</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-06-12</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-05-31 [068f867]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hung if replication delay is too much, when query cache enabled in extended query mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general-jp/2018-May/001533.html">[pgpool-general-jp: 1534]</ulink>
+ for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-30 [272744b]
+ -->
+ <para>
+ Doc: Fix document typo of PCP commands option "-U". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-24 [29f7e00]
+ -->
+ <para>
+ Delete some debug code. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-24 [61b183c]
+ -->
+ <para>
+ In extended query mode, do not set writing tx flag with SET TRANSACTION READ ONLY. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-23 [92cbc38]
+ -->
+ <para>
+ Fix wrong parameter %P (old primary node id) passed to failover script in 3.7.3 and 3.7.2. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-17 [5ce01ab]
+ -->
+ <para>
+ Doc: Clarify that <xref linkend="guc-failover-require-consensus"> requires that health check is enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-09 [d272885]
+ -->
+ <para>
+ Doc: Update outdated <xref linkend="PCP-PROC-INFO"> manual. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-08 [041fe59]
+ -->
+ <para>
+ Test: Fix test.sh in extended_query_test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-04 [451d8a5]
+ -->
+ <para>
+ Add missing health_check_timeout in <command>pgpool_setup</command>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-04 [e7c262f]
+ -->
+ <para>
+ Doc: Enhance online recovery document to Clarify
+ that <xref linkend="guc-recovery-2nd-stage-command"> is only required in native replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-18 [ffa545e]
+ -->
+ <para>
+ Prevent <xref linkend="PCP-RECOVERY-NODE"> from recovering "unused" status node. (Tatsuo Ishii)
+ </para>
+ <para>
+ This allowed to try to recovery a node without configuration data,
+ which leads to variety of problems.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-March/006021.html">[pgpool-general: 5963]</ulink>
+ for more details.
+ </para>
+ <para>
+ Also I fixed <function>pgpool_recovery</function> function so that it quotes an
+ empty string argument with double quotes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-7-3">
+ <title>Release 3.7.3</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-04-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-04-17 [7ce2a02]
+ -->
+ <para>
+ Disable health check per node parameters by default. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-13 [d07c908]
+ -->
+ <para>
+ Fix <xref linkend="pcp-detach-node"> hung when -g option is specified. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=391">bug 391</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-09 [1fb3008]
+ -->
+ <para>
+ Test: Add new regression test for node 0 is down. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-08 [046a855]
+ -->
+ <para>
+ Make calls to to_regclass fully schema qualified. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-05 [af4ea10]
+ -->
+ <para>
+ Fix pgpool child process segfault when ALWAYS_MASTER is on. (Tatsuo Ishii)
+ </para>
+ <para>
+ If following conditions are all met pgpool child segfaults:
+ <orderedlist>
+ <listitem>
+ <para>
+ Streaming replication mode.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ fail_over_on_backend_error is off.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ALWAYS_MASTER flag is set to the master (writer) node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <filename>pgpool_status</filename> file indicates that the node mentioned in #3 is in down status.
+ </para>
+ </listitem>
+ </orderedlist>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-04 [ec494b8]
+ -->
+ <para>
+ Doc: Improve watchdog documents. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-30 [d4b52e6]
+ -->
+ <para>
+ Doc: Add a document for adding new config parameter. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-20 [45b45bd]
+ -->
+ <para>
+ Test: Improve test script 003.failover. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-14 [fc69c68]
+ -->
+ <para>
+ Deal with "unable to bind D cannot get parse message "S1" error. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-03-02 [121bf41]
+ -->
+ <para>
+ Doc: Mention that users can avoid failover using backend_flag even PostgreSQL admin shutdown. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-28 [8593af6]
+ -->
+ <para>
+ Doc: Fix document typos. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [f0c510f]
+ -->
+ <para>
+ Test: Add new regression test for node 0 not being primary. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [45e9699]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> failure in replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [40647e2]
+ -->
+ <para>
+ Allow to support <function>pgpool_switch_xlog</function> <productname>PostgreSQL</productname> 10. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-26 [e8baa3f]
+ -->
+ <para>
+ Revert "Fix pgpool child process segfault when ALWAYS_MASTER is on." (Tatsuo Ishii)
+ </para>
+ <para>
+ With the <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=9022ff842fb5dbbe06e2f2f4cf38fadf47b592da">commit</ulink>,
+ write queries are always sent to node 0 even if the
+ primary node is not 0 because PRIMARY_NODE_ID macro returns
+ REAL_MASTER_NODE_ID, which is usually 0. Thus write queries are failed
+ with:
+ ERROR: cannot execute INSERT in a read-only transaction
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-19 [a3e2c68]
+ -->
+ <para>
+ Test: Enhance extended query test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-14 [ab93bb7]
+ -->
+ <para>
+ Doc: Fix <link linkend="pgpool-adm"> pgpool_adm</link> family functions examples. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-7-2">
+ <title>Release 3.7.2</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-02-13</simpara>
+ </note>
+ <note>
+ <para>
+ This release fixed the bug with socket writing added in Pgpool-II 3.7.0, 3.6.6 and 3.5.10. Due to this bug, when the network load is high, an illegal message may be sent to the frontend or backend. All users using 3.7.x, 3.6.6 or later, 3.5.10 or later versions of Pgpool-II should update as soon as possible.
+ </para>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-02-10 [6c77a9e]
+ -->
+ <para>
+ Allow to build with <literal>libressl</>. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-February/002714.html">[pgpool-hackers: 2714]</ulink> for more details. Patch by Sandino Araico Sanchez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [144e7a8]
+ -->
+ <para>
+ Set TCP_NODELAY and non blocking to frontend socket. (Tatsuo Ishii)
+ </para>
+ <para>
+ TCP_NODELAY is employed by <productname>PostgreSQL</>, so do we it.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [9357d76]
+ -->
+ <para>
+ Change systemd service file to use <varname>STOP_OPTS=" -m fast"</>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-19 [d1565e7]
+ -->
+ <para>
+ Change <command>pgpool_setup</> to add restore_command in <filename>recovery.conf</>. (Bo Peng)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-02-09 [324768d]
+ -->
+ <para>
+ Fix writing transaction flag is accidentally set at commit or rollback. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-01 [ff0b66e]
+ -->
+ <para>
+ Throw a warning message when failover consensus settings on watchdog nodes differs. (Muhammad Usama)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-31 [8f9e406]
+ -->
+ <para>
+ Doc: Fix document typo. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [22f739a]
+ -->
+ <para>
+ Fix bug with socket writing. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>pool_write_flush()</function> is responsible for writing to sockets when pgpool's
+ write buffer is full (this function was introduced in 3.6.6 etc). When
+ network write buffer in kernel is full, it does retrying but it forgot
+ to update the internal buffer pointer. As a result, broken data is
+ written to the socket. This results in variety of problems including
+ too large message length.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-29 [36517db]
+ -->
+ <para>
+ Fix pgpool child process segfault when ALWAYS_MASTER is on. (Tatsuo Ishii)
+ </para>
+ <para>
+ If following conditions are all met pgpool child segfaults:
+ <orderedlist>
+ <listitem>
+ <para>
+ Streaming replication mode.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ fail_over_on_backend_error is off.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ALWAYS_MASTER flags is set to the master (writer) node.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ pgpool_status file indicates that the node mentioned in #3 is in down status.
+ </para>
+ </listitem>
+ </orderedlist>
+
+
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-January/002687.html">[pgpool-hackers: 2687]</ulink> and <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-January/005939.html">[pgpool-general: 5881]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-24 [1a4dfec]
+ -->
+ <para>
+ Fix segfault when %a is in <varname>log_line_prefix</> and debug message is on. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=376">bug 376</ulink>) (Tatsuo Ishii)
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-23 [b6bc607]
+ -->
+ <para>
+ Fix per node health check parameters types. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-18 [c5c72c3]
+ -->
+ <para>
+ Fix queries hanging in <function>parse_before_bind</> with extended protocol and replication + load-balancing. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=377">bug 377</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-7-1">
+ <title>Release 3.7.1</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-01-09</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-01-08 [4427782]
+ -->
+ <para>
+ Improve Makefiles. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Tomoaki Sato.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-01-06 [915c6df]
+ 2017-12-21 [b515794]
+ -->
+ <para>
+ Doc: Fix document typo and mistakes. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-22 [e67b610]
+ -->
+ <para>
+ Replace <command>/bin/ed</command> with <command>/bin/sed</command> in <xref linkend="pgpool-setup">, because <command>/bin/sed</command> is included in most distribution's base packages. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-21 [6388631]
+ -->
+ <para>
+ Change the <filename>pgpool.service</filename> and sysconfig files to output <productname>Pgpool-II</productname> log. (Bo Peng)
+ </para>
+ <para>
+ Removing "Type=forking" and add OPTS=" -n" to
+ run <productname>Pgpool-II</productname> with non-daemon mode, because we need to redirect logs.
+ Using <command>"journalctl"</command> command to see <productname>Pgpool-II</productname> systemd log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-19 [d712067]
+ -->
+ <para>
+ Add documentation <link linkend="install-docs">"Compiling and installing documents"</link> for SGML document build. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-19 [88108ba]
+ -->
+ <para>
+ Fix per node health check parameters ignored. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=371">bug 371</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Also <xref linkend="pgpool-setup"> is modified to add appropriate
+ per node health check parameters to <filename>pgpool.conf</filename>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-19 [7898d48]
+ -->
+ <para>
+ Fix health checking process death and forking forever. (Tatsuo Ishii)
+ </para>
+ <para>
+ When failed to read from backend socket (this could happen when wrong
+ health_check_user is specified), the health check process raises a
+ FATAL error in pool_read(), which causes death of health check
+ process. And <productname>Pgpool-II</productname> main forks off
+ a new health check process. This repeats forever.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-17 [b974f5f]
+ 2017-12-18 [646477a]
+ -->
+ <para>
+ Fix timestamp data inconsistency by replication mode. (Bo Peng)
+ </para>
+ <para>
+ From <productname>PostgreSQL</productname>10 the column
+ default value such as 'CURRENT_DATE' changes,
+ <productname>Pgpool-II</productname> didn't rewrite
+ timestamp by the added default values.
+ This caused data inconsistency.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-14 [5281126]
+ -->
+ <para>
+ Doc: Fix <xref linkend="watchdog-setup"> doc. (Tatsuo Ishii)
+ </para>
+ <para>
+ It lacked to mention that it supports logical replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-14 [4fa846b]
+ -->
+ <para>
+ Downgrade a log message to debug message. (Tatsuo Ishii)
+ </para>
+ <para>
+ That was mistaken left while last development cycle.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-13 [51a8687]
+ -->
+ <para>
+ Test: Add test data for <ulink url="http://www.pgpool.net/mantisbt/view.php?id=370">bug 370</ulink>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [73269e2]
+ -->
+ <para>
+ Fix for re-sync logic in reading packet from backend. (Tatsuo Ishii)
+ </para>
+ <para>
+ <function>read_kind_from_backend()</function>, which reads message kind
+ from backend, re-syncs backend nodes when a ready for query message is
+ received. Unfortunately it forgot to call
+ <function>pool_pending_message_pull_out()</function> to delete sync
+ pending message. This leads to random stuck while reading packets
+ from backend. Fix this to call <function>pool_pending_message_pull_out()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-12 [0e658bb]
+ -->
+ <para>
+ Fix Pgpool-II hangs. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=370">bug 370</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ If an erroneous query is sent to primary and without a sync message
+ the next query that requires a catalog cache look up is send,
+ <productname>Pgpool-II</productname> hangs in <function>do_query()</function>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-10 [ec3350c]
+ -->
+ <para>
+ Fix returning transaction state when "ready for query" message received. (Tatsuo Ishii)
+ </para>
+ <para>
+ We return primary or master node state of ready for query message to
+ frontend. In most cases this is good. However if other than primary
+ node or master node returns an error state (this could happen if load
+ balance node is other than primary or master node and the query is an
+ erroneous SELECT), this should be returned to frontend, because the
+ frontend already received an error.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-12-10 [3018f66]
+ -->
+ <para>
+ Test: Fix bug with extended-query-test test driver. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-11-23 [6664ce2]
+ 2017-11-23 [87ebfb7]
+ -->
+ <para>
+ Doc: Enhance document <link linkend="running-mode">"Running mode of Pgpool-II"</link>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-3-7">
+ <title>Release 3.7</title>
+
+ <note>
+ <title>Release Date</title>
+ <simpara>2017-11-22</simpara>
+ </note>
+
+ <sect2>
+ <title>Overview</title>
+ <para>
+ This version improves reliability of failover by using new
+ watchdog feature and per node health check. Also this version
+ adapts to changes in PostgreSQL 10: new SQL parser, logical
+ replication and some admin functions name changes.
+ </para>
+ <para>
+ Major enhancements in <productname>Pgpool-II</productname> 3.7 include:
+ </para>
+
+ <!-- Items in this list summarize one or more items below -->
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Quorum aware failover feature.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Allow specifying the hostnames in pool_hba.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Allow to specify per node health check parameters.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Support AWS Aurora.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Import PostgreSQL 10 SQL parser
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Support logical replication.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Major Enhancements</title>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-09-18 [54af632]
+ 2017-10-03 [12bd99b]
+ -->
+ <para>
+ Quorum and Consensus for backend failover. (Muhammad Usama)
+ </para>
+ <para>
+ Add ability in the Pgpool-II to considers the existence of
+ quorum and seek the majority node (Pgpool-II nodes part of
+ the watchdog cluster) consensus to validate the backend node
+ failover request. This feature helps make failover decision
+ better and prevent split brain scenarios.
+ </para>
+
+ <para>
+ The addition of this feature also made some modification in
+ the execution behavior of the failover (failover, failback,
+ promote-node) command.
+ </para>
+
+ <para>
+ Now only the Master node performs the failover, and the failover
+ locks are removed.
+ </para>
+
+ <para>
+ Three new configuration parameters to configure the failover
+ behavior from user side: failover_when_quorum_exists,
+ failover_require_consensus,
+ enable_multiple_failover_requests_from_node.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-20 [3cc5235]
+ -->
+ <para>
+ Allow specifying the hostnames in pool_hba. (Muhammad Usama)
+ </para>
+ <para>
+ The commit adds the support of hostnames to be used in the
+ address field of pool_hba records, previously only CIDR
+ address was supported.
+ </para>
+
+ <para>
+ Along with allowing the hostnames in address field of the
+ HBA record the commit also made the following enhancements
+ in the area.
+ </para>
+
+ <para>
+ (1) pool_hba records are now completely parsed at the
+ loading time and we now keep the structured data of records
+ instead of raw record lines, This saves the parsing at every
+ new connection time and however little it may be but its a
+ performance enhancement.
+ </para>
+ <para>
+ (2) Enhanced parsing now gives the better descriptive
+ error/log messages.
+ </para>
+
+ <para>
+ (3) Better handling of auth-options field.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-20 [127e64f]
+ 2017-04-26 [c0d209d]
+ 2017-05-16 [18f4d2e]
+ 2017-05-31 [cbf1268]
+ -->
+ <para>
+ Supporting per node health check parameters. (Tatsuo Ishii,
+ Muhammad Usama)
+ </para>
+ <para>
+ Previous implementation of health check is a single serial
+ processing for all of database nodes.
+ </para>
+ <para>
+ Now pgpool main process forks health check process for each
+ DB node. This commit enables all health-check related
+ parameter to be configured for each individual backend
+ nodes.
+ </para>
+ <para>
+ For example if we have 3 backend nodes and do following
+ configurations.
+ </para>
+ <programlisting>
+ health_check_period = 10
+ health_check_period0 = 5
+ </programlisting>
+
+ <para>
+ Then will set the health_check_period for node 0 to 5 while
+ node-id 1 and 2 will get the value 10
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-03 [57196ae]
+ -->
+ <para>
+ Import PostgreSQL 10 SQL parser. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-12 [e9b241e]
+ 2017-07-12 [6bbcfe7]
+ 2017-07-12 [b61019e]
+ 2017-07-13 [e626055]
+ 2017-07-12 [ea1a6b9]
+ -->
+ <para>
+ Support AWS Aurora. (Tatsuo Ishii)
+ </para>
+ <para>
+ Add new backend flag "ALWAYS_MASTER" to control the primary
+ node detecting logic. Since we cannot use
+ pg_is_in_recovery() in Aurora, we assign the new flag to a
+ backend which is specified as "writer" in Aurora. Since
+ Aurora always use the same hostname for the master (it's
+ called "writer"), find_primary_node() just returns the node
+ id which has ALWAYS_MASTER flag on.
+ </para>
+ <para>
+ See more details about ALWAYS_MASTER
+ flag <xref linkend="backend-flag-table">.
+ </para>
+ <para>
+ Other than that, user can use the streaming replication mode
+ with Aurora. Notice that replication delay cannot be
+ performed in Aurora, sr_check_period should be always 0.
+ </para>
+ <para>
+ Also add English/Japanese Aurora setting example.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-08-17 [184b412]
+ 2017-08-17 [88c5c11]
+ -->
+ <para>
+ Support logical replication. (Tatsuo Ishii)
+ </para>
+ <para>
+ The logical replication mode can be used
+ with <productname>PostgreSQL</productname> servers operating
+ logical replication. In this
+ mode, <productname>PostgreSQL</productname> is responsible
+ for synchronizing tables.
+ </para>
+ <para>
+ Load balancing is possible in the mode. Since logical
+ replication does not replicate all tables, it's user's
+ responsibility to replicate the table which could be load
+ balanced.
+ </para>
+ <para>
+ The sample configuration file
+ is <filename>$prefix/etc/pgpool.conf.sample-logical</filename>.
+ </para>
+ <para>
+ And add support for logical replication mode
+ to <application>pgpool_setup</application>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Other Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-11-09 [9f12b15]
+ -->
+ <para>
+ Test: Add some watchdog test cases. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-05 [7dace77]
+ 2017-10-10 [79baaf0]
+ 2017-10-10 [6da5672]
+ 2017-10-10 [f18e099]
+ -->
+ <para>
+ Test: Add new test case "node_js.data" to extended-query-test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-10-04 [0e0d7eb]
+ -->
+ <para>
+ Doc: Documentation updates for pool_hba enhancements. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-01 [6e71926]
+ -->
+ <para>
+ Add "slony mode" to pgpool_setup. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2017-09-11 [c0f4f1a]
+ -->
+ <para>
+ Deal with OpenSSL 1.1. (Tatsuo Ishii, Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-03-29 [3dd0278]
+ -->
+ <para>
+ Test: Add new regression test "069.memory_leak_extended". (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-01-25 [91143a1]
+ -->
+ <para>
+ Doc: Enhance query cache documents. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2016-12-20 [f6659fb]
+ 2016-12-20 [5485b9b]
+ -->
+ <para>
+ Doc: Add "Tips for Installation" section. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-19 [34922b5]
+ -->
+ <para>
+ Test: Add new test 011.watchdog_quorum_failover. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-17 [3810b55]
+ -->
+ <para>
+ Test: Add new test suits. (Tatsuo Ishii)
+ </para>
+ <para>
+ The new test suit "extended-query-test" is intended to test extended
+ queries using pgproto command.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-10 [d114c19]
+ -->
+ <para>
+ Add debugging aid to check pending message and backend
+ response. (Tatsuo Ishii)
+ </para>
+ <para>
+ New function pool_check_pending_message_and_reply() added.
+ If pending message kind and backend reply message kind is
+ not inconsistent, it prints a debug message. Currently the
+ only client of the function is read_kind_from_backend().
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-08 [0f75428]
+ -->
+ <para>
+ Add debugging/testing aid for health check. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2017-10-04 [1e26fa7]
+ -->
+ <para>
+ Add "role" field to pcp_node_info command. (Tatsuo Ishii)
+ </para>
+ <para>
+ Role is the server role: one of "primary", "standby",
+ "master" or "slave".
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2017-09-01 [9ebcdbc]
+ -->
+ <para>
+ Change master_slave_sub_mode default to 'stream'. (Tatsuo Ishii)
+ </para>
+ <para>
+ This is necessary since the default value for the
+ pool_config_variable.c is STREAM_MODE.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [20e1dab]
+ -->
+ <para>
+ Allow to fork new health check process when it exits. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-05-31 [b37dcc4]
+ -->
+ <para>
+ Add new group "health_check" to PGPOOL SHOW command doc. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-04-12 [6eb7160]
+ -->
+ <para>
+ Remove old html docs and related files. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fix</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2017-10-10 [fafb82c]
+ -->
+ <para>
+ Fix Pgpool-II hanging after receiving 'H' (flush) message in streaming replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=345">bug 345</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-22 [e18632e]
+ -->
+ <para>
+ Fix exit signal handlers to not call ereport. (Tatsuo Ishii)
+ </para>
+ <para>
+ There could be a race condition in the exit signal handlers.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2017-September/002545.html">[pgpool-hackers:2545]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-09-05 [815fd17]
+ -->
+ <para>
+ Doc: Fix table about replicate_select behavior. (Yugo Nagata)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-28 [7a47b01]
+ -->
+ <para>
+ Test: Fix bug with memory leak tests and add new memory leak
+ test. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-13 [95cab40]
+ -->
+ <para>
+ Add log after health check retrying succeeds. (Tatsuo Ishii)
+ </para>
+ <para>
+ Previously only health check retry logs were produced. So it was not
+ clear if the retry succeeded or not in the end.
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2017-07-13 [1e1d1d1]
+ -->
+ <para>
+ Add necessary setting for health check retry in the Aurora
+ example. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/release-4.0.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id=release-4-0-12>
+ <title>Release 4.0.12</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-11-19</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [544cb97]
+ -->
+ <para>
+ Doc: update "Aurora Configuration Example". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [e24d792]
+ -->
+ <para>
+ Doc: mention that <acronym>GSSAPI</acronym> is not supported. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [db31d2c]
+ -->
+ <para>
+ <productname>Pgpool-II</productname> doesn't support <acronym>GSSAPI</acronym>.
+ Allow <productname>Pgpool-II</productname> to deal with <acronym>GSSAPI</acronym> encrypted connection request from frontend instead of responding with an error. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is created by me, reviewed and tested by Umar Hayat.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [94cbceb]
+ -->
+ <para>
+ Fix query rewrite syntax error of "INSERT ... ON CONFLICT" in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=654">bug 654</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-30 [37d32b9]
+ -->
+ <para>
+ Fix connection counter was not counted down when query is canceled.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=656">bug 656</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-30 [3cd8c2b]
+ -->
+ <para>
+ Doc: fix usable versions of PostgreSQL to be 7.4 or later. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-11>
+ <title>Release 4.0.11</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-09-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-13 [4e1771e]
+ -->
+ <para>
+ Follow the guide line of <productname>PostgreSQL</productname> 12.4 regarding extensions. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>CREATE OR REPLACE FUNCTION</command> should be avoided. Use <command>CREATE FUNCTION</command> instead.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-24 [0d184da]
+ -->
+ <para>
+ Replace "PGBIN" and "LPATH" in <xref linkend="PGPOOL-SETUP"> and <xref linkend="WATCHDOG-SETUP"> using PostgreSQL's bin path and lib path. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-16 [957d3b3]
+ -->
+ <para>
+ Doc: fix the incorrect description regarding the running modes of Pgpool-II in which online recovery is available. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-14 [f238eb6]
+ -->
+ <para>
+ Remove unnecessary checks in some code path. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Hou, Zhijie.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-06 [54f7767]
+ -->
+ <para>
+ Fix relcache query sometimes sent to other than primary. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, relcache queries are supposed to be
+ sent to the primary node. But actually they were not sent to the primary
+ node if primary node was not the master node. Typically this could
+ happen when the primary is not node 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-01 [8ffd26b]
+ -->
+ <para>
+ Fix <xref linkend="GUC-CONNECTION-LIFE-TIME"> not working when <xref linkend="GUC-SERIALIZE-ACCEPT"> is enabled. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-August/007233.html">[pgpool-general: 7175]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-30 [1baf413]
+ -->
+ <para>
+ Display more informative error message in authentication process. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-21 [aa1a170]
+ -->
+ <para>
+ Fix segfault in pgpool child process in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ This issue can be reproduced with the following steps:
+ <orderedlist>
+ <listitem>
+ <para>
+ Shutdown all backends.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Connect to pgpool with invalid client. I have used <command>pcp_attach_node</command> with pgpool's port number, not pcp's.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-10>
+ <title>Release 4.0.10</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-08-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [8523d12]
+ -->
+ <para>
+ Doc: mention that <xref linkend="GUC-SSL-CIPHERS"> only affects to TLS 1.2 and lower. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [fdd01d9]
+ -->
+ <para>
+ Doc: Improve the description of <xref linkend="GUC-WD-PRIORITY">. (Bo Peng)
+ </para>
+ <para>
+ Patch is provided by Kenichiro Tanaka.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [a8e3712]
+ -->
+ <para>
+ Add mention about <literal>hostssl/hostnossl</literal> to <filename>pool_hba.conf</filename> sample file. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-17 [44096e2]
+ 2020-07-16 [5115de1]
+ 2020-06-30 [8941202]
+ 2020-05-30 [6f128fc]
+ 2020-05-23 [dde82d3]
+ 2020-05-23 [7a73705]
+ 2020-07-28 [1e13a96]
+ -->
+ <para>
+ Doc: documentation improvements. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [b2dbfe2]
+ -->
+ <para>
+ At pgpool startup, if pid file exists, truncate pid file to zero length before writing. (Bo Peng)
+ </para>
+ <para>
+ Patch is created by maliangzhu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [e402d68]
+ -->
+ <para>
+ Doc: fix error in <xref linkend="GUC-FAILBACK-COMMAND"> parameter description. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [96fa3c9]
+ -->
+ <para>
+ Fix <xref linkend="guc-connection-life-time"> does not work if primary node is not 0 in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [4bd2a0d]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> problem with -r option and <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-31 [8fb0b88]
+ -->
+ <para>
+ Change PCP <literal>UNIX_DOMAIN_PATH</literal> of RPM package to <filename>/var/run/postgresql</filename>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [8108c40]
+ 2020-07-14 [70a2ac3]
+ -->
+ <para>
+ Fix query cache bugs. (Tatsuo Ishii)
+ </para>
+ <para>
+ If query cache is enable, when a table is updated, Pgpool-II should delete all the caches related to the table.
+ However, <command>EXPLAIN ANALYZE</command> and <acronym>CTE</acronym> with data-modifying SQLs
+ were mistakenly treated as normal read only query so that the query caches were not deleted.
+ </para>
+ <para>
+ Patch is created by Hou, Zhijie and modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-09 [69ae44f]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang in a corner case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-26 [a312e4b]
+ -->
+ <para>
+ If there are parameters other than "user", "database" and "application_name", reading startup packet failed. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-22 [a678a04]
+ -->
+ <para>
+ Fix miscount of connections when <function>pg_terminate_backend()</function> is executed. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-04 [6474b3f]
+ -->
+ <para>
+ Fix segmentation fault when application name is included in <xref linkend="GUC-LOG-LINE-PREFIX">. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=615">bug 615</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-02 [4799953]
+ -->
+ <para>
+ Fix incorrectly performing failover when <function>pg_terminate_backend()</function> is executed in native replication mode. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-27 [f31f781]
+ -->
+ <para>
+ Fix 004.watchdog test crash on IBM Z hardware. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=614">bug 614</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by gregn123, slightly modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-9>
+ <title>Release 4.0.9</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-05-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-05-16 [2fd983b]
+ 2020-04-26 [1304dcc]
+ -->
+ <para>
+ Fix build error on some system (Fedora 32). (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-06 [7c13a60]
+ -->
+ <para>
+ Fix pgpool ssl front end accept all ciphers. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=608">bug 608</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-26 [311cdc7]
+ -->
+ <para>
+ Downgrade too verbose authentication logs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [1221a65]
+ -->
+ <para>
+ Fix unnecessary checks. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by sherlockcpp. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007062.html">[pgpool-general: 7004]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [8ea84b9]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Umar Hayat. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-April/003587.html">[pgpool-hackers: 3587]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-16 [75432c0]
+ -->
+ <para>
+ Fix for segmentation fault in PCP process. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=598">bug 598</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-15 [595a3ec]
+ -->
+ <para>
+ Fix a warning message is never output in watchdog. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by sherlockcpp. Discussion: (<ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007014.html">[pgpool-general: 6956]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-12 [237793e]
+ 2020-04-06 [225290a]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii, Bo Peng)
+ </para>
+ <para>
+ Patch provided by sherlockcpp.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-31 [9151b53]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hangs when an Execute message is issued right after Sync message and query cache hits. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-13 [a558287]
+ -->
+ <para>
+ Fix problems in watchdog source code processing json data. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=596">bug 596</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by Greg Nancarrow (Fujitsu Australia).
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-12 [0c1649e]
+ -->
+ <para>
+ Fix <literal>SCRAM</literal> auth handling bug. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=596">bug 596</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by Greg Nancarrow (Fujitsu Australia).
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-11 [a639141]
+ -->
+ <para>
+ Fix possible data inconsistency in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussions:
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-March/006954.html">[pgpool-general: 6896]</ulink>
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-March/003540.html">[pgpool-hackers: 3540]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-06 [5ce6273]
+ -->
+ <para>
+ Fix watchdog ping probes fail with long hostnames due to small buffer. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=516">bug 516</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-02 [ffb3c59]
+ 2020-02-27 [d0774d5]
+ 2020-02-27 [f1e3ac9]
+ -->
+ <para>
+ Doc: Enhance documents. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-26 [99abd2e]
+ -->
+ <para>
+ Fix "last status change" timestamp is not set properly. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-8>
+ <title>Release 4.0.8</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-02-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2020-02-18 [e9309ba]
+ -->
+ <para>
+ Disallowing the quorum aware failover option for the native replication mode. (Muhammad Usama)
+ </para>
+ <para>
+ In native replication mode, <productname>Pgpool-II</productname>. is responsible for replicating the data
+ on all backend nodes, and if a node becomes <literal>quarantined</literal> then Pgpool-II stops
+ sending the writes to that node. This is dangerous since it can cause data inconsistency.
+ </para>
+ <para>
+ So as per the discussion, we reached the conclusion to disallow
+ <xref linkend="GUC-FAILOVER-WHEN-QUORUM-EXISTS"> with the native replication mode so that backend
+ node should never get into quarantine when Pgpool-II is configured in the replication mode.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-28 [304e091]
+ -->
+ <para>
+ Check if socket file exists at startup and remove them if PID file doesn't exist to avoid bind() failure. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-02-18 [3889f69]
+ -->
+ <para>
+ Fix incorrect query rewriting in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=551">bug 551</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-18 [47fc7fc]
+ 2020-02-17 [4dc2ec3]
+ 2020-02-12 [1581295]
+ 2020-02-04 [d4f37bb]
+ 2020-02-04 [3ca4924]
+ 2020-01-28 [6d5eda7]
+ 2020-01-13 [ee7e42c]
+ 2020-01-12 [d213f2a]
+ -->
+ <para>
+ Doc: Update documentation and fix documentation typos. (Takuma Hoshiai, Tatsuo Ishii, Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-12 [21d620d]
+ -->
+ <para>
+ Fix child process segfault after reload if <xref linkend="GUC-HEALTH-CHECK-DATABASE"> is empty.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=571">bug 571</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-08 [ade4f22]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to support <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-28 [f8bbd91]
+ -->
+ <para>
+ Doc: Change the sample follow_master_command script %M %H parameter's order. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-19 [6b8ba75]
+ 2020-01-11 [ce2f63b]
+ 2020-01-10 [0462350]
+ 2020-01-04 [9ec04f0]
+ 2019-12-31 [3818be6]
+ 2019-12-26 [6b19fbb]
+ 2019-12-24 [e402ba9]
+ -->
+ <para>
+ Fix occasional regression test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-12-12 [5611c0e]
+ -->
+ <para>
+ Fix replication delay worker segfault when application_name in primary_conninfo is an empty string.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=565">bug 565</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-12-03 [ba4f142]
+ -->
+ <para>
+ Fix <xref linkend="SQL-PGPOOL-SHOW"> command doesn't display <literal>ALWAYS_MASTER</literal>,
+ when <xref linkend="GUC-BACKEND-FLAG"> = 'ALWAYS_MASTER'. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-11-18 [0ef0d13]
+ 2019-11-15 [604ff2f]
+ -->
+ <para>
+ Fix the bug with ignored syslog setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-7>
+ <title>Release 4.0.7</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-10-25 [45a3469]
+ -->
+ <para>
+ Fix incorrect query rewrite in replication mode. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-21 [1d87df7]
+ -->
+ <para>
+ Fix that health check timeout does work in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-October/003458.html">[pgpool-hackers: 3458]</ulink>, <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-October/003459.html">[pgpool-hackers: 3459]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-15 [339bd21]
+ -->
+ <para>
+ Doc: add <xref linkend="guc-failover-command"> description when all standby nodes are down. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-11 [32a9f5d]
+ -->
+ <para>
+ Doc: add note not to assign <productname>PostgreSQL</productname> servers to <xref linkend="guc-trusted-servers">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-14 [30aed19]
+ -->
+ <para>
+ Fix for miscellaneous watchdog issues. (Muhammad Usama)
+ </para>
+ <para>
+ The lost nodes reported by life-check are treated as hard failures even when the node
+ is reachable from the watchdog core.
+ </para>
+ <para>
+ In the case of network partitioning or partial life-check failure,
+ the kicked out standby node was too aggressive in trying to connect
+ to the master or become a master itself so that potentially put the
+ unnecessary burden on the network and the cluster nodes.
+ Fix is to make the isolated node a bit calm and wait between trying to connect to
+ master or become a master.
+ </para>
+ <para>
+ See details:
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=547">bug 547</ulink>),
+ <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-August/006730.html">[pgpool-general: 6672]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-10 [4b726df]
+ -->
+ <para>
+ Fix assorted ancient v2 protocol bugs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-08 [45ac39b]
+ -->
+ <para>
+ Fix problem that <xref linkend="guc-syslog-facility"> doesn't change by reload.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=548">bug 548</ulink>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-03 [fed3d6b]
+ -->
+ <para>
+ Fix Pgpool-II shutdown failed in certain case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-29 [94b96ed]
+ -->
+ <para>
+ Allow the lost standby node to rejoin the master watchdog node when it gets rediscovered by the lifecheck.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=545">bug 545</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-06 [2d27189]
+ -->
+ <para>
+ Overhaul health check debug facility. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-15 [a333a45]
+ -->
+ <para>
+ Fix segfault when executing an erroneous query after DEALLOCATE a named statement.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=546">bug 546</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-09 [7fcc9f3]
+ -->
+ <para>
+ Doc: clarify that certificate authentication works between only client and <productname>Pgpool-II</productname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-05 [fc5898c]
+ -->
+ <para>
+ Doc: update configuration Examples "Pgpool-II + Watchdog Setup Example". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-04 [3ba4e73]
+ -->
+ <para>
+ Doc: mention that VIP will not be brought up if quorum does not exist. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-28 [e11ef8c]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> to deal with <productname>PostgreSQL</productname> 9.1. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-18 [94428ea]
+ -->
+ <para>
+ Fix for password authentication does not work when the password for
+ the connecting user is not found in the pool_passwd file.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=534">bug 534</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-16 [956c040]
+ -->
+ <para>
+ Add "-I" option to <xref linkend="guc-arping-cmd"> command default setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-6>
+ <title>Release 4.0.6</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-08-15</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-08-15 [0a94393]
+ -->
+ <para>
+ Doc: Update "Pgpool-II + Watchdog Setup Example" to support <productname>PostgreSQL 12</productname>. (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-08-08 [7ea54a1]
+ -->
+ <para>
+ Import some of memory manager debug facilities from <productname>PostgreSQL</productname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-07-24 [717411f]
+ -->
+ <para>
+ Use <function>pg_get_expr()</function> instead of <literal>pg_attrdef.adsrc</literal> to support for <productname>PostgreSQL</productname> 12. (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-08-11 [c553e51]
+ 2019-08-08 [b3d499e]
+ 2019-07-17 [6b89f9e]
+ 2019-07-02 [3b32bc4]
+ -->
+ <para>
+ Enhance shutdown script of <xref linkend="PGPOOL-SETUP">. (Tatsuo Ishii)
+ <itemizedlist>
+ <listitem>
+ <para>
+ Make shutdownall to wait for completion of shutdown of <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If environment variable <varname>CHECK_TIME_WAIT</varname> is set to true, use <command>netstat</command> command to confirm usage of the <literal>TCP/IP</literal> port while executing shutdown script.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-05-22 [57cd1d4]
+ -->
+ <para>
+ Deal <literal>pgpool_adm</literal> extension with <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-06-02 [08c0bfa]
+ -->
+ <para>
+ Doc: add description to <xref linkend="PG-MD5"> man page how to show <filename>pool_passwd</filename> hashed string. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-26 [a899be1]
+ -->
+ <para>
+ Doc: add general description about failover. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-08-11 [fd53304]
+ 2019-08-11 [8653c40]
+ -->
+ <para>
+ Test: Fix test failure of extended-query-test when <varname>disable_load_balance_on_write = off/transaction/always</varname>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-09 [b6d77f4]
+ -->
+ <para>
+ Fix "unable to bind. cannot get parse message" error.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=531">bug 531</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-08 [f48f624]
+ -->
+ <para>
+ Fix online-recovery is blocked after a child process exits abnormally with replication mode and watchdog.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=483">bug 483</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-16 [0dbf6eb]
+ -->
+ <para>
+ Fix for keep the backend health check running on quarantined nodes. (Muhammad Usama)
+ </para>
+ <para>
+ Pgpool should keep the backend health check running on quarantined nodes so
+ that when the connectivity resumes, they should automatically get removed
+ from the quarantine.
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-April/003295.html">[pgpool-hackers: 3295]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-07 [29dab7b]
+ -->
+ <para>
+ Fix for no primary on standby pgpool when primary is quarantined on master. (Muhammad Usama)
+ </para>
+ <para>
+ Master watchdog Pgpool sends the backend status sync message if the primary node is quarantined on it.
+ So standby watchdog pgpool must not update its status when the status of current primary node
+ is not DOWN.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-29 [d2aa09a]
+ -->
+ <para>
+ Fix <xref linkend="WATCHDOG-SETUP"> command <literal>mode</literal> option to work correctly. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-28 [34dc12f]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to produce correct follow master command. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-10 [801d8a8]
+ -->
+ <para>
+ Fix in native replication mode <productname>Pgpool-II</productname> rewriting query error when the queries include <literal>GROUPS</literal> and <literal>EXCLUDE</literal> in <literal>frame</literal> clauses. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [44f8e2d]
+ -->
+ <para>
+ Fix query cache module so that it checks oid array's bound. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-07 [bb3af6f]
+ -->
+ <para>
+ Fix off-by-one error in query cache module. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-05 [27c2476]
+ -->
+ <para>
+ Allow health check process to reload. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-03 [5d042e4]
+ -->
+ <para>
+ Fix segfault when query cache is enabled. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=525">bug 525</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-02 [b8137d6]
+ -->
+ <para>
+ Down grade LOG "checking zapping sent message ..." to DEBUG5. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006678.html">[pgpool-general: 6620]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-24 [8742f9f]
+ -->
+ <para>
+ Fix segfault when <literal>samenet</literal> is specified in <filename>pool_hba.conf</filename>. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2019-June/006659.html">[pgpool-general: 6601]</ulink>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-20 [4277e9b]
+ 2019-06-19 [f87890b]
+ 2019-06-19 [8af9198]
+ -->
+ <para>
+ Doc: Fix documentation mistakes in <filename>follow_master.sh</filename> script and typos. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-11 [361f4ec]
+ -->
+ <para>
+ Fix health check process is not shutting down in certain cases. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-07 [48a45fc]
+ -->
+ <para>
+ Fix to deal with backslashes according to the config of <varname>standard_conforming_strings</varname> in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=467">bug 467</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [81b9c11]
+ -->
+ <para>
+ Fix compile error on FreeBSD.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=512">bug 512</ulink>,
+ <ulink url="https://www.pgpool.net/mantisbt/view.php?id=519">bug 519</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-14 [5765ed7]
+ 2019-05-23 [0e8c1c2]
+ 2019-05-22 [c264275]
+ 2019-05-22 [53e7af0]
+ 2019-05-22 [19cfda2]
+ -->
+ <para>
+ Fix memory leaks. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-23 [827a056]
+ -->
+ <para>
+ Make failover in progress check more aggressively to avoid potential segfault. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-5>
+ <title>Release 4.0.5</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-05-16</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-04 [ad4323b]
+ -->
+ <para>
+ Doc: Improve <xref linkend="PCP-COMMANDS"> document. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-03 [bd6757e]
+ -->
+ <para>
+ Speed up failover when all of backends are down. (Tatsuo Ishii)
+ </para>
+ <para>
+ If all of the backend are in down status, immediately give up finding
+ primary node regardless search_primary_node_timeout and promptly
+ finish the failover process.
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2019-May/003321.html">[pgpool-hackers: 3321]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-30 [50d2d6a]
+ 2019-04-30 [bd43ca8]
+ -->
+ <para>
+ pgpool-recovery extension and <command>pgpool_setup</> is now ready for the next major release <productname>PostgreSQL</> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2019-04-10 [c845e30]
+ 2019-04-09 [5d2078b]
+ -->
+ <para>
+ Doc: add <xref linkend="RESTRICTIONS"> entry. (Takuma Hoshiai)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-05-09 [6e925e8]
+ -->
+ <para>
+ Fix the wrong error message "ERROR: connection cache is full", when all backend nodes are down.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=487">bug 487</>) (Bo Peng)
+ </para>
+ <para>
+ When all backend nodes are down, <productname>Pgpool-II</> throws an incorrect
+ error message "ERROR: connection cache is full". Change the error
+ message to "all backend nodes are down, pgpool requires at least one valid node".
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-24 [bb594b2]
+ -->
+ <para>
+ Remove unused .sgml file. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-21 [c670dbf]
+ -->
+ <para>
+ Avoid exit/fork storm of pool_worker_child process. (Tatsuo Ishii)
+ </para>
+ <para>
+ pool_worker_child issues query to get WAL position using <function>do_query()</>,
+ which could throws FATAL error. In this case pool_worker_child process
+ exits and <productname>Pgpool-II</> parent immediately forks new process. This cycle
+ indefinitely repeats and gives high load to the system.
+ To avoid the exit/fork storm, sleep <varname>sr_check_period</>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-18 [9b1bb1f]
+ -->
+ <para>
+ Fix <xref linkend="GUC-WRITE-FUNCTION-LIST">'s broken default value. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-17 [51131a2]
+ -->
+ <para>
+ Fix "not enough space in buffer" error.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=499">bug 499</>) (Tatsuo Ishii)
+ </para>
+ <para>
+ The error occurred while processing error message returned from
+ backend and the cause is that the query string in question is too
+ big. Problem is, the buffer is in fixed size (8192 bytes).
+ Eliminate the fixed size buffer and use palloced buffer
+ instead. This also saves some memory copy work.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-16 [e765df5]
+ -->
+ <para>
+ Fix DROP DATABASE failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-10 [89ad3d5]
+ -->
+ <para>
+ Fix wrong variable in <function>read_status_file()</> function.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=493">bug 493</>) (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-08 [7984154]
+ -->
+ <para>
+ Add missing <filename>test/watchdog_setup</> to EXTRA_DIST. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=470">bug 470</>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-07 [df4c94f]
+ -->
+ <para>
+ Doc: mention that multi-statement queries are sent to primary node only. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=492">bug 492</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-05 [8168c31]
+ -->
+ <para>
+ Fix md5 auth broken in raw mode with more than 1 backends.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=491">bug 491</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-03 [5cdc21f]
+ -->
+ <para>
+ Test: Fix occasional regression test failure of 014.watchdog_test_quorum_bypass. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-02 [816d508]
+ -->
+ <para>
+ Abort session if failover/failback is ongoing to prevent potential segfault.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=481">bug 481</ulink>,
+ <ulink url="http://www.pgpool.net/mantisbt/view.php?id=482">bug 482</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-30 [508f1c4]
+ 2019-03-30 [37162de]
+ -->
+ <para>
+ Fix compiler warnings. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-28 [3688592]
+ -->
+ <para>
+ Fix memory leak in "batch" mode in extended query.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=468">bug 468</>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-4>
+ <title>Release 4.0.4</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-03-29</simpara>
+ </note>
+
+ <sect2>
+ <title>Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-27 [03dfe9c]
+ -->
+ <para>
+ Add new configuration option <xref linkend="guc-ssl-prefer-server-ciphers">. (Muhammad Usama)
+ </para>
+ <para>
+ Add the new setting <xref linkend="guc-ssl-prefer-server-ciphers"> to let users configure if they
+ want client's or server's cipher order to take preference.
+ </para>
+ <para>
+ The default for this parameter is off, which prioritize the client's
+ cipher order as usual. However this is just for keeping backward
+ compatibility, and it is possible that a malicious client uses weak ciphers.
+ For this reason we recommend to set this parameter to on at all times.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-27 [ab63263]
+ 2019-03-23 [ec9c44c]
+ -->
+ <para>
+ Allow to set a client cipher list. (Tatsuo Ishii, Yugo Nagata)
+ </para>
+ <para>
+ For this purpose new parameter <xref linkend="guc-ssl-ciphers">, which specifies the cipher
+ list to be accepted by <productname>Pgpool-II</>, is added.
+ This is already implemented in <productname>PostgreSQL</> and useful to enhance security when SSL is enabled.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-03-18 [6224e9a]
+ -->
+ <para>
+ Fix unnecessary <function>fsync()</> to <filename>pgpool_status</> file. (Tatsuo Ishii)
+ </para>
+ <para>
+ Whenever new connections are created to PostgreSQL backend, <function>fsync()</>
+ was issued to <filename>pgpool_status</> file, which could generate excessive I/O
+ in certain conditions.
+ So reduce the chance of issuing <function>fsync()</> so that it is issued only when
+ backend status is changed.
+ </para>
+ <para>
+ Discussion: <ulink url="http://www.sraoss.jp/pipermail/pgpool-general/2019-February/006494.html">[pgpool-general: 6436]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-03-22 [3f282a7]
+ 2019-03-06 [a1c617d]
+ 2019-03-05 [5a8d511]
+ -->
+ <para>
+ Doc: add more explanation to <xref linkend="guc-follow-primary-command">. (Tatsuo Ishii)
+ </para>
+ <para>
+ Add description how <xref linkend="guc-follow-primary-command"> is executed etc.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-24 [2f16794]
+ -->
+ <para>
+ Doc: add note to <xref linkend="guc-detach-false-primary"> configuration parameter.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=469">bug 469</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ To use this feature, <xref linkend="guc-sr-check-user"> must be super user or in pg_monitor group.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-3>
+ <title>Release 4.0.3</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-02-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-02-20 [6136946]
+ -->
+ <para>
+ Doc: Update configuration example <xref linkend="EXAMPLE-CLUSTER">. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-02-18 [8537db8]
+ -->
+ <para>
+ Skip over "host=" when getting info from <literal>conninfo</literal> string. (Bo Peng)
+ </para>
+ <para>
+ Patch provided by Nathan Ward.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-15 [4e8ef64]
+ -->
+ <para>
+ Test: Fix old JDBC functions and typos in regression test 068.memqcache_bug. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-15 [07ab0c9]
+ -->
+ <para>
+ Doc: Fix configuration change timing regarding <xref linkend="GUC-MEMORY-CACHE-ENABLED">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-12 [f958290]
+ -->
+ <para>
+ Fix online recovery failed due to <xref linkend="GUC-CLIENT-IDLE-LIMIT-IN-RECOVERY"> in certain cases.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=431">bug 431</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-05 [b99e62d]
+ -->
+ <para>
+ Reduce memory usage when large data set is returned from backend.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=462">bug 462</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-05 [9f127d6]
+ -->
+ <para>
+ Test: Fix syntax error in extended query test script. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-29 [f7427e2]
+ -->
+ <para>
+ Fix corner case bug when <function>strip_quote()</function> handle a empty query string. <ulink url="http://www.pgpool.net/mantisbt/view.php?id=458">(bug 458</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-27 [cf5a528]
+ -->
+ <para>
+ Doc: Mention that schema qualifications cannot be used in white/black_function_list. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-23 [66fd1c6]
+ -->
+ <para>
+ Fix typo about wd_priority in <command>watchdog_setup</command>. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-18 [3ae4acf]
+ -->
+ <para>
+ Fixed segfault when <varname>wd_lifecheck_method = 'query'</varname>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=455">bug 455</ulink>) (Muhammad Usama)
+ </para>
+ <para>
+ The fix was proposed by Muhammad Usama and some adjustments to the patch and testing is done by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-10 [5234b6e]
+ -->
+ <para>
+ Fix Pgpool child segfault if failover occurs when trying to establish a connection. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-03 [de632ca]
+ -->
+ <para>
+ Doc: fix typo in <xref linkend="GUC-LOGDIR"> description. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=453">bug 453</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-25 [cad088b]
+ -->
+ <para>
+ Fix <acronym>PAM</acronym> authentication failed. (Takuma Hoshiai)
+ </para>
+ <para>
+ See <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2018-December/006411.html">[pgpool-general: 6353]</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-12 [050b5da]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang if a client sends a extended query message such as close after sync message but before next simple query. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2018-December/003164.html">[pgpool-hackers: 3164]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-06 [3f5986e]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang when <varname>idle_in_transaction_session_timeout = on</varname>. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=448">bug 448</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-0-2>
+ <title>Release 4.0.2</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-11-22</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-11-21 [965d315]
+ -->
+
+ <para>
+ Fix to sort startup packet's parameters sent by client.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=444">bug 444</ulink>)(Takuma Hoshiai)
+ </para>
+ <para>
+ If order of startup packet's parameters differ between cached connection
+ pools and connection request, didn't use connection pool and created new
+ connection pool.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-16 [e00426d]
+ -->
+
+ <para>
+ Fix broken authentication for <productname>Pgpool-II</>'s internal connections. (Muhammad Usama)
+ </para>
+ <para>
+ The issue is caused by a mistake in "SCRAM and Certificate authentication
+ support" commit. The problem is while authenticating against backend in
+ <function>connection_do_auth()</>, it returns to caller as soon as backend returns auth
+ ok response. So authentication itself established fine. However
+ <function>connection_do_auth()</> does not proceed until it receives "Ready for query".
+ The fix is to keep processing the data after receiving auth_ok response until we get
+ "Ready for query".
+ </para>
+ <para>
+ Patch provided by Tatsuo Ishii and a tiny modification made by Muhammad Usama.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-13 [11ea13b]
+ -->
+ <para>
+ Fix compiler warnings with gcc 8.x. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-13 [1305595]
+ -->
+
+ <para>
+ Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=443">bug 443</ulink>)(Bo Peng)
+ </para>
+ <para>
+ If the number of parameter format codes is specified to one, but the number
+ of the original query's parameter is zero, <function>bind_rewrite_timestamp()</>
+ will call <function>memcpy</> with a negative value.
+ This causes segmentation fault.
+ </para>
+ <para>
+ Patch is provided by Yugo Nagata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-08 [97caaac]
+ -->
+
+ <para>
+ Fix a query passed to relcache so that it uses schema qualified table name. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-05 [e9db542]
+ -->
+
+ <para>
+ Fix query cache invalidation bug. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-03 [53e4c80]
+ -->
+
+ <para>
+ Fix segfault in extended query + query cache case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-11-01 [3d8e0fb]
+ -->
+ <para>
+ Fix memory leak in extended query + query cache enabled. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-4-0-1">
+ <title>Release 4.0.1</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-30 [25a3024]
+ -->
+ <para>
+ Allow ssl key files to be owned by users other than <productname>Pgpool-II</productname> user and root. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-30 [3d0311b]
+ -->
+ <para>
+ Allow <command>PCP[attach/detach/promote]</command> commands during failover. (Muhammad Usama)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2018-10-30 [d48cc28]
+ -->
+ <para>
+ Fix corruption of <xref linkend="GUC-pool-passwd"> file due to the different lengths of md5, AES and text type passwords. (Muhammad Usama)
+ </para>
+ <para>
+ The patch was provided by Takuma Hoshiai and modified by Muhammad Usama.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-25 [3189c36]
+ -->
+ <para>
+ Fix typo in <varname>child_max_connections</varname> description of <command>SHOW POOL_STATUS</command> output. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by Phil Ramirez.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-10-22 [5e6d598]
+ -->
+ <para>
+ Fix segmentation fault when error query and Sync message are sent in native replication mode. (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=434">bug 434</ulink>) (Takuma Hoshiai)
+ </para>
+ <para>
+ In native replication mode, segmentation fault occurs when Sync messages is sent just after a query error.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-4-0">
+ <title>Release 4.0</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2018-10-19</simpara>
+ </note>
+
+ <sect2>
+ <title>Overview</title>
+ <para>
+ This version adds support for SCRAM and CERT authentication,
+ improves load balancing control and import PostgreSQL 11
+ new SQL parser.
+ </para>
+ <para>
+ Major enhancements in <productname>Pgpool-II</productname> 4.0 include:
+ </para>
+
+ <!-- Items in this list summarize one or more items below -->
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Add <acronym>SCRAM</acronym> and Certificate authentication support.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Detecting "false" primary server of <productname>PostgreSQL</productname>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Improvement of load balancing:
+ <itemizedlist>
+ <listitem>
+ <para>
+ More load balancing fine control after write queries.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Load balancing control for specific queries.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Allow to specify load balance weight ratio for load balance parameters.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add last state change timestamp to <xref linkend="SQL-SHOW-POOL-NODES">.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Import PostgreSQL 11 SQL parser.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Logging client messages.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Migration to Version 4.0</title>
+ <para>
+ Version 4.0 contains a number of changes that may affect compatibility with
+ previous releases. Observe the following incompatibilities:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-04-16 [3d63b8a]
+ 2018-05-04 [2e41451]
+ -->
+ <para>
+ Add 1st/2nd stage online recovery commands parameter to get the node number to be recovered. (Tatsuo Ishii)
+ </para>
+ <para>
+ Online recovery script now accepts 5 parameters, rather than 4 (the 5th
+ parameter is node number to be recovered).
+ Run <command>ALTER EXTENSION pgpool_recovery UPDATE TO '1.2'</command>
+ to update <literal>pgpool_recovery</literal> version.
+ Existing 4-parameter-style recovery scripts can be used if you don't care
+ about information provided by the 5th parameter.
+ </para>
+ <para>
+ See <xref linkend="guc-recovery-1st-stage-command"> and
+ <xref linkend="guc-recovery-2nd-stage-command"> for more details.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-08-19 [e47f8a3]
+ -->
+ <para>
+ <varname>fail_over_on_backend_error</varname> parameter is renamed to
+ <xref linkend="guc-failover-on-backend-error">. (Muhammad Usama)
+ </para>
+ <para>
+ Now we throw a warning message when old config name <varname>fail_over_on_backend_error</varname>
+ is used instead of <xref linkend="guc-failover-on-backend-error">.
+ Using the old config variable name will have no effect.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-08-17 [2644612]
+ -->
+ <para>
+ Allow to specify the AES encrypted password in the <filename>pgpool.conf</filename>. (Muhammad Usama)
+ </para>
+ <para>
+ Since 4.0, you can specify the AES encrypted password in the
+ <filename>pgpool.conf</filename> file for <xref linkend="guc-health-check-password">,
+ <xref linkend="guc-sr-check-password">, <xref linkend="guc-wd-lifecheck-password"> and
+ <xref linkend="guc-recovery-password">.
+ </para>
+ <para>
+ To specify the unencrypted clear text password, prefix the password string with <literal>TEXT</literal>.
+ In the absence of a valid prefix, <productname>Pgpool-II</productname> will consider the string as a plain text password.
+ </para>
+ <para>
+ The empty password string specified in the
+ <filename>pgpool.conf</filename> file for <xref linkend="guc-health-check-password">,
+ <xref linkend="guc-sr-check-password">, <xref linkend="guc-wd-lifecheck-password"> and
+ <xref linkend="guc-recovery-password"> will only be used when the <xref linkend="GUC-pool-passwd">
+ does not contain the password for that specific user.
+ If these parameters are left blank, <productname>Pgpool-II</productname> will first try to
+ get the password for that specific user from <xref linkend="GUC-pool-passwd"> file before
+ using the empty password.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Major Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-09-05 [536b155]
+ 2018-08-19 [ccc9280]
+ 2018-08-17 [2644612]
+ -->
+ <para>
+ Add support for <acronym>SCRAM</acronym> and Certificate
+ based authentication methods. (Muhammad Usama)
+ <itemizedlist>
+ <listitem>
+ <para>
+ Add support for <acronym>SCRAM</acronym> authentication method.
+ </para>
+ <para>
+ SCRAM authentication is supported using the pool_passwd authentication file.
+ </para>
+ <para>
+ See <xref linkend="AUTH-SCRAM"> for more details.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Allow to use <acronym>CERT</acronym> authentication between <productname>Pgpool-II</productname> and frontend.
+ </para>
+ <para>
+ To use this authentication method, Pgpool-II will require that the client provide a valid certificate.
+ </para>
+ <para>
+ See <xref linkend="AUTH-CERT"> for more details.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Able to use different auth methods for frontend and backend.
+ </para>
+ <para>
+ Now it is possible to use different authentication methods between
+ client to <productname>Pgpool-II</productname> and <productname>Pgpool-II</productname> to backend.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Now <xref linkend="GUC-POOL-PASSWD"> can store three format passwords. AES256 encrypted format, plain text format and md5 format.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> identifies the password format type by it's prefix,
+ so each password entry in the pool_passwd must be prefixed as per the password format.
+ </para>
+ <para>
+ md5 hashed passwords will be prefixed with <literal>md5</literal> and AES256 encrypted password types
+ will be stored using <literal>AES</literal> prefix.
+ To store the password in the plain text format <literal>TEXT</literal> prefix can be used.
+ </para>
+ <para>
+ In the absence of a valid prefix, Pgpool-II will be considered the string as a plain text password.
+ </para>
+ <para>
+ For example:
+ <programlisting>
+ username1:AESIFwI86k+ZbVdf6C+t3qpGA==
+ username2:md59c6583185ba6a85bdcd1f129ec8cabb4
+ username3:TEXTmypassword
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Able to use <acronym>MD5</acronym> and <acronym>SCRAM</acronym> authentication methods
+ to connect to database without <xref linkend="GUC-pool-passwd">.
+ </para>
+ <para>
+ A new configuration parameter <xref linkend="guc-allow-clear-text-frontend-auth"> is added.
+ This parameter enables this config allows the <productname>Pgpool-II</productname>
+ to use clear-text-password authentication with frontend clients when
+ <xref linkend="GUC-pool-passwd"> file does not contain the password for the connecting user,
+ and use that password (provided by client) to authenticate with the backend
+ using <acronym>MD5</acronym> and/or <acronym>SCRAM</acronym> authentication.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ New <xref linkend="PG-ENC"> utility to create encrypted passwords.
+ </para>
+ <para>
+ A new utility <xref linkend="PG-ENC"> is added to create AES encrypted passwords.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ See <xref linkend="client-authentication"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-09 [f0631a6]
+ 2018-04-17 [bbc270f]
+ -->
+ <para>
+ Add new parameter <xref linkend="guc-detach-false-primary">. (Tatsuo Ishii)
+ </para>
+ <para>
+ If set <literal>detach_false_primary = on</literal>, detach false primary node.
+ The default is off. This parameter is only valid in streaming replication mode
+ and for <productname>PostgreSQL</productname> 9.6 or after since this feature
+ uses <structname>pg_stat_wal_receiver</structname>.
+ If <productname>PostgreSQL</productname> 9.5.x or older version is used, no
+ error is raised, just the feature is ignored.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-04-23 [33e52ba]
+ 2018-04-19 [ba19a38]
+ -->
+ <para>
+ Add <xref linkend="guc-disable-load-balance-on-write"> parameter to specify
+ load balance behavior after write queries appear. (Tatsuo Ishii)
+ </para>
+ <para>
+ This parameter allows to specify the behavior when a write query issued.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-08-07 [5108031]
+ -->
+ <para>
+ Allow to specify load balance weight ratio for load balance parameters. (Bo Peng)
+ </para>
+ <para>
+ Add a new feature to allow to specify load balance weight ratio for
+ <xref linkend="guc-database-redirect-preference-list"> and
+ <xref linkend="guc-app-name-redirect-preference-list"> parameters.
+ </para>
+ <para>
+ You can specify the list of "database-name:node id(ratio)" pairs to
+ send SELECT queries to a particular backend node for a particular
+ database connection at a specified load balance ratio.
+ </para>
+ <para>
+ Also you can specify list of "application-name:node id(ratio)" pairs to
+ send SELECT queries to a particular backend node for a particular client
+ application connection at a specified load balance ratio.
+ </para>
+ <para>
+ This load balance ratio specifies a value between 0 and 1,
+ and the default is 1.0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-06-14 [83906d1]
+ -->
+ <para>
+ Add new parameter <xref linkend="guc-primary-routing-query-pattern-list"> to enable
+ specifying SQL patterns lists that should not be load-balanced. (Bo Peng)
+ </para>
+ <para>
+ Specify a semicolon separated list of SQL patterns that
+ should be sent to primary node only. Regular expression can be
+ used in SQL patterns. Only Master Slave mode is supported.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-27 [54503f4]
+ 2018-08-02 [dac5573]
+ 2018-08-01 [8745853]
+ -->
+ <para>
+ Add new parameter <xref linkend="guc-log-client-messages"> to allow logging client message. (Takuma Hoshiai, Tatsuo Ishii)
+ </para>
+ <para>
+ Set <varname>log_client_messages = on</varname>, any client messages will be logged without debugging messages.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-06-12 [0312dc5]
+ -->
+ <para>
+ Add <literal>last_status_change</literal> column to <xref linkend="SQL-SHOW-POOL-NODES"> command. (Tatsuo Ishii)
+ </para>
+ <para>
+ The new column indicates the time when <literal>status</literal> or <literal>role</literal> has been changed.
+ </para>
+ <para>
+ See <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2018-June/002822.html">
+ [pgpool-hackers: 2822]</ulink> for the reasoning to add the column.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-08-28 [8b43ac3]
+ -->
+ <para>
+ Import <productname>PostgreSQL</productname> 11's SQL parser. (Bo Peng)
+ </para>
+ <para>
+ Now <productname>Pgpool-II</productname> can fully understand the newly added SQL syntax
+ in <productname>PostgreSQL</productname> 11,
+ such as <literal>CREATE/ALTER/DROP PROCEDURE</literal>,
+ <literal>{ RANGE | ROWS | GROUPS } frame_start [ frame_exclusion ]</literal>, etc.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Other Enhancements</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-05-09 [719fbaa]
+ 2018-05-10 [edd10f6]
+ -->
+ <para>
+ Add "-r" option to <command>pgpool_setup</command> to allow use of <application>pg_rewind</application>. (Tatsuo Ishii)
+ </para>
+ <para>
+ With this option, <command>pgpool_setup</command> creates <filename>basebackup.sh</filename> which tries
+ <application>pg_rewind</application> first. If it fails, falls back to rsync.
+ </para>
+ <para>
+ Also a new environment variable "USE_PG_REWIND" to <application>pgpool_setup</application> is added.
+ This brings the same effect as "-r" option is specified.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-04-16 [3d63b8a]
+ 2018-04-15 [4867cf2]
+ 2018-04-18 [1c9a5dd]
+ 2018-05-05 [50b4d27]
+ 2018-04-26 [b3a361c]
+ 2018-04-18 [1c9a5dd]
+ 2018-04-18 [1c9a5dd]
+ -->
+ <para>
+ Add "-s" option to <application>pgpool_setup</application> to support for replication slot. (Tatsuo Ishii)
+ </para>
+ <para>
+ This eliminates the problem when standby is promoted. When a standby
+ is promoted, it changes the time line in PITR archive, which will stop
+ other standby if any because of shared archive directory.
+ </para>
+ <para>
+ Also a new environment variable "USE_REPLICATION_SLOT" to <application>pgpool_setup</application> is added.
+ This brings the same effect as "-s" option is specified.
+ </para>
+ <para>
+ If "USE_REPLICATION_SLOT=true", in streaming replication mode,
+ use replication slot instead of archive.
+ </para>
+ <para>
+ By setting USE_REPLICATION_SLOT environment variable,
+ now <application>pgpool_setup</application> in all tests uses replication slots.
+ This reduces disk space under <filename>src/test/regression</filename> from
+ 6.3GB to 5,1GB (1.2GB savings).
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-08-17 [3b51aa7]
+ -->
+ <para>
+ Introduce <xref linkend="PGPROTO"> to <productname>Pgpool-II</productname>. (Takuma Hoshiai)
+ </para>
+ <para>
+ A new utility <xref linkend="PGPROTO"> is added to test <productname>PostgreSQL</productname>
+ or any other servers that understand the frontend/backend protocol.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-07-09 [62bd296]
+ -->
+ <para>
+ Allow to display <productname>Pgpool-II</productname> child process id and
+ <productname>PostgreSQL</productname> backend id in <xref linkend="PCP-PROC-INFO">. (Tatsuo Ishii)
+ </para>
+ <para>
+ Add --all option to display all child processes and their available connection slots.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-07-03 [a8a666a]
+ -->
+ <para>
+ Add <literal>replication_delay</> and <literal>last_status_change</> to
+ <xref linkend="PCP-NODE-INFO">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2018-07-05 [c47ac16]
+ -->
+ <para>
+ Add <literal>role</>, <literal>replication_delay</> and <literal>last_status_change</> columns to pgpool_adm's
+ <xref linkend="PGPOOL-ADM-PCP-NODE-INFO">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-05-07 [05c9297]
+ -->
+ <para>
+ Downgrade most of DEBUG1 messages to DEBUG5. (Tatsuo Ishii)
+ </para>
+ <para>
+ This significantly reduces the size of pgpool log when pgpool starts
+ with -d option (this is equivalent to setting <xref linkend="guc-client-min-messages"> to
+ debug1).
+ </para>
+ <para>
+ Per discussion <ulink url="http://www.sraoss.jp/pipermail/pgpool-hackers/2018-May/002794.html">
+ [pgpool-hackers: 2794]</ulink>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2018-10-18 [0b059bd]
+ -->
+ <para>
+ Fix syntax error in native replication, when queries including time functions
+ (<literal>now()</literal>, etc.) and <literal>IN (SELECT ...)</literal>
+ in <literal>WHERE</literal> clause.
+ (<ulink url="http://www.pgpool.net/mantisbt/view.php?id=433">bug 433</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-31 [0f45b8d]
+ -->
+ <para>
+ Fix compiler error if HAVE_ASPRINTF is not defined. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-31 [24973c0]
+ -->
+ <para>
+ Fix <filename>configure.ac</> to remove generating <filename>src/sql/pgpool_adm/Makefile.in</>. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-24 [d2b8efd]
+ -->
+ <para>
+ Fix pgpool main process segfault when <productname>PostgreSQL</productname> 9.5 is used. (Tatsuo Ishii)
+ </para>
+ <para>
+ pgpool_setup -n 3 (or greater) triggers the bug. While recovering node
+ 2, pgpool main process tried to retrieve version info from backend #2
+ even if it's not running. This causes the segfault because connection
+ was not established yet. The reason why <productname>PostgreSQL 9.6</productname>
+ or later was not suffered from the bug was, <productname>PostgreSQL</productname>
+ exited the loop as soon as the server version is higher than 9.5. To fix this,
+ call to VALID_BACKEND macro was added.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-04 [4621577]
+ -->
+ <para>
+ Add missing <xref linkend="guc-health-check-timeout"> in pgpool_setup. (Tatsuo Ishii)
+ </para>
+ <para>
+ Per node health_check_timeout was missing and this should had been
+ there since the per node health check parameter support was added.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-07-11 [27a0056]
+ -->
+ <para>
+ Test: Try to reduce the chance of regression 006.memcache failure. (Tatsuo Ishii)
+ </para>
+ <para>
+ It seems the occasional failure of the test is caused by replication
+ lag. The script tries to read tables from standby but it returns a
+ table not existing error. So insert pg_sleep() after creation of
+ tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-21 [1d3ab38]
+ -->
+ <para>
+ Test: Fix regression test 055.backend_all_down error. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-05-04 [1903325]
+ -->
+ <para>
+ Doc: Enhance online recovery document. (Tatsuo Ishii)
+ </para>
+ <para>
+ Clarify that 2nd stage command is only required in native replication mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-02-27 [4eabecb]
+ -->
+ <para>
+ Test: Add new regression test <filename>017.node_0_is_down</> for node 0 not being primary. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/release-4.1.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id=release-4-1-5>
+ <title>Release 4.1.5</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-11-19</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [fd481f1]
+ -->
+ <para>
+ Doc: update "Aurora Configuration Example". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [4999b13]
+ -->
+ <para>
+ Doc: mention that <acronym>GSSAPI</acronym> is not supported. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-03 [f9217a8]
+ -->
+ <para>
+ <productname>Pgpool-II</productname> doesn't support <acronym>GSSAPI</acronym>.
+ Allow <productname>Pgpool-II</productname> to deal with this issue and expects that the frontend falls back to other connections
+ instead of responding with an error. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is created by me, reviewed and tested by Umar Hayat.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-22 [f26a293]
+ 2020-09-22 [fc3525e]
+ -->
+ <para>
+ Doc: update "Pgpool-II + Watchdog Setup Example". (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-11-17 [94cbceb]
+ -->
+ <para>
+ Fix query rewrite syntax error of "INSERT ... ON CONFLICT" in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=654">bug 654</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-30 [6d6e4cc]
+ -->
+ <para>
+ Fix connection counter was not counted down when query is canceled.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=656">bug 656</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-30 [c83c400]
+ -->
+ <para>
+ Doc: fix usable versions of PostgreSQL to be 7.4 or later. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+
+<sect1 id=release-4-1-4>
+ <title>Release 4.1.4</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-09-17</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-13 [88a4043]
+ -->
+ <para>
+ Follow the guide line of <productname>PostgreSQL</productname> 12.4 regarding extensions. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>CREATE OR REPLACE FUNCTION</command> should be avoided. Use <command>CREATE FUNCTION</command> instead.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-24 [4e8fece]
+ -->
+ <para>
+ Replace "PGBIN" and "LPATH" in <xref linkend="PGPOOL-SETUP"> and <xref linkend="WATCHDOG-SETUP"> using PostgreSQL's bin path and lib path. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-09-16 [957d3b3]
+ -->
+ <para>
+ Doc: fix the incorrect description regarding the running modes of Pgpool-II in which online recovery is available. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-14 [59367de]
+ -->
+ <para>
+ Remove unnecessary checks in some code path. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Hou, Zhijie.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-06 [9c0a5ff]
+ -->
+ <para>
+ Fix relcache query sometimes sent to other than primary. (Tatsuo Ishii)
+ </para>
+ <para>
+ In streaming replication mode, relcache queries are supposed to be
+ sent to the primary node. But actually they were not sent to the primary
+ node if primary node was not the master node. Typically this could
+ happen when the primary is not node 0.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-01 [5bacc82]
+ -->
+ <para>
+ Fix <xref linkend="GUC-CONNECTION-LIFE-TIME"> not working when <xref linkend="GUC-SERIALIZE-ACCEPT"> is enabled. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-August/007233.html">[pgpool-general: 7175]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-30 [c45cd0d]
+ -->
+ <para>
+ Display more informative error message in authentication process. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-22 [a070fda]
+ -->
+ <para>
+ Test: Fix occasional 073.pg_terminate_backend test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-21 [2f14161]
+ -->
+ <para>
+ Fix segfault in pgpool child process in certain case. (Tatsuo Ishii)
+ </para>
+ <para>
+ This issue can be reproduced with the following steps:
+ <orderedlist>
+ <listitem>
+ <para>
+ Shutdown all backends.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Connect to pgpool with invalid client. I have used <command>pcp_attach_node</command> with pgpool's port number, not pcp's.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-1-3>
+ <title>Release 4.1.3</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-08-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [8523d12]
+ -->
+ <para>
+ Doc: mention that <xref linkend="GUC-SSL-CIPHERS"> only affects to TLS 1.2 and lower. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [0d6b13c]
+ -->
+ <para>
+ Doc: add sample script links in configuration example <xref linkend="EXAMPLE-CLUSTER">. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [230ec4e]
+ -->
+ <para>
+ Doc: Improve the description of <xref linkend="GUC-WD-PRIORITY">. (Bo Peng)
+ </para>
+ <para>
+ Patch is provided by Kenichiro Tanaka.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [624a054]
+ -->
+ <para>
+ Add mention about <literal>hostssl/hostnossl</literal> to <filename>pool_hba.conf</filename> sample file. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-17 [44096e2]
+ 2020-07-16 [5115de1]
+ 2020-06-30 [8941202]
+ 2020-05-30 [6f128fc]
+ 2020-05-23 [dde82d3]
+ 2020-05-23 [7a73705]
+ 2020-07-28 [1e13a96]
+ -->
+ <para>
+ Doc: documentation improvements. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-23 [06080f6]
+ -->
+ <para>
+ Doc: add note about <xref linkend="GUC-AUTO-FAILBACK">. (Takuma Hoshiai)
+ </para>
+ <para>
+ If user uses replication_slot, the replication slot may be deleted by <xref linkend="GUC-FAILOVER-COMMAND"> when standby node is down.
+ In this case, <xref linkend="GUC-AUTO-FAILBACK"> may not work because replication stopped.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-08-12 [8e8cc39]
+ -->
+ <para>
+ At pgpool startup, if pid file exists, truncate pid file to zero length before writing. (Bo Peng)
+ </para>
+ <para>
+ Patch is created by maliangzhu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [09a3610]
+ -->
+ <para>
+ Doc: fix error in <xref linkend="GUC-FAILBACK-COMMAND"> parameter description. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [96fa3c9]
+ -->
+ <para>
+ Fix <xref linkend="guc-connection-life-time"> does not work if primary node is not 0 in streaming replication mode. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-05 [4bd2a0d]
+ -->
+ <para>
+ Fix <command>pgpool_setup</command> problem with -r option and <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-31 [b1ea477]
+ -->
+ <para>
+ Change PCP <literal>UNIX_DOMAIN_PATH</literal> of RPM package to <filename>/var/run/postgresql</filename>. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-14 [7025c04]
+ -->
+ <para>
+ Fix query cache bugs. (Tatsuo Ishii)
+ </para>
+ <para>
+ If query cache is enable, when a table is updated, Pgpool-II should delete all the caches related to the table.
+ However, <command>EXPLAIN ANALYZE</command> and <acronym>CTE</acronym> with data-modifying SQLs
+ were mistakenly treated as normal read only query so that the query caches were not deleted.
+ </para>
+ <para>
+ Patch is created by Hou, Zhijie and modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-09 [a319c87]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hang in a corner case. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-26 [fe9d88d]
+ -->
+ <para>
+ If there are parameters other than "user", "database" and "application_name", reading startup packet failed. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-22 [41f3402]
+ -->
+ <para>
+ Fix miscount of connections when <function>pg_terminate_backend()</function> is executed. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-04 [f4ca7cc]
+ -->
+ <para>
+ Fix segmentation fault when application name is included in <xref linkend="GUC-LOG-LINE-PREFIX">. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=615">bug 615</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-02 [936c7e4]
+ -->
+ <para>
+ Fix incorrectly performing failover when <function>pg_terminate_backend()</function> is executed in native replication mode. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-27 [b97ab24]
+ -->
+ <para>
+ Fix 004.watchdog test crash on IBM Z hardware. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=614">bug 614</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by gregn123, slightly modified by Tatsuo Ishii.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-1-2>
+ <title>Release 4.1.2</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-05-21</simpara>
+ </note>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-05-16 [2fd983b]
+ 2020-04-26 [1304dcc]
+ -->
+ <para>
+ Fix build error on some system (Fedora 32). (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-10 [f106b2b]
+ -->
+ <para>
+ Doc: Add note about <xref linkend="guc-if-up-cmd"> and <xref linkend="guc-if-down-cmd"> command. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-06 [7c13a60]
+ -->
+ <para>
+ Fix pgpool ssl front end accept all ciphers. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=608">bug 608</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-26 [311cdc7]
+ -->
+ <para>
+ Downgrade too verbose authentication logs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [1221a65]
+ -->
+ <para>
+ Fix unnecessary checks. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by sherlockcpp. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007062.html">[pgpool-general: 7004]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-23 [8ea84b9]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch contributed by Umar Hayat. Discussion: <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-April/003587.html">[pgpool-hackers: 3587]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-16 [75432c0]
+ -->
+ <para>
+ Fix for segmentation fault in PCP process. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=598">bug 598</ulink>) (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-15 [595a3ec]
+ -->
+ <para>
+ Fix a warning message is never output in watchdog. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch provided by sherlockcpp. Discussion: (<ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-April/007014.html">[pgpool-general: 6956]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-12 [237793e]
+ 2020-04-06 [225290a]
+ -->
+ <para>
+ Doc: Fix typo. (Tatsuo Ishii, Bo Peng)
+ </para>
+ <para>
+ Patch provided by sherlockcpp.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-31 [9151b53]
+ -->
+ <para>
+ Fix <productname>Pgpool-II</productname> hangs when an Execute message is issued right after Sync message and query cache hits. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-13 [a558287]
+ -->
+ <para>
+ Fix problems in watchdog source code processing json data. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=596">bug 596</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by Greg Nancarrow (Fujitsu Australia).
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-12 [0c1649e]
+ -->
+ <para>
+ Fix <literal>SCRAM</literal> auth handling bug. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=595">bug 595</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by Greg Nancarrow (Fujitsu Australia).
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-11 [a639141]
+ -->
+ <para>
+ Fix possible data inconsistency in native replication mode. (Tatsuo Ishii)
+ </para>
+ <para>
+ Discussions:
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-general/2020-March/006954.html">[pgpool-general: 6896]</ulink>
+ <ulink url="https://www.pgpool.net/pipermail/pgpool-hackers/2020-March/003540.html">[pgpool-hackers: 3540]</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-06 [5ce6273]
+ -->
+ <para>
+ Fix watchdog ping probes fail with long hostnames due to small buffer. (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=516">bug 516</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-02 [ffb3c59]
+ 2020-02-27 [d0774d5]
+ 2020-02-27 [f1e3ac9]
+ -->
+ <para>
+ Doc: Enhance documents. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-26 [99abd2e]
+ -->
+ <para>
+ Fix "last status change" timestamp is not set properly. (Tatsuo Ishii)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id=release-4-1-1>
+ <title>Release 4.1.1</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-02-20</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2020-02-18 [cdb49b4]
+ -->
+ <para>
+ Disallowing the quorum aware failover option for the native replication mode. (Muhammad Usama)
+ </para>
+ <para>
+ In native replication mode, <productname>Pgpool-II</productname>. is responsible for replicating the data
+ on all backend nodes, and if a node becomes <literal>quarantined</literal> then Pgpool-II stops
+ sending the writes to that node. This is dangerous since it can cause data inconsistency.
+ </para>
+ <para>
+ So as per the discussion, we reached the conclusion to disallow
+ <xref linkend="GUC-FAILOVER-WHEN-QUORUM-EXISTS"> with the native replication mode so that backend
+ node should never get into quarantine when Pgpool-II is configured in the replication mode.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-01-28 [b0b52ef]
+ -->
+ <para>
+ Check if socket file exists at startup and remove them if PID file doesn't exist to avoid bind() failure. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-02-18 [874e827]
+ -->
+ <para>
+ Fix incorrect query rewriting in native replication mode.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=551">bug 551</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-18 [47fc7fc]
+ 2020-02-17 [4dc2ec3]
+ 2020-02-12 [1581295]
+ 2020-02-04 [d4f37bb]
+ 2020-02-04 [3ca4924]
+ 2020-01-28 [6d5eda7]
+ 2020-01-13 [ee7e42c]
+ 2020-01-12 [d213f2a]
+ -->
+ <para>
+ Doc: Update documentation and fix documentation typos. (Takuma Hoshiai, Tatsuo Ishii, Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-12 [f7f6e04]
+ -->
+ <para>
+ Update pgpool-recovery function definitions. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-12 [ba5c604]
+ -->
+ <para>
+ Fix child process segfault after reload if <xref linkend="GUC-HEALTH-CHECK-DATABASE"> is empty.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=571">bug 571</ulink>) (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-10 [9196111]
+ -->
+ <para>
+ Suppress unnecessary error message when there's no standby server. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-08 [3fe5c19]
+ -->
+ <para>
+ Fix <xref linkend="PGPOOL-SETUP"> to support <productname>PostgreSQL</productname> 12. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-28 [c3b11c1]
+ 2020-01-28 [1478c93]
+ 2020-01-10 [d0252d8]
+ -->
+ <para>
+ Doc: Change the sample follow_master_command script %M %H parameter's order. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-19 [03834a2]
+ 2020-01-10 [d0252d8]
+ 2020-01-04 [831c128]
+ 2019-12-31 [18c6ee8]
+ 2019-12-24 [cbee159]
+ -->
+ <para>
+ Fix occasional regression test failure. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-13 [45eb063]
+ -->
+ <para>
+ Unbreak notification response message treatment in 4.1.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=573">bug 573</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-12-12 [75f54a4]
+ -->
+ <para>
+ Fix replication delay worker segfault when application_name in primary_conninfo is an empty string.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=565">bug 565</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-12-03 [157d1b9]
+ -->
+ <para>
+ Fix <xref linkend="SQL-PGPOOL-SHOW"> command doesn't display <literal>ALWAYS_MASTER</literal>,
+ when <xref linkend="GUC-BACKEND-FLAG"> = 'ALWAYS_MASTER'. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-11-18 [46bdb08]
+ 2019-11-15 [8d01e3c]
+ -->
+ <para>
+ Fix the bug with ignored syslog setting. (Bo Peng)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-4-1-0">
+ <title>Release 4.1.0</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2019-10-31</simpara>
+ </note>
+
+ <sect2>
+ <title>Overview</title>
+ <para>
+ This version implements long awaited features including
+ <xref linkend="guc-statement-level-load-balance">
+ and <xref linkend="guc-auto-failback">. Also it enhances number
+ of areas related to performance. Finally it
+ imports <productname>PostgreSQL</productname> 12's new SQL
+ parser.
+ </para>
+ <para>
+ Major enhancements in <productname>Pgpool-II</productname> 4.1 include:
+ </para>
+
+ <!-- Items in this list summarize one or more items below -->
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Statement level load
+ balancing. Previously <productname>Pgpool-II</productname>
+ only allows session level load balancing. This version
+ allows to use <literal>statement level load
+ balancing</literal>, which is useful for frontends
+ permanently connecting
+ to <productname>Pgpool-II</productname> but want to use
+ existing standby server resources.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Auto failback allows to automatically attach streaming
+ replication standby servers, which are considered safe
+ enough to failback.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enhance performance in number of areas.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Shared relation cache allows to reuse relation cache
+ among sessions to reduce internal queries
+ against <productname>PostgreSQL</productname> system
+ catalogs.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Have separate SQL parser for DML statements to
+ eliminate unnecessary parsing effort.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Load balancing control for specific queries.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Import PostgreSQL 12 SQL parser.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="migration-to-version-4-1">
+ <title>Migration to Version 4.1</title>
+ <para>
+ Version 4.1 contains some changes that may affect compatibility
+ with previous releases. Observe the following incompatibilities:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2019-04-17 [daa530a7]
+ 2019-04-23 [35cb1dc2]
+ 2019-04-24 [4d9f8b98]
+ -->
+ <para>
+ Add <varname>replication_state</varname> and
+ <varname>replication_sync_state</varname> columns
+ of <xref linkend="SQL-SHOW-POOL-NODES"> and friends. (Tatsuo
+ Ishii)
+ </para>
+ <para>
+ This allows to show important information from
+ <command>pg_stat_replication</command>, which is available
+ from <productname>PostgreSQL</productname> 9.1 (also with
+ <varname>replication_state_sync</varname>. it's only
+ available since 9.2 however). For this purpose
+ new <xref linkend="guc-backend-application-name"> parameter is
+ added to each backend_host configuration parameters.
+ <command>pg_stat_replication</command> is called from
+ streaming replication delay checking process. So
+ if <xref linkend="guc-sr-check-period"> is 0, those new columns
+ are not available.
+ </para>
+ <para>
+ Also <xref linkend="pcp-node-info">
+ and <xref linkend="pgpool-adm-pcp-node-info"> function are
+ modified.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-29 [69419ac4]
+ -->
+ <para>
+ Add parameter <xref
+ linkend="guc-enable-consensus-with-half-votes"> to configure
+ majority rule calculations. (Muhammad Usama, Tatsuo Ishii)
+ </para>
+ <para>
+ This changes the behavior of the decision of quorum existence and
+ failover consensus on even number (i.e. 2, 4, 6...) of watchdog
+ clusters. Odd number of clusters (3, 5, 7...) are not
+ affected. When this parameter is off (the default), a 2 node
+ watchdog cluster needs to have both 2 nodes are alive to have a
+ quorum. If the quorum does not exist and 1 node goes down, then
+ 1) VIP will be lost, 2) failover script is not executed and 3)
+ no watchdog master exists. Especially #2 could be troublesome
+ because no new primary <productname>PostgreSQL</productname>
+ exists if existing primary goes down. Probably 2 node watchdog
+ cluster users want to turn on this parameter to keep the existing
+ behavior. On the other hand 4 or more even number of watchdog
+ cluster users will benefit from this parameter is off because now
+ it prevents possible split brain when a half of watchdog nodes go
+ down.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-10-10 [422038d9]
+ -->
+ <para>
+ If installing from RPMs, by default <productname>Pgpool-II</productname>
+ is started by <literal>postgres</literal> user. (Bo Peng)
+ </para>
+ <para>
+ Because of the security reason, the <productname>Pgpool-II</productname> default
+ startup user is changed to <literal>postgres</literal> user.
+ </para>
+ <para>
+ If installing from RPMs, <literal>postrges</literal> user will be allowed to
+ run <varname>if_up/down_cmd</varname> and <varname>arping_cmd</varname>
+ with <command>sudo</command> without a password.
+ If <varname>if_up/down_cmd</varname> or <varname>arping_cmd</varname> starts with "/",
+ the setting specified in <varname>if_cmd_path</varname> or <varname>arping_path</varname>
+ will be ignored.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-02 [d86c71d1]
+ -->
+ <para>
+ Down grade LOG to DEBUG5 in sent message module. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+ <sect2>
+ <title>Major Enhancements</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2019-04-02 [1099ba61]
+ -->
+ <para>
+ Allow to use statement level load balancing. (Bo Peng)
+ </para>
+ <para>
+ This feature enables selecting load balancing node per
+ statement. The current feature for load balancing, the load
+ balancing node is decided at the session start time and will
+ not be changed until the session ends. When set to
+ <xref linkend="guc-statement-level-load-balance"> = on,
+ the load balancing node is decided for each read query. For
+ example, in applications that use connection pooling remain
+ connections open to the backend server, because the session
+ may be held for a long time, the load balancing node does
+ not change until the session ends. In such applications,
+ when statement_level_load_balance is enabled, it is possible
+ to decide load balancing node per query, not per session.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-22 [3e2ecc97]
+ 2019-07-22 [6a1f16e8]
+ -->
+ <para>
+ Add <xref linkend="guc-auto-failback"> (Takuma Hoshiai).
+ </para>
+ <para>
+ This allows to reattach backend node automatically that is
+ in DOWN status but actually it is running normally.
+ </para>
+ <para>
+ To use this feature it is required
+ that <productname>PostgreSQL</productname> is 9.1 or later
+ and new configuration
+ variable <varname>auto_failback</varname> is
+ enabled. Also <productname>Pgpool-II</productname> must be
+ operating in streaming-replication mode, with sr_check and
+ health_check are
+ enabled. <productname>Pgpool-II</productname> calls
+ pg_stat_replication on
+ the <productname>PostgreSQL</productname> primary server to
+ make sure that the standby node in question is running and
+ receiving replication stream from the primary server.
+ </para>
+ <para>
+ This feature is useful in the case that a standby server
+ fails over due to a temporary network failure.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-25 [46917d54]
+ -->
+ <para>
+ Add new <xref linkend="guc-enable-shared-relcache">
+ parameter. (Takuma Hoshiai)
+ </para>
+ <para>
+ The relation cache were stored in local cache of child
+ processes, so all child processes executed same query to get
+ relation cache. If <xref linkend="guc-enable-shared-relcache">
+ is on, the relation cache is stored in memory cache and all
+ child process share it. It will expect to reduce the load
+ that same query is executed.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-27 [7a0471bb]
+ -->
+ <para>
+ Add new parameter <xref linkend="guc-check-temp-table"> to
+ check temporary tables. (Tatsuo Ishii)
+ </para>
+ <para>
+ Checking temporary tables is slow because it needs to lookup
+ system catalogs. To eliminate the lookup, new method to
+ trace <command>CREATE TEMP TABLE/DROP TABLE</command> is
+ added. To use the new method,
+ set <xref linkend="guc-check-temp-table">
+ to <literal>trace</literal>.
+ </para>
+ <para>
+ Note that it is impossible to trace tables created in
+ functions and triggers. In this case existing method should
+ be used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-26 [6282805d]
+ -->
+ <para>
+ Reduce internal queries against system catalogs. (Tatsuo Ishii)
+ </para>
+ <para>
+ Currently the relcache module issues 7+ queries to obtain
+ various info from <productname>PostgreSQL</productname>
+ system catalogs. Some of them are necessary for
+ <productname>Pgpool-II</productname> to work with multiple
+ version of <productname>PostgreSQL</productname>. To reduce
+ such internal queries,
+ get <productname>PostgreSQL</productname> version to know
+ what kind of queries are needed. For example, we need to
+ know if pg_namespace exists and for this purpose we send a
+ query against pg_class. But if we know that pg_namespace was
+ introduced in <productname>PostgreSQL</productname> 7.3, we
+ do not need to inquire pg_class.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-02 [310c5c4a]
+ -->
+ <para>
+ Performance enhancements for the large INSERT and UPDATE
+ statements. (Muhammad Usama)
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> only needs very little
+ information, especially for the INSERT and UPDATE statements
+ to decide where it needs to send the query. For example: In
+ master-slave mode, for the INSERT
+ statements <productname>Pgpool-II</productname> only
+ requires the relation name referenced in the statement while
+ it doesn't care much about the column values and other
+ parameters. But since the parser we use
+ in <productname>Pgpool-II</productname> is taken
+ from <productname>PostgreSQL</productname> source which
+ parses the complete query including the value lists which
+ seems harmless for smaller statements but in case of INSERT
+ and UPDATE with lots of column values and large data in
+ value items, consumes significant time.
+ </para>
+ <para>
+ So the idea here is to short circuit the INSERT and UPDATE
+ statement parsing as soon as we have the required
+ information. For that purpose, the commit adds the second
+ minimal parser that gets invoked in master-slave mode and
+ tries to extract the performance for large INSERT and UPDATE
+ statements.
+ </para>
+ <para>
+ Apart from the second parser addition, changes aiming
+ towards the performance enhancements are also part of the
+ commit. See
+ the <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=310c5c4a289cbe6cee01abef7d2e7bc3550944fb">commit
+ log</ulink> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-24 [f694283c]
+ -->
+ <para>
+ Import PostgreSQL 12 beta2 new parser. (Bo Peng)
+ </para>
+ <para>
+ Major changes of PostgreSQL 12 parser include:
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Add new VACUUM options:SKIP_LOCKED, INDEX_CLEANUP and TRUNCATE.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add COMMIT AND CHAIN and ROLLBACK AND CHAIN commands.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add a WHERE clause to COPY FROM.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Allow to use CREATE OR REPLACE AGGREGATE command.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Allow to use mcv (most-common-value) in CREATE STATISTICS.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ADD REINDEX option CONCURRENTLY.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add EXPLAIN option SETTINGS.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-20 [46986ebc]
+ 2019-07-03 [beac296d]
+ -->
+ <para>
+ Allow to route relcache queries to load balance node. (Tatsuo Ishii)
+ </para>
+ <para>
+ Queries to build relcache entries were always sent to master (primary)
+ node. This is usually good because we could eliminate the bad effect
+ of replication delay. However if users want to lower the load of
+ master node, it would be nice if we could route the queries to other
+ than master node. This patch introduces new parameter
+ <xref linkend="guc-relcache-query-target">. If it is set to
+ <literal>load_balance_node</literal>, relcache queries will
+ be routed to load balance node. If it is set
+ to <literal>master</literal>, the queries are routed to
+ master node, which is same as before (this is the default).
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-07-01 [3ddf9aa0]
+ -->
+ <para>
+ Disable load balance after a SELECT having functions
+ specified in black function list or not specified in white
+ function list. (Bo Peng)
+ </para>
+ <para>
+ In <productname>Pgpool-II</productname> 4.0 or earlier, if
+ we set <xref linkend="guc-disable-load-balance-on-write"> =
+ <literal>transaction</literal>, when a write query is issued
+ inside an explicit truncation, subsequent queries should be
+ sent to primary only until the end of this transaction in
+ order to avoid the replication delay. However, the SELECTs
+ having write functions specified
+ in <xref linkend="guc-write-function-list"> or not specified
+ in <xref linkend="guc-read-only-function-list"> are not regarded
+ as a write query and the subsequent read queries are still
+ load balanced. This commit will disable load balance after
+ a SELECT having functions specified in black function list
+ or not specified in white function list.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-04 [693a6284]
+ -->
+ <para>
+ Implement new feature to not accept incoming
+ connections. (Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> accepts up to
+ <xref linkend="guc-num-init-children"> frontends and queues
+ up more connection requests until one of child process
+ becomes free. This mostly works well, but if each session
+ takes long time, the queue grows longer and the whole system
+ does not work smoothly. To overcome the problem, a new way
+ to deal with many connection requests from frontend is
+ implemented: When <xref linkend="guc-reserved-connections">
+ is set to 1 or greater, incoming connections from clients
+ are not accepted with error message "Sorry, too many clients
+ already", rather than blocked if the number of current
+ connections from clients is more than
+ (<varname>num_init_children</varname> -
+ <varname>reserved_connections</varname>). This is exactly
+ the same behavior as <productname>PostgreSQL</productname>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-22 [cf5fe7eb]
+ -->
+ <para>
+ Enhance performance by eliminating select(2) system calls
+ when they are not necessary. (Tatsuo Ishii, Jesper Pedersen)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-09 [778f611e]
+ -->
+ <para>
+ Enhance performance while sending message to
+ frontend. (Tatsuo Ishii)
+ </para>
+ <para>
+ SimpleForwardToFrontend(), which is responsible for sending
+ message to frontend, does write buffering only if it is
+ either 'D' (DataRow) or 'd' (CopyData). Other message types
+ were immediately written to socket. But actually this was
+ not necessary. So if the messages are not critical, just
+ write to buffer. With this 10-17% performance enhance was
+ observed.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-02-09 [eb6c5b17]
+ -->
+ <para>
+ Avoid error or notice message analysis if it's not
+ necessary. (Tatsuo Ishii)
+ </para>
+ <para>
+ After sending query to
+ backend, <productname>Pgpool-II</productname> always calls
+ pool_extract_error_message() via per_node_error_log(). In
+ the function memory allocation is performed even if error or
+ notice message is returned from backend. To avoid the waste
+ of CPU cycle, check message kind and avoid calling
+ pool_extract_error_message() if it's not error or notice
+ message.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2018-12-26 [702f7c86]
+ -->
+ <para>
+ Enhance performance of CopyData message handling. (Tatsuo Ishii)
+ </para>
+ <para>
+ When COPY XX FROM STDIN gets executed (typical client is
+ pg_dump), each copy row data is sent
+ from <productname>Pgpool-II</productname> to frontend using
+ CopyData message. Previously, one CopyData message was
+ followed by a flush, which costed a lot. Instead, now flush
+ is done in subsequent Command Complete, Notice message or
+ Error message. A quick test reveals that this change brings
+ x2.5 speed up.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-07 [dc974267]
+ -->
+ <para>
+ Allow to use MD5 hashed password
+ in <xref linkend="guc-health-check-password"> and
+ sr_<xref linkend="guc-sr-check-password">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-06-18 [51bc494a]
+ -->
+ <para>
+ Support ECDH key exchange with SSL (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-22 [82b5392b]
+ -->
+ <para>
+ Add backend_application_name to "pgpool show backend" group. (Tatsuo Ishii)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-04-30 [23fb4c12]
+ 2019-04-30 [fda13a93]
+ 2019-05-22 [68725c03]
+ -->
+ <para>
+ Deal with PostgreSQL 12. (Tatsuo Ishii)
+ </para>
+ <para>
+ recovery.conf cannot be used anymore. Standby's recovery configuration
+ is now in postgresql.conf. Also "standby.signal" file is needed in
+ PostgreSQL database cluster directory to start postmaster as a standby
+ server.
+ </para>
+ <para>
+ HeapTupleGetOid() is not available any more in PostgreSQL 12. Use
+ GETSTRUCT() and refer to oid column of Form_pg_proc.
+ </para>
+ <para>
+ Change pgpool_adm extension. Now that <literal>oid</literal>
+ is gone, the signature of CreateTemplateTupleDesc() has been
+ changed.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-03 [ff3c54eb]
+ -->
+ <para>
+ Speed up failover when all of backends are down. (Tatsuo
+ Ishii)
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> tries to find primary
+ node till <xref linkend="guc-search-primary-node-timeout">
+ expires even if all of the backend are in down status. This
+ is not only a waste of time but
+ makes <productname>Pgpool-II</productname> looked like
+ hanged because while searching primary node failover process
+ is suspended and all of
+ the <productname>Pgpool-II</productname> child process are
+ in defunct state, thus there's no process which accepts
+ connection requests from clients. Since the default value of
+ searching primary is 300 seconds, typically this keeps on
+ for 300 seconds. This is not comfortable for users.
+ </para>
+ <para>
+ To fix this immediately give up finding primary node
+ regardless
+ <xref linkend="guc-search-primary-node-timeout"> and
+ promptly finish the failover process if all of the backend
+ are in down status.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-05-27 [33df0d33]
+ 2019-08-08 [3922c12c]
+ -->
+ <para>
+ Resign the master watchdog node from master responsibilities if
+ the primary backend node gets into quarantine state on that. (Muhammad Usama)
+ </para>
+ <para>
+ By doing this, we could avoid the situation on which there's no
+ primary <productname>PostgreSQL</productname> server exists. To
+ implement this, make the master/coordinator watchdog node resign
+ from its status if it fails to get the consensus for the
+ quarantined primary node failover, within
+ FAILOVER_COMMAND_FINISH_TIMEOUT(15) seconds.
+ </para>
+ <para>
+ When the watchdog master resigns, because of quarantined primary
+ node its wd_priority is decreased to (-1), so that it should get
+ the least preference in the next election for the
+ master/coordinator node selection. And once the election is
+ concluded the wd_priority for the node gets restored to the
+ original configured value.
+ </para>
+ <para>
+ In case of failed consensus for standby node failover no action
+ is taken.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-08-29 [69419ac4]
+ -->
+ <para>
+ Add parameter <xref
+ linkend="guc-enable-consensus-with-half-votes"> to configure
+ majority rule calculations. (Muhammad Usama, Tatsuo Ishii)
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> takes the decision of quorum
+ existence and failover consensus after receiving the exact 50% of
+ votes when the watchdog cluster is configured with an even number
+ of nodes. With <xref
+ linkend="guc-enable-consensus-with-half-votes"> parameter, users
+ can tell <productname>Pgpool-II</productname>, whether the
+ distributed consensus in an even number of nodes cluster requires
+ (n/2) or ((n/2) +1) votes to decide the majority. Odd number of
+ clusters (3, 5, 7...) are not affected. Extra caution is needed
+ for 2 node watchdog cluster users. See <xref
+ linkend="migration-to-version-4-1"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-04 [fcb64ebe]
+ -->
+ <para>
+ Allow to specify absolute path in <xref linkend="guc-pool-passwd">. (Bo Peng)
+ </para>
+ <para>
+ Patch is provided by Danylo Hlynskyi.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-04 [0afbf1d6]
+ -->
+ <para>
+ Add various sample scripts. (Bo Peng)
+ </para>
+ <para>
+ Allow failover.sh.sample, follow_master.sh.sample, recovery_1st_stage.sample, recovery_2nd_stage.sample,
+ pgpool_remote_start.sample scripts to be included in distributions.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-01-27 [f03ebdba]
+ 2019-02-07 [5f259f3b]
+ 2019-02-20 [0c9f7167]
+ 2019-02-24 [b1f18e32]
+ 2019-02-24 [9c236d08]
+ 2019-02-28 [c706e0d6]
+ 2019-03-06 [06ad56e6]
+ 2019-03-22 [5abb77f1]
+ 2019-03-22 [b69e94e9]
+ 2019-04-07 [05cbf04b]
+ 2019-04-09 [709196da]
+ 2019-04-11 [a935a7df]
+ 2019-04-24 [9b9291f8]
+ 2019-04-27 [269042f8]
+ 2019-05-04 [21a66742]
+ 2019-05-04 [854659a1]
+ 2019-05-08 [c013bad0]
+ 2019-05-15 [e6a90863]
+ 2019-06-02 [d7d1b0e5]
+ 2019-06-02 [e0067db2]
+ 2019-07-16 [285fd88f]
+ 2019-07-09 [c20312d2]
+ 2019-07-02 [6a74642c]
+ 2019-07-02 [75fdbb25]
+ 2019-07-02 [05ba5cf3]
+ -->
+ <para>
+ Documentation enhancements:
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Add performance chapter (<xref linkend="performance">). (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enhance 'getting started' of 'tutorial' chapter,
+ 'watchdog' of 'tutorial' and some sections of 'server
+ administration'(takuma hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Update configuration example "Pgpool-II + watchdog
+ setup example". (bo peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Mention that schema qualifications cannot be used in
+ white/black_function_list. (tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enhance explanation
+ about <xref linkend="guc-failover-command">
+ and <xref linkend="guc-follow-primary-command">. (tatsuo
+ ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add note to detach_false_primary configuration
+ parameter. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add more explanation to follow_master_command. (tatsuo
+ ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enhance watchdog/pgpool-ii example so that it mentions
+ about pg_monitor role. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Mention that multi-statement queries are sent to
+ primary node only. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add load balancing description. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add useful link how to create pcp.conf in the pcp
+ reference page. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add more description to pcp_node_info manual. (tatsuo
+ ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add description to pg_md5 man page how to show
+ pool_passwd ready string. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enhance client authentication docs. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Enhance watchdog documents regarding quorum
+ failover. (tatsuo ishii)
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <para>
+ Mention that in raw mode or load_balance_mode = off
+ case for relation cache. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add general description about failover. (tatsuo ishii)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ In this release same bug fixes as <productname>Pgpool-II</productname> 4.0.7 are
+ already applied. See <xref linkend="release-4-0-7"> for more details of those fixes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/release-4.2.sgml -->
+<!-- See header comment in release.sgml about typical markup -->
+
+<sect1 id="release-4-2-1">
+ <title>Release 4.2.1</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-12-23</simpara>
+ </note>
+
+ <sect2>
+ <title>Changes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-12-22 [5b9a29c]
+ -->
+ <para>
+ Change the socket path to "/var/run/postgresql" in all of the <filename>pgpool.conf</filename> samples. (Bo Peng)
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-12-14 [3dc4cb2]
+ -->
+ <para>
+ Use single shared memory segment for all shared variables in Pgpool parent process (Muhammad Usama)
+ </para>
+ <para>
+ Shared memory segments is a limited resource and opening too many segments should be avoided.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-12-08 [db613fd]
+ -->
+ <para>
+ Delete any pre-existing watchdog command socket file at startup (Muhammad Usama)
+ </para>
+ <para>
+ Patch provided by Masaya Kawamoto
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <!--
+ 2020-12-22 [a180302]
+ -->
+ <para>
+ Doc: Add missing raw mode to "5.3. Clustering mode" and fix typos. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-12-21 [2aa234d]
+ -->
+ <para>
+ Fix incorrect heartbeat related results of <command>pcp_pool_status</command> and <command>SHOW POOL_STATUS</command> commands. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-12-18 [e7d9477]
+ 2020-12-18 [86ee4d6]
+ -->
+ <para>
+ Doc: fix usage of <command>firewall-cmd</command> in the installation tips section. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>firewall-cmd</command> opened unnecessary ports in the example.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-12-15 [59d7431]
+ 2020-12-13 [00d103f]
+ -->
+ <para>
+ Fix segfault that may occur when backend_flag = 'ALWAYS_PRIMARY|ALLOW_TO_FAILOVER' or failover_command = ''.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=672">bug 672</ulink>) (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-12-14 [83355dd]
+ -->
+ <para>
+ Fix for inconsistent watchdog node_id problem in <xref linkend="WD-CLI"> and watchdog lifecheck mechanism. (Muhammad Usama)
+ </para>
+ <para>
+ When pgpool node 0 (leader watchdog) is shutdown, all of the pgpool nodes terminate abnormally.
+ This commit fixed this issue.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-12-13 [cf668fa]
+ -->
+ <para>
+ Fix error if watchdog is disabled and <varname>wd_port</varname> is not defined. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-12-04 [3bd83aa]
+ -->
+ <para>
+ Fix compiler error on FreeBSD.
+ (<ulink url="https://www.pgpool.net/mantisbt/view.php?id=670">bug 670</ulink>) (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by ajs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-11-30 [86d4dd0]
+ -->
+ <para>
+ Fix file swapping race condition in <filename>pool_passwd</filename>. (Tatsuo Ishii)
+ </para>
+ <para>
+ Patch is provided by Masaya Kawamoto.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+</sect1>
+
+<sect1 id="release-4-2-0">
+ <title>Release 4.2.0</title>
+ <note>
+ <title>Release Date</title>
+ <simpara>2020-11-26</simpara>
+ </note>
+
+ <sect2>
+ <title>Overview</title>
+ <para>
+ Many enhancements are added to this version for easier
+ configuration and administration. Moreover new clustering mode
+ which allows not only write consistency but read consistency in
+ multiple <productname>PostgreSQL</productname> servers. Also SSL
+ is improved to allow more secure operation. New
+ <productname>PostgreSQL</productname> 13 <literal>SQL</literal>
+ parse is imported.
+ </para>
+
+ <para>
+ Please be warned that in this version some configuration parameters
+ are changed to use more appropriate language. Also some words used
+ in reporting are changed accordingly. See "Migration" section for
+ more details.
+ </para>
+
+ <para>
+ Below are major enhancements.
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Some items in the configuration file
+ <filename>pgpool.conf</filename> are vastly enhanced for easier
+ configuration and administration.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Implement <xref linkend="guc-logging-collector"> for easier log
+ management.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Implement <xref linkend="guc-log-disconnections"> to collect
+ disconnection logs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Implement <xref linkend="PG-ENC"> and <xref linkend="PG-MD5"> to
+ allow to register multiple passwords at once.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Allow to show statistics of health check by using <xref
+ linkend="SQL-SHOW-POOL-HEALTH-CHECK-STATS"> command, and also
+ allow to show statistics of issued SQL by using <xref
+ linkend="SQL-SHOW-POOL-BACKEND-STATS"> command.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ New PCP command <xref linkend="PCP-RELOAD-CONFIG"> is added.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Now it is possible to omit <xref
+ linkend="guc-write-function-list"> and <xref
+ linkend="guc-read-only-function-list"> by looking at system catalog
+ information.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add new clustering mode <xref
+ linkend="guc-snapshot-isolation-mode"> which guarantees not only
+ data modifications to multiple
+ <productname>PostgreSQL</productname> but read consistency.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Support LDAP authentication between clients and
+ <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add <xref linkend="guc-ssl-crl-file"> and <xref
+ linkend="guc-ssl-passphrase-command"> to SSL configuration.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Import PostgreSQL 13's SQL parser.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Migration to Version 4.2</title>
+
+ <itemizedlist>
+
+ <listitem>
+<!--
+Author: Tatsuo Ishii <ishii@sraoss.co.jp>
+2020-03-09 [f0fe8fe9] Unify master_slave_mode, master_slave_sub_mode and replication_mode into backend_clustering_mode.
+-->
+ <para>
+ master_slave_mode, master_slave_sub_mode and replication_mode are
+ deprecated and replaced by <xref
+ linkend="guc-backend-clustering-mode">. Please change them as
+ follows.
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ master_slave_mode = 'on', master_slave_sub_mode = 'stream' → backend_clustering_mode = 'streaming_replication'
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ master_slave_mode = 'on', master_slave_sub_mode = 'logical' → backend_clustering_mode = 'logical_replication'
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ master_slave_mode = 'on', master_slave_sub_mode = 'slony' → backend_clustering_mode = 'slony'
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ replication_mode = 'on' → backend_clustering_mode = 'native_replication'
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ replication_mode = 'off', master_slave_mode = 'off' → backend_clustering_mode = 'raw'
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+<!--
+2020-09-17 [9e366c14]
+-->
+ <para>
+ Cleanup language. (Umar Hayat)
+ </para>
+ <para>
+ Following changes are made in <filename>pgpool.conf</filename>.
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ black_function_list → write_function_list
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ white_function_list → read_only_function_list
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ black_query_pattern → primary_routing_query_pattern
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ black_memcache_table_list → cache_unsafe_table_list
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ white_memcache_table_list → cache_safe_table_list
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ ALWAYS_MASTER flag → ALWAYS_PRIMARY flag
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ follow_master_command → follow_primary_command
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Replace relcache_query_target option value 'master' to 'primary'.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+
+ <para>
+ Some words used in reporting are changed.
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ master → main
+ </para>
+ <para>
+ slave → replica
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Some parameter names used in scripts are changed.
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ master → main
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Some names used in watchdog are changed.
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ master → leader
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ </listitem>
+
+<!--
+Author: Bo Peng <pengbo@sraoss.co.jp>
+2020-08-11 [a840ecb2] New feature: Simplify Watchdog related configuration parameters.
+-->
+ <listitem>
+ <para>
+ Watchdog parameters below are deprecated.
+ <programlisting>
+ - wd_hostname
+ - wd_port
+ - wd_heartbeat_port
+ - heartbeat_device
+ - heartbeat_destination0
+ - heartbeat_destination_port0
+ - heartbeat_destination1
+ - heartbeat_destination_port1
+ - other_pgpool_hostname0
+ - other_pgpool_port0
+ - other_wd_port0
+ - other_pgpool_hostname1
+ - other_pgpool_port1
+ - other_wd_port1
+ </programlisting>
+ Use below parameters instead.
+ See <xref linkend="config-communication-watchdog"> for more details.
+ <programlisting>
+ hostname0 = 'server1'
+ wd_port0 = 9000
+ pgpool_port0 = 9999
+
+ hostname1 = 'server2'
+ wd_port1 = 9000
+ pgpool_port1 = 9999
+
+ hostname2 = 'server3'
+ wd_port2 = 9000
+ pgpool_port2 = 9999
+
+ heartbeat_hostname0 = 'server1'
+ heartbeat_port0 = 9694
+ heartbeat_device0 = ''
+
+ heartbeat_hostname1 = 'server2'
+ heartbeat_port1 = 9694
+ heartbeat_device1 = ''
+
+ heartbeat_hostname2 = 'server3'
+ heartbeat_port2 = 9694
+ heartbeat_device2 = ''
+ </programlisting>
+ Unlike 4.1 or before, now all watchdog parameters are identical
+ on all hosts. To distinguish which host is which, create a file
+ <filename>pgpool_node_id</filename> and put number 0, 1, 2
+ etc. to identify host.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <xref linkend="guc-write-function-list"> and <xref
+ linkend="guc-read-only-function-list"> are now both empty.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+ <sect2>
+ <title>Bug fixes</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ In this release same bug fixes as <productname>Pgpool-II</productname> 4.1.4 are
+ already applied. See <xref linkend="release-4-1-4"> for more details of those fixes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Major Enhancements</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2020-11-25 [935e045]
+ -->
+ <para>
+ Removing strerror() call from ereports. (Muhammad Usama)
+ </para>
+ <para>
+ Call to ereport() resets the errno value and using the "strerror(errno)" emits the wrong error message.
+ The right way is to use %m format specifier instead.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-09 [f0fe8fe9]
+ 2020-09-01 [82d77612]
+ -->
+ <para>
+ Unify master_slave_mode, master_slave_sub_mode and
+ replication_mode into <xref
+ linkend="guc-backend-clustering-mode">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [a840ecb2]
+ -->
+ <para>
+ Simplify Watchdog related configuration parameters. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-20 [b0f976be]
+ -->
+ <para>
+ Allow units to be specified with configuration settings. (Muhammad Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-03 [3996850a]
+ 2020-06-29 [d2888d59]
+ 2020-06-27 [35037bcd]
+ -->
+ <para>
+ Add <xref linkend="guc-logging-collector">. (Muhammad Usama, Japanese doc by Tatsuo Ishii)
+ </para>
+ <para>
+ Import PostgreSQL's logging collector.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-24 [86778775]
+ -->
+ <para>
+ Allow to collect disconnection log by <xref linkend="guc-log-disconnections">. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-25 [37772c5b]
+ 2020-04-07 [d8434662]
+ -->
+ <para>
+ Allow to set application name parameter of <xref
+ linkend="guc-log-line-prefix"> in more cases. (Tatsuo Ishii)
+ </para>
+ <para>
+ %a in <xref linkend="guc-log-line-prefix"> was only be set if
+ application_name is specified in startup message. Now it is
+ possible to set application_name if it is set in the connection
+ parameter or SET command.
+ </para>
+ <para>
+ Also set hard coded application_name in various internal process so
+ that admins can easily recognize each log line belonging to which
+ process.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-03 [afbcff6f]
+ -->
+ <para>
+ Change <xref linkend="PGPOOL-SETUP"> so that <xref
+ linkend="guc-log-line-prefix"> includes application name. (Tatsuo
+ Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-18 [78c217cd]
+ -->
+ <para>
+ Add support for an user/password input file to <xref
+ linkend="PG-ENC">. (Umar Hayat, Japanese doc by Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-06 [68d66a66]
+ -->
+ <para>
+ Add support for an user/password input file to <xref
+ linkend="PG-MD5">. (Umar Hayat, Japanese doc by Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-14 [9f74a228]
+ 2020-08-14 [689a8fcc]
+ 2020-08-14 [f04ef82b]
+ 2020-08-14 [d23f0af7]
+ 2020-08-14 [1afc6431]
+ 2020-08-17 [644c0898]
+ 2020-08-17 [241ff0f2]
+ 2020-08-18 [4b512891]
+ -->
+ <para>
+ Add <xref linkend="SQL-SHOW-POOL-BACKEND-STATS">. (Tatsuo Ishii)
+ </para>
+ <para>
+ The new command shows the number of SQL commands executed and
+ errors returned from backend since
+ <productname>Pgpool-II</productname> started.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-27 [c36a2804]
+ 2020-01-26 [cb35c9b8]
+ 2020-01-26 [154d826b]
+ -->
+ <para>
+ Add <xref linkend="SQL-SHOW-POOL-HEALTH-CHECK-STATS"> to show
+ health check statistics (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-24 [42919f2e]
+ -->
+ <para>
+ Add new PCP command <xref linkend="PCP-HEALTH-CHECK-STATS">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-25 [dfc56868]
+ -->
+ <para>
+ Add new pgpool_adm function <xref linkend="pgpool-adm-pcp-health-check-stats">. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-04 [c13a630f]
+ 2020-06-03 [9e979b7f]
+ 2020-05-21 [987b6994]
+ -->
+ <para>
+ New PCP command <xref linkend="PCP-RELOAD-CONFIG"> for reloading
+ the pgpool configuration (Jianshen Zhou, Muhammad Usama, Japanese
+ doc by Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-04 [87e6e11c]
+ 2020-05-06 [b859969c]
+ -->
+ <para>
+ Allow to stop whole pgpool cluster by using <xref
+ linkend="PCP-STOP-PGPOOL"> command. (Muhammad Usama, Japanese doc
+ by Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2019-09-24 [6156534a]
+ -->
+ <para>
+ Add wd_cli utility (Muhammad Usama, Japanese doc by Tatsuo Ishii)
+ </para>
+ <para>
+ <xref linkend="wd-cli"> makes it easier to integrate the external health check systems with the
+ <productname>Pgpool-II</productname>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-02 [b7f902d9]
+ -->
+ <para>
+ Implement automatic writing function detection by checking volatile property. (Tatsuo Ishii, Hou, Zhijie)
+ </para>
+ <para>
+ If a function included in SELECT/WITH has volatile property by
+ checking system catalog, regard it a writing function. This
+ feature is available only when the <xref
+ linkend="guc-write-function-list"> and the <xref
+ linkend="guc-read-only-function-list"> are both empty. The default of
+ the black_function_list and the white_function_list are now empty
+ string so that this feature is enabled by default.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-26 [fc9fa8db]
+ -->
+ <para>
+ Enhance the way getting function names in multiple places. (Hou, Zhijie)
+ </para>
+ <para>
+ With query cache enabled, <productname>Pgpool-II</productname>
+ examines function calls in SELECTs. However if a function were
+ called with schema qualification, it was not recognized. This
+ commit fix to allow schema qualifications in the case.
+ </para>
+ <para>
+ Also now schema qualified function names in <xref
+ linkend="guc-write-function-list"> and <xref
+ linkend="guc-read-only-function-list"> are allowed. Note that if you
+ want to register schema qualified function names, you have to
+ register function names without schema qualification as well.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-21 [761d30a1]
+ -->
+ <para>
+ Add dml object level load balance support in <xref
+ linkend="guc-disable-load-balance-on-write"> .(Subiao, Muhammad
+ Usama)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-07 [cb34604d]
+ -->
+ <para>
+ Allow to use argument names in pgpool_adm functions. (Hou, Zhijie)
+ </para>
+ <para>
+ Example:
+ <programlisting>
+ SELECT * FROM pcp_node_count(host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
+ </programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-02 [537a2c1d]
+ -->
+ <para>
+ Add public API to invalidate query cache by table/database oid. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-26 [c18c12f8]
+ -->
+ <para>
+ Add support for LDAP authentication between client and pgpool. (Takuma Hoshiai)
+ See <xref linkend="auth-ldap"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-23 [5bc38fe1]
+ -->
+ <para>
+ Enhance scram/md5 auth regression test to use AES256 encrypted password. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-01 [3f9a0a3d]
+ 2020-06-27 [d8f5c20d]
+ 2020-06-26 [8b472278]
+ 2020-06-22 [6f35af74]
+ 2020-06-20 [ff76762c]
+ 2020-06-20 [91e39bb0]
+ 2020-06-19 [22930861]
+ -->
+ <para>
+ Add new <xref linkend="guc-backend-clustering-mode"> "snapshot
+ isolation mode". (Tatsuo Ishii)
+ </para>
+ <para>
+ This mode is similar to existing native replication mode except
+ it provides more strict read consistency among backends (so
+ called "atomic visibility") and will give a illusion that a
+ cluster consisting with multiple backends seems to be a single
+ <productname>PostgreSQL</productname> server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [859080bd]
+ -->
+ <para>
+ Add mention about hostssl/hostnossl to
+ <filename>pool_hba.conf</filename> sample file. (Tatsuo Ishii)
+ </para>
+ <para>
+ Although hostssl/hostnossl are supported,
+ <filename>pool_hba.conf</filename> comment did not mention about
+ it.
+ </para>
+ </listitem>
+ <listitem>
+ <!--
+ 2020-04-01 [6ea15445]
+ 2020-03-31 [9ee3d93c]
+ 2020-03-30 [eb0c7c2c]
+ 2020-03-30 [a01c37d8]
+ -->
+ <para>
+ Add support for <xref
+ linkend="guc-ssl-passphrase-command">. (Umar Hayat, Japanese doc
+ by Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-14 [dc3116c7]
+ -->
+ <para>
+ Add support for <xref linkend="guc-ssl-crl-file"> (CRL:
+ Certificate Revocation List). (Umar Hayat, Japanese doc by Tatsuo
+ Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-18 [fc9e9d37]
+ -->
+ <para>
+ Change relative path of SSL files to configuration
+ directory. (Umar Hayat, Japanese doc by Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-28 [eee4c86c]
+ -->
+ <para>
+ Allow to show appropriate process status by ps command with
+ extend queries. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-04-26 [a2a6005d]
+ -->
+ <para>
+ Downgrade too verbose authentication logs. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-30 [ef3d830f]
+ -->
+ <para>
+ Display more informative error message in authentication process. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-10 [6222cb3a]
+ -->
+ <para>
+ Suppress unnecessary error message when there's no standby
+ server. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-28 [20baad9d]
+ -->
+ <para>
+ Check if socket file exists at startup and remove them if PID
+ file doesn't exist. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-01-10 [1062b805]
+ -->
+ <para>
+ Teach <command>pgproto</command> notification response message. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-07 [86778775]
+ -->
+ <para>
+ Import PostgreSQL 13 beta3 new parser.
+ Major changes of PostgreSQL 13 parser include:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Remove an object's dependency on an extension
+ <programlisting>
+ ALTER TRIGGER ... NO DEPENDS ON EXTENSION ...
+ ALTER FUNCTION ... NO DEPENDS ON EXTENSION ...
+ </programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Allow FETCH FIRST to use WITH TIES.
+ <programlisting>
+ FETCH FIRST ... WITH TIES
+ </programlisting>
+ </para>
+ </listitem>
+
+<!--
+ <listitem>
+ <para>
+ Add ALTER TABLE clause DROP EXPRESSION
+ <programlisting>
+ ALTER TABLE ... DROP EXPRESSION
+ </programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Allow setting statistics target for extended statistics
+ <programlisting>
+ ALTER STATISTICS ... SET STATISTICS
+ </programlisting>
+ </para>
+ </listitem>
+-->
+ <listitem>
+ <para>
+ Allow ALTER VIEW to rename view columns
+ <programlisting>
+ ALTER VIEW ... RENAME COLUMN ... TO ...
+ </programlisting>
+ </para>
+ </listitem>
+<!--
+ <listitem>
+ <para>
+ Add CREATE DATABASE clause LOCALE option
+ <programlisting>
+ CREATE DATABASE ... LOCALE
+ </programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Add DROP DATABASE clause WITH FORCE option
+ <programlisting>
+ DROP DATABASE ... WITH (force)
+ </programlisting>
+ </para>
+ </listitem>
+-->
+ <listitem>
+ <para>
+ Add VACUUM clause PARALLEL option
+ <programlisting>
+ VACUUM (PARALLEL 1) ...
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-19 [51293488]
+ 2020-08-19 [7fecd5cd]
+ -->
+ <para>
+ and <command>watchdog_setup</command> with PostgreSQL's bin path
+ and lib path. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-17 [9c7c3047]
+ -->
+ <para>
+ Use <command>pg_config</command> to get
+ <productname>PostgreSQL</productname> lib path and add this path
+ to LD_LIBRARY_PATH environment parameter in regress.sh. (Bo Peng)
+ </para>
+ <para>
+
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [88a72578]
+ -->
+ <para>
+ Make RPMs to include <filename>pcp.conf</filename> and
+ <filename>pool_hba.conf</filename> sample files. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-31 [d7c75781]
+ -->
+ <para>
+ Change PCP UNIX_DOMAIN_PATH of RPM package to "/var/run/postgresql". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-27 [680e4d67]
+ -->
+ <para>
+ Rename src/redhat/pgpool_rhel7.sysconfig to
+ src/redhat/pgpool_rhel.sysconfig to make this file available on
+ RHEL8/CentOS8. (Bo Peng)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect2>
+
+ <sect2>
+ <title>Major Documentation Enhancements</title>
+ <itemizedlist>
+
+ <listitem>
+ <!--
+ 2020-11-25 [48d25a8]
+ -->
+ <para>
+ Add new documentation of <xref linkend="EXAMPLE-KUBERNETES"> "Pgpool-II on Kubernetes". (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-27 [317c39e]
+ -->
+ <para>
+ Add escalation.sh sample script executed by <xref linkend="guc-wd-escalation-command">. (Masaya Kawamoto)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-10-04 [a3d6554]
+ -->
+ <para>
+ Remove "8.2. Watchdog Configuration Example". (Bo Peng)
+ </para>
+ <para>
+ See <xref linkend="EXAMPLE-CLUSTER-PGPOOL-CONFIG-WATCHDOG"> of "Pgpool-II + Watchdog Setup Example" for watchdog configuration.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-09-01 [9d5bb1c6]
+ -->
+ <para>
+ Add Pgpool-II/PostgreSQL start/stop etc. documents. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <xref linkend="server-start"> etc. for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-18 [c5a51428]
+ -->
+ <para>
+ Mention that <xref linkend="PGPOOL-SETUP"> needs to be configured
+ to log into localhost using ssh without password. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-17 [28351775]
+ -->
+ <para>
+ Change sample scripts and yum repository urls. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-28 [d362cb5d]
+ -->
+ <para>
+ Clarify what <xref linkend="PCP-PROMOTE-NODE"> actually does. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-07-10 [19cbe75d]
+ -->
+ <para>
+ Update "Installation from RPM" section. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-06-23 [02d75774]
+ -->
+ <para>
+ Add note about <xref linkend="guc-auto-failback">. (Takuma Hoshiai)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-23 [d1330ae3]
+ -->
+ <para>
+ Add explanation about <filename>.pgpoolkey</filename>. (Tatsuo
+ Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-22 [06632468]
+ -->
+ <para>
+ Improve the description of <xref linkend="guc-wd-priority">. (Kenichiro Tanaka)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-10 [f4d6b41b]
+ -->
+ <para>
+ Add note about <xref linkend="guc-if-up-cmd"> and
+ <xref linkend="guc-if-down-cmd"> command. (Bo Peng)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-03-02 [3c2eba0d]
+ -->
+ <para>
+ Enhance installation documents. (Tatsuo Ishii)
+ </para>
+ <para>
+ Add "Planning" section (see <xref linkend="planning">) so that
+ users can grasp a big picture of installation.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-27 [b439c147]
+ -->
+ <para>
+ Explicitly mention that <productname>Pgpool-II</productname>
+ needs 3 nodes to avoid split brain. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <xref linkend="intro-whatis"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-27 [52ec89ce]
+ -->
+ <para>
+ Enhance description of failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <xref linkend="guc-failover-command"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-18 [13b5a290]
+ -->
+ <para>
+ Clarify the session disconnection conditions while
+ failover. (Tatsuo Ishii)
+ </para>
+ <para>
+ See <xref linkend="guc-failover-command"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-02-12 [ee597b3a]
+ -->
+ <para>
+ Enhance description of <xref
+ linkend="guc-enable-shared-relcache"> parameter. (Tatsuo Ishii)
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-08-11 [a6a15205]
+ -->
+ <para>
+ Add sample script links in configuration example. (Bo Peng)
+ </para>
+ <para>
+ See <xref linkend="example-cluster"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <!--
+ 2020-05-23 [249d2955]
+ -->
+ <para>
+ Mention about environment variable PGPOOLKEYFILE in <xref
+ linkend="PG-ENC"> command. (Tatsuo Ishii)
+ </para>
+ <para>
+ <command>pg_enc</command> command actually recognizes the
+ environment variable.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/release.sgml -->
+<!--
+
+Typical markup:
+
+&<> use & escapes
+PostgreSQL <productname>
+postgresql.conf, pg_hba.conf,
+ recovery.conf <filename>
+[A-Z][A-Z_ ]+[A-Z_] <command>, <literal>, <envar>, <acronym>
+[A-Za-z_][A-Za-z0-9_]+() <function>
+-[-A-Za-z_]+ <option>
+[A-Za-z_]+/[A-Za-z_]+ <filename>
+psql <application>
+pg_[A-Za-z0-9_]+ <application>, <structname>
+[A-Z][A-Z][A-Z_ ]* <type>
+[a-z]+_[a-z_]+ <varname>
+
+non-ASCII characters find using grep -P '[\x80-\xFF]'
+ convert to HTML4 named entity (&) escapes
+
+ official: http://www.w3.org/TR/html4/sgml/entities.html
+ one page: http://www.zipcon.net/~swhite/docs/computers/browsers/entities_page.html
+ other lists: http://www.zipcon.net/~swhite/docs/computers/browsers/entities.html
+ http://www.zipcon.net/~swhite/docs/computers/browsers/entities_page.html
+ http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
+
+ we cannot use UTF8 because SGML Docbook does not support it
+
+ do not use numeric _UTF_ numeric character escapes (&#nnn;),
+ we can only use Latin1
+
+ Example: Alvaro Herrera is Álvaro Herrera
+
+wrap long lines
+
+For new features, add links to the documentation sections.
+
+-->
+
+<appendix id="release">
+ <title>Release Notes</title>
+
+ <para>
+ The release notes contain the significant changes in each
+ <productname>Pgpool-II</> release, with major features and migration
+ issues listed at the top. The release notes do not contain changes
+ that affect only a few users or changes that are internal and therefore not
+ user-visible.
+ </para>
+
+ <para>
+ A complete list of changes for each release can be obtained by
+ viewing the <!--<link linkend="git">-->Git<!--</link>--> logs for each release.
+ The <ulink
+ url="http://www.pgpool.net/pipermail/pgpool-committers/"><literal>pgpool-committers</literal>
+ email list</ulink> records all source code changes as well. There is also
+ a <ulink url="http://git.postgresql.org/gitweb?p=pgpool2.git;a=summary">web
+ interface</ulink> that shows changes to specific files.
+ </para>
+
+ <para>
+ The name appearing next to each item represents the major developer for
+ that item. Of course all changes involve community discussion and patch
+ review, so each item is truly a community effort.
+ </para>
+
+ <!--
+ To add a new major-release series, add an entry here and in filelist.sgml.
+
+ The reason for splitting the release notes this way is so that appropriate
+ subsets can easily be copied into back branches.
+ -->
+
+ &release-4.2;
+ &release-4.1;
+ &release-4.0;
+ &release-3.7;
+ &release-3.6;
+ &release-3.5;
+ &release-3.4;
+ &release-3.3;
+ &release-3.2;
+ &release-3.1;
+
+</appendix>
--- /dev/null
+<!-- doc/src/sgml/restrictions.sgml -->
+
+<sect1 id="restrictions" xreflabel="restrictions">
+ <!--
+ <title>Restrictions</title>
+ -->
+ <title>限制事项</title>
+
+ <para>
+ This section describes current restrictions of <productname>Pgpool-II</productname>.
+
+ <variablelist>
+
+ <varlistentry>
+ <term>Functionality of PostgreSQL</term>
+ <listitem>
+ <para>
+ If you use <function>pg_terminate_backend()</function> to stop
+ a backend, this will trigger a failover. The reason why this
+ happens is that <productname>PostgreSQL</productname> sends
+ exactly the same message for a terminated backend as for a full
+ postmaster shutdown. There is no workaround prior of version
+ 3.6. From version 3.6, this limitation has been mitigated. If
+ the argument to the function (that is a process id) is a
+ constant, you can safely use the function. In extended protocol
+ mode, you cannot use the function though.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Load Balancing</term>
+ <listitem>
+ <para>
+ Multi-statement queries (multiple SQL commands on single line)
+ are always sent to primary node (in streaming replication mode)
+ or main node (in other
+ modes). Usually <productname>Pgpool-II</productname> dispatch
+ query to appropriate node, but it's not applied to
+ multi-statement queries.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Authentication/Access Controls</term>
+ <listitem>
+ <para>
+ In the replication mode or native replication mode, trust and pam methods are supported. md5 is also
+ supported since <productname>Pgpool-II</productname> 3.0. md5
+ is supported by using an authentication file <filename>pool_passwd</filename>.
+ scram-sha-256, cert, and clear text password is also supported since
+ <productname>Pgpool-II</productname> 4.0.
+ <filename>pool_passwd</filename> is default name of the
+ authentication file. Here are the
+ steps to enable md5 authentication:
+ </para>
+
+ <orderedlist>
+
+ <listitem>
+ <para>
+ Login as the database's operating system user and type:
+ <programlisting>
+ pg_md5 --md5auth --username=<literal>your_username</literal> <literal>your_passwd</literal>
+ </programlisting>
+ user name and md5 encrypted password are registered into
+ pool_passwd. If pool_passwd does not exist yet, pg_md5
+ command will automatically create it for you. The format
+ of pool_passwd
+ is <literal>username:encrypted_passwd</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ You also need to add an appropriate md5 entry to
+ pool_hba.conf. See <xref linkend="auth-pool-hba-conf"> for more details.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Please note that the user name and password must be
+ identical to those registered
+ in <productname>PostgreSQL</productname>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ After changing md5 password (in both pool_passwd and
+ PostgreSQL of course), you need to
+ execute <application>pgpool reload</application>.
+ </para>
+ </listitem>
+ </orderedlist>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Large objects</term>
+ <listitem>
+ <para>
+ In streaming replication
+ mode, <productname>Pgpool-II</productname> supports large
+ objects.
+ </para>
+ <para>
+ In native replication
+ mode, <productname>Pgpool-II</productname> supports large
+ objects if the backend
+ is <productname>PostgreSQL</productname> 8.1 or later. For
+ this, you need to enable lobj_lock_table directive
+ in <filename>pgpool.conf</filename>. Large object replication
+ using backend function <function>lo_import</function> is not
+ supported, however.
+ </para>
+ <para>
+ In other mode, including Slony mode, large
+ objects are not supported.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Temporary tables</term>
+ <listitem>
+ <para>
+ Creating/inserting/updating/deleting temporary tables are
+ always executed on the primary in native replication mode.
+ SELECT on these tables is executed on primary as well. However
+ if the temporary table name is used as a literal in SELECT,
+ there's no way to detect it, and the SELECT will be load
+ balanced. That will trigger a "not found the table" error or
+ will find another table having same name. To avoid the
+ problem, use /*NO LOAD BALANCE*/ SQL comment.
+ </para>
+ <para>
+ Note that such literal table names used in queries to access
+ system catalogs do cause problems described above. psql's \d
+ command produces such that query:
+ <programlisting>
+ SELECT 't1'::regclass::oid;
+ </programlisting>
+ In such that case <productname>Pgpool-II</productname> always
+ sends the query to primary and will not cause the problem.
+ </para>
+
+ <para>
+ Tables created by <command>CREATE TEMP TABLE</command> will be
+ deleted at the end of the session by specifying DISCARD ALL in
+ reset_query_list if you are using PostgreSQL 8.3 or later.
+ </para>
+ <para>
+ For 8.2.x or earlier, tables created by <command>CREATE TEMP
+ TABLE</command> will not be deleted after exiting a
+ session. It is because of the connection pooling which, from
+ PostgreSQL's backend point of view, keeps the session
+ alive. To avoid this, you must explicitly drop the temporary
+ tables by issuing <command>DROP TABLE</command>, or
+ use <command>CREATE TEMP TABLE ... ON COMMIT DROP</command>
+ inside the transaction block.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Functions, etc. In Native Replication mode</term>
+ <listitem>
+ <para>
+ There is no guarantee that any data provided using a
+ context-dependent mechanism (e.g. random number, transaction
+ ID, OID, SERIAL, sequence), will be replicated correctly on
+ multiple backends. For SERIAL, enabling insert_lock will help
+ replicating data. insert_lock also helps SELECT setval() and
+ SELECT nextval().
+ </para>
+ <para>
+ INSERT/UPDATE
+ using <function>CURRENT_TIMESTAMP</function>, <function>CURRENT_DATE</function>,
+ <function>now()</function> will be replicated
+ correctly. INSERT/UPDATE for tables
+ using <function>CURRENT_TIMESTAMP</function>, <function>CURRENT_DATE</function>,
+ <function>now()</function> as their DEFAULT values will also
+ be replicated correctly. This is done by replacing those
+ functions by constants fetched from primary at query execution
+ time. There are a few limitations however:
+ </para>
+ <para>
+ In <productname>Pgpool-II</productname> 3.0 or before, the
+ calculation of temporal data in table default value is not
+ accurate in some cases. For example, the following table
+ definition:
+ <programlisting>
+ CREATE TABLE rel1(
+ d1 date DEFAULT CURRENT_DATE + 1
+ )
+ </programlisting>
+ is treated the same as:
+ <programlisting>
+ CREATE TABLE rel1(
+ d1 date DEFAULT CURRENT_DATE
+ )
+ </programlisting>
+ <productname>Pgpool-II</productname> 3.1 or later handles
+ these cases correctly. Thus the column "d1" will have
+ tomorrow as the default value. However this enhancement does
+ not apply if extended protocols (used in JDBC, PHP PDO for
+ example) or PREPARE are used.
+ </para>
+ <para>
+ Please note that if the column type is not a temporal one,
+ rewriting is not performed. Such example:
+ <programlisting>
+ foo bigint default (date_part('epoch'::text,('now'::text)::timestamp(3) with time zone) * (1000)::double precision)
+ </programlisting>
+ Suppose we have the following table:
+ <programlisting>
+ CREATE TABLE rel1(
+ c1 int,
+ c2 timestamp default now()
+ )
+ </programlisting>
+ We can replicate
+ <programlisting>
+ INSERT INTO rel1(c1) VALUES(1)
+ </programlisting>
+
+ since this turn into
+
+ <programlisting>
+ INSERT INTO rel1(c1, c2) VALUES(1, '2009-01-01 23:59:59.123456+09')
+ </programlisting>
+
+ However,
+ <programlisting>
+ INSERT INTO rel1(c1) SELECT 1
+ </programlisting>
+ cannot to be transformed, thus cannot be properly replicated in the current implementation.
+ Values will still be inserted, with no transformation at all.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>SQL type commands</term>
+ <listitem>
+ <para>
+ <link linkend="sql-commands">SQL type commands</link> cannot
+ be used in extended query mode.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Multi-byte Characters</term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> does not perform encoding conversion between client and
+ <productname>PostgreSQL</productname> for multi-byte characters.
+ The encoding for the client and backends must be the same.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Multi-statement Query</term>
+ <listitem>
+ <para>
+ <productname>Pgpool-II</productname> cannot process multi-statement queries.
+ However, when <productname>Pgpool-II</productname> is connected by <command>psql</command>, It is no problem.
+ <command>psql</command> parse multi-statement, send a statement one by one.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>libpq</term>
+ <listitem>
+ <para>
+ libpq is linked while building <productname>Pgpool-II</productname>.
+ libpq version must be 3.0 or later. Building <productname>Pgpool-II</productname> with libpq version 2.0 will fail.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/runtime.sgml -->
+
+<chapter id="runtime">
+ <title>Server Setup and Operation</title>
+
+ <para>
+ This chapter discusses how to set up and run the <productname>Pgpool-II</> server
+ and its interactions with the operating system.
+ </para>
+
+ <sect1 id="pgpool-II-user">
+ <title>The <productname>Pgpool-II</productname> User Account</title>
+
+ <indexterm>
+ <primary>Pgpool-II user</primary>
+ </indexterm>
+
+ <para>
+ As with any server daemon that is accessible to the outside world,
+ it is advisable to run <productname>Pgpool-II</productname> under a
+ separate user account. This user account should only own the data
+ that is managed by the server, and should not be shared with other
+ daemons. (For example, using the user <literal>nobody</literal> is a bad
+ idea.) It is not advisable to install executables owned by this
+ user because compromised systems could then modify their own
+ binaries.
+ </para>
+
+ <para>
+ To add a Unix user account to your system, look for a command
+ <command>useradd</command> or <command>adduser</command>. The user
+ name <systemitem>pgpool</systemitem> is often used, and is assumed
+ throughout this book, but you can use another name if you like.
+ </para>
+ </sect1>
+
+ <sect1 id="configuring-pcp-conf">
+ <title>Configuring pcp.conf</title>
+
+ <indexterm>
+ <primary>pcp configuration</primary>
+ </indexterm>
+
+ <para>
+ <productname>Pgpool-II</productname> provides a interface
+ for administrators to perform management operation, such as
+ getting <productname>Pgpool-II</productname> status or terminating
+ <productname>Pgpool-II</productname> processes
+ remotely. <filename>pcp.conf</filename> is the user/password file
+ used for authentication by this interface. All operation modes
+ require the <filename>pcp.conf</filename> file to be set. A
+ <filename>$prefix/etc/pcp.conf.sample</filename> file is created
+ during the installation
+ of <productname>Pgpool-II</productname>. Copy the file as
+ <filename>$prefix/etc/pcp.conf</filename> and add your user name and password
+ to it.
+
+ <screen>
+ <prompt>$</> <userinput>cp $prefix/etc/pcp.conf.sample $prefix/etc/pcp.conf</userinput>
+ </screen>
+
+ An empty line or a line starting with <literal>#</literal> is treated as a
+ comment and will be ignored. A user name and its associated
+ password must be written as one line using the following format:
+
+ <synopsis>
+ <replaceable>username</>:<replaceable>[md5 encrypted password]</>
+ </synopsis>
+
+ <replaceable>[md5 encrypted password]</> can be produced with the <filename>$prefix/bin/pg_md5</> command.
+
+ <screen>
+ <prompt>$</> <userinput>pg_md5 your_password</userinput>
+ 1060b7b46a3bd36b3a0d66e0127d0517
+ </screen>
+
+ If you don't want pass the password as the argument, execute <command>pg_md5 -p</command>.
+
+ <screen>
+ <prompt>$</> <userinput>pg_md5 -p</userinput>
+ password: <userinput>your_password</userinput>
+ </screen>
+
+ The <filename>pcp.conf</filename> file must be readable by the
+ user who executes <productname>Pgpool-II</productname>.
+ </para>
+
+ </sect1>
+
+ <sect1 id="configuring-pgpool">
+ <title>Configuring Pgpool-II</title>
+
+ <indexterm>
+ <primary>Pgpool-II configuration</primary>
+ </indexterm>
+
+ <sect2 id="configuring-pgpool-conf">
+ <title>Configuring pgpool.conf</title>
+
+ <para>
+ <filename>pgpool.conf</filename> is the main configuration file
+ of <productname>Pgpool-II</productname>. You need to specify the
+ path to the file when
+ starting <productname>Pgpool-II</productname>
+ using <option>-f</option> option.
+ <filename>pgpool.conf</filename> is located
+ at <filename>$prefix/etc/pgpool.conf</filename> by default,
+ if it installed from source code.
+ </para>
+
+ <para>
+ For each <productname>Pgpool-II</productname> clustering mode,
+ there are sample configurations.
+ </para>
+
+ <table id="pgpool-conf-samples-table">
+ <title>pgpool.conf samples</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Clustering mode</entry>
+ <entry>Configuration file name</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Streaming replication mode</entry>
+ <entry><literal>pgpool.conf.sample-stream</literal></entry>
+ </row>
+ <row>
+ <entry>Replication mode</entry>
+ <entry><literal>pgpool.conf.sample-replication</literal></entry>
+ </row>
+ <row>
+ <entry>Logical replication mode</entry>
+ <entry><literal>pgpool.conf.sample-logical</literal> </entry>
+ </row>
+ <row>
+ <entry>Slony mode</entry>
+ <entry><literal>pgpool.conf.sample-slony</literal></entry>
+ </row>
+ <row>
+ <entry>Snapshot isolation mode</entry>
+ <entry><literal>pgpool.conf.sample-snapshot</literal></entry>
+ </row>
+ <row>
+ <entry>Raw mode</entry>
+ <entry><literal>pgpool.conf.sample-raw</literal> </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ These configuration files are located at /usr/local/etc with
+ default installation from source code.
+ You can copy one of them as <filename>pgpool.conf</filename>.
+ (probably you need root privilege for this)
+ <programlisting>
+ # cd /usr/local/etc
+ # cp pgpool.conf.sample-stream pgpool.conf
+ </programlisting>
+ </para>
+ </sect2>
+
+ <sect2 id="running-mode">
+ <title>Running mode of Pgpool-II</title>
+
+ <indexterm zone="running-mode">
+ <primary>streaming replication mode</primary>
+ </indexterm>
+
+ <indexterm zone="running-mode">
+ <primary>native replication mode</primary>
+ </indexterm>
+
+ <indexterm zone="running-mode">
+ <primary>main replica mode</primary>
+ </indexterm>
+
+ <indexterm zone="running-mode">
+ <primary>logical replication mode</primary>
+ </indexterm>
+
+ <indexterm zone="running-mode">
+ <primary>snapshot isolation mode</primary>
+ </indexterm>
+
+ <para>
+ There are six different running modes in
+ <productname>Pgpool-II</>: streaming replication mode, logical
+ replication mode, main replica mode (slony mode), native
+ replication mode, raw mode and snapshot isolation mode. In any
+ mode, <productname>Pgpool-II</> provides connection pooling,
+ and automatic fail over.
+ Online recovery can be used only with streaming replication mode and native replication mode.
+ </para>
+
+ <para>
+ Those modes are exclusive each other and cannot be changed after
+ starting the server. You should make a decision which to use in
+ the early stage of designing the system. If you are not sure, it
+ is recommended to use the streaming replication mode.
+ </para>
+
+ <para>
+ The <firstterm>streaming replication mode</firstterm> can be
+ used with <productname>PostgreSQL</> servers operating streaming
+ replication. In this mode, <productname>PostgreSQL</> is
+ responsible for synchronizing databases. This mode is widely
+ used and most recommended way to
+ use <productname>Pgpool-II</>. Load balancing is possible in the
+ mode.
+ </para>
+
+ <para>
+ In the <firstterm>native replication
+ mode</firstterm>, <productname>Pgpool-II</> is responsible for
+ synchronizing databases. The advantage for the mode is the
+ synchronization is done in synchronous way: writing to the
+ database does not return until all of <productname>PostgreSQL</>
+ servers finish the write operation. However, you could get a
+ similar effect using <productname>PostgreSQL</> 9.6 or later
+ with <literal>synchronous_commit = remote_apply</literal> being
+ set in streaming replication. If you could use the setting, we
+ strongly recommend to use it instead of native replication mode
+ because you can avoid some <xref linkend="restrictions"> in the
+ native replication mode. Since <productname>PostgreSQL</> does
+ not provide cross node snapshot control, it is possible that
+ session X can see data on node A committed by session Y before
+ session Y commits data on node B. If session X tries to update
+ data on node B based on the data seen on node A, then data
+ consistency between node A and B might be lost. To avoid the
+ problem, user need to issue an explicit lock on the data. This is
+ another reason why we recommend to use streaming replication
+ mode with <literal>synchronous_commit = remote_apply</literal>.
+ </para>
+ <para>
+ Load balancing is possible in the mode.
+ </para>
+
+ <para>
+ The <firstterm>logical replication mode</firstterm> can be used
+ with <productname>PostgreSQL</> servers operating logical
+ replication. In this mode, <productname>PostgreSQL</> is
+ responsible for synchronizing tables. Load balancing is possible
+ in the mode. Since logical replication does not replicate all
+ tables, it's user's responsibility to replicate the table which
+ could be load balanced. <productname>Pgpool-II</> load balances
+ all tables. This means that if a table is not
+ replicated, <productname>Pgpool-II</> may lookup outdated tables
+ in the subscriber side.
+ </para>
+
+ <para>
+ The <firstterm>main replica mode</firstterm> mode (slony mode)
+ can be used with <productname>PostgreSQL</> servers
+ operating <productname>Slony</>. In this
+ mode, <productname>Slony</>/<productname>PostgreSQL</> is
+ responsible for synchronizing
+ databases. Since <productname>Slony-I</> is being obsoleted by
+ streaming replication, we do not recommend to use this mode
+ unless you have specific reason to
+ use <productname>Slony</>. Load balancing is possible in the
+ mode.
+ </para>
+
+ <para>
+ The <firstterm>snapshot isolation mode</firstterm> is similar to
+ the native replication mode and it adds the visibility consistency
+ among nodes. Please note that there are some limitations in this
+ mode and currently (in <productname>Pgpool-II</productname> 4.2)
+ this mode is regarded as "experimental" implementation. Be warned
+ that careful testings are required before you implement this in a
+ production system.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ It is necessary to set the transaction isolation level to
+ REPEATABLE READ. That means you need to set it in
+ <filename>postgresql.conf</filename> like this:
+ <programlisting>
+ default_transaction_isolation = 'repeatable read'
+ </programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Consistent visibility in SERIAL data type and sequences are not
+ guaranteed.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ In the <firstterm>raw
+ mode</firstterm>, <productname>Pgpool-II</> does not care about
+ the database synchronization. It's user's responsibility to make
+ the whole system does a meaningful thing. Load balancing
+ is <emphasis>not</emphasis> possible in the mode.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="configuring-backend-info">
+ <title>Configuring backend information</title>
+
+ <para>
+ For <productname>Pgpool-II</productname> to recognize <productname>PostgreSQL</>
+ backend servers, you need to configure <varname>backend*</varname>
+ in <filename>pgpool.conf</filename>. For starters, at
+ least <xref linkend="guc-backend-hostname">
+ and <xref linkend="guc-backend-port"> parameters are required to
+ be set up to start <productname>Pgpool-II</> server.
+ </para>
+
+ <sect2 id="backend-settings">
+ <title>Backend Settings</title>
+
+ <para>
+ Backend <productname>PostgreSQL</> used by <productname>Pgpool-II</> must be specified in <filename>pgpool.conf</filename>.
+ See <xref linkend="runtime-config-backend-settings">
+ </para>
+
+ <!--
+ <variablelist>
+
+ <varlistentry id="guc-backend-hostname" xreflabel="backend_hostname">
+ <term><varname>backend_hostname</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_hostname</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_hostname</varname> specifies where to
+ connect to the <productname>PostgreSQL</productname>
+ backend. It is used
+ by <productname>Pgpool-II</productname> to communicate
+ with the server.
+ </para>
+
+ <para>
+ For TCP/IP communication, this parameter can take a hostname
+ or an IP address. If this begins with a slash, it specifies
+ Unix-domain communication rather than TCP/IP; the value is
+ the name of the directory in which the socket file is
+ stored. The default behavior when backend_hostname is empty
+ ('') is to connect to a Unix-domain socket in /tmp.
+ </para>
+
+ <para>
+ Multiple backends can be specified by adding a number at the
+ end of the parameter name (e.g.backend_hostname0). This
+ number is referred to as "DB node ID", and it starts from
+ 0. The backend which was given the DB node ID of 0 will be
+ called "Main DB". When multiple backends are defined, the
+ service can be continued even if the Main DB is down (not
+ true in some modes). In this case, the youngest DB node ID
+ alive will be the new Main DB.
+ </para>
+
+ <para>
+ Please note that the DB node which has id 0 has no special
+ meaning if operated in streaming replication mode. Rather,
+ you should care about if the DB node is the "primary node" or
+ not. See Streaming Replication for more details.
+ </para>
+
+ <para>
+ If you plan to use only one PostgreSQL server, specify it by
+ backend_hostname0.
+ </para>
+
+ <para>
+ New nodes can be added in this parameter by reloading a
+ configuration file. However, values cannot be updated so
+ you must restart <productname>Pgpool-II</productname> in
+ that case.
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry id="guc-backend-port" xreflabel="backend_port">
+ <term><varname>backend_port</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>backend_port</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_port</varname> specifies the port number
+ of the backends. Multiple backends can be specified by
+ adding a number at the end of the parameter name
+ (e.g. backend_port0). If you plan to use only one
+ PostgreSQL server, specify it by backend_port0.
+ </para>
+ <para>
+ New backend ports can be added in this parameter by
+ reloading a configuration file. However, values cannot be
+ updated so you must
+ restart <productname>Pgpool-II</productname> in that case.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-backend-data-directory" xreflabel="backend_data_directory">
+ <term><varname>backend_data_directory</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_data_directory</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_data_directory</varname> specifies the
+ database directory. Multiple backends can be
+ specified by adding a number at the end of the parameter
+ name (e.g. backend_data_directory0). If you plan to use
+ only one PostgreSQL server, specify it by
+ backend_data_directory0.
+ </para>
+ <para>
+ New backend data_directories can be added in this parameter
+ by reloading a configuration file. However, values cannot
+ be updated so you must
+ restart <productname>Pgpool-II</productname> in that case.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-backend-flag" xreflabel="backend_flag">
+ <term><varname>backend_flag</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>backend_flag</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+
+ <listitem>
+ <para>
+ <varname>backend_flag</varname> controls various backend
+ behavior. Multiple backends can be specified by adding a
+ number at the end of the parameter name
+ (e.g. backend_flag0). If you plan to use only one
+ PostgreSQL server, specify it by backend_flag0.
+ </para>
+ <para>
+ New backend flags can be added in this parameter by
+ reloading a configuration file. Currently followings are
+ allowed. Multiple flags can be specified by using "|".
+ </para>
+
+ <table id="backend-flag-table">
+ <title>Backend flags</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Flag</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>ALLOW_TO_FAILOVER</literal></entry>
+ <entry>Allow to failover or detaching backend. This
+ is the default. You cannot specify with
+ DISALLOW_TO_FAILOVER at a same time.</entry>
+ </row>
+ <row>
+ <entry><literal>DISALLOW_TO_FAILOVER</literal></entry>
+ <entry>This is useful when you protect backend by
+ using HA (High Availability) softwares such as
+ Heartbeat or Pacemaker. You cannot specify with
+ ALLOW_TO_FAILOVER at a same time.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ -->
+
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="server-start">
+ <title>Starting Pgpool-II and PostgreSQL</title>
+
+ <para>
+ To start <productname>Pgpool-II</productname>, execute:
+<screen>
+$ <userinput>pgpool -f /usr/local/etc/pgpool.conf -F /usr/local/etc/pcp.conf</userinput>
+</screen>
+ which will start the server running in the background. "-f"
+ specifies the path to the main pgpool configuration file and "-F"
+ specifies the path to the configuration file of pcp server, which
+ is the control server for <productname>Pgpool-II</productname>. For
+ other options of the command please take a look at <xref
+ linkend="pgpool"> manual.
+ </para>
+
+ <para>
+ Before starting <productname>Pgpool-II</productname>, you must
+ start <productname>PostgreSQL</productname> because if
+ <productname>PostgreSQL</productname> has not started yet,
+ <productname>Pgpool-II</productname> triggers failover process and
+ makes <productname>PostgreSQL</productname> is in down status.
+ </para>
+
+ <para>
+ If you have difficulty in controlling the startup sequence of
+ <productname>PostgreSQL</productname>, for example
+ <productname>Pgpool-II</productname> and
+ <productname>PostgreSQL</productname> are installed on different
+ servers, you can make <xref
+ linkend="guc-search-primary-node-timeout"> longer (the default is 5
+ minutes) so that <productname>Pgpool-II</productname> waits for
+ <productname>PostgreSQL</productname> starts up until <xref
+ linkend="guc-search-primary-node-timeout"> expires. If
+ <productname>PostgreSQL</productname> starts up before <xref
+ linkend="guc-search-primary-node-timeout"> expires,
+ <productname>Pgpool-II</productname> should start up without
+ problem. If <xref linkend="guc-search-primary-node-timeout">
+ expires before <productname>PostgreSQL</productname> starts up, no
+ primary node will be detected, which means you cannot execute
+ DML/DDL. You need to restart <productname>Pgpool-II</productname>
+ in this case. To confirm that the primary node exists you can use
+ <xref linkend="sql-show-pool-nodes"> command.
+ </para>
+
+ <para>
+ Please note <xref linkend="guc-search-primary-node-timeout"> can
+ only be used in the streaming replication mode because the
+ parameter is only valid in the mode. See <xref
+ linkend="running-mode"> for more details about streaming
+ replication mode. For other mode, tweak the health check (see <xref
+ linkend="runtime-config-health-check">) parameters so that there's
+ enough time before <productname>PostgreSQL</productname> becomes
+ available.
+ </para>
+
+ <para>
+ If health check detects that <productname>PostgreSQL</productname>
+ is not available before <productname>Pgpool-II</productname> starts
+ up, some or all <productname>PostgreSQL</productname> are
+ recognized in "down" status. In this case you need to manually put
+ the <productname>PostgreSQL</productname> server in "up" state by
+ using <xref linkend="pcp-attach-node"> command. If a client tries
+ to connect to <productname>Pgpool-II</productname> before
+ <productname>PostgreSQL</productname> is available, failover could
+ be triggered. In this case you also need to execute <xref
+ linkend="pcp-attach-node"> command to put the
+ <productname>PostgreSQL</productname> server in "up" state.
+ </para>
+ </sect1>
+
+ <sect1 id="server-stop">
+ <title>Stopping Pgpool-II and PostgreSQL</title>
+
+ <indexterm zone="server-stop">
+ <primary>shutdown</primary>
+ </indexterm>
+
+ <para>
+ To stop <productname>Pgpool-II</productname>, execute:
+<screen>
+$ <userinput>pgpool -f /usr/local/etc/pgpool.conf -F /usr/local/etc/pcp.conf -m fast stop</userinput>
+</screen>
+ "-m" option specifies how gently stops
+ <productname>Pgpool-II</productname>. "fast" means shutdown
+ <productname>Pgpool-II</productname> immediately even if there are
+ existing connections from clients. You can specify "smart" to the
+ option, which force <productname>Pgpool-II</productname> to wait
+ until all clients are disconnected from
+ <productname>Pgpool-II</productname>. But this could make
+ <productname>Pgpool-II</productname> wait forever and this may
+ result in sending SIGKILL signal from the operating system and
+ leaving garbage, which will bring troubles next time when you start
+ <productname>Pgpool-II</productname>.
+ </para>
+
+ <para>
+ After shutting down <productname>Pgpool-II</productname>, you can
+ shutdown <productname>PostgreSQL</productname>.
+ </para>
+ </sect1>
+
+ <sect1 id="server-temporarily-shutdown">
+ <title>Temporarily Shutting Down PostgreSQL</title>
+
+ <indexterm zone="server-temporarily-shutdown">
+ <primary>shutdown</primary>
+ </indexterm>
+
+ <para>
+ Sometimes you want to temporarily stop or restart
+ <productname>PostgreSQL</productname> to maintain or version up
+ it. In this section how to perform the task with minimum downtime.
+ </para>
+
+ <para>
+ Stopping or restarting <productname>PostgreSQL</productname>
+ causes failover. If the running mode is not streaming replication
+ mode, or the server is a standby server in streaming replication
+ mode, probably that's not a big deal because clients can always
+ use other servers in the cluster. However if the server is primary
+ server, it will cause change of primary server by promoting one of
+ the standby servers. Moreover if there's only one server remains
+ in the cluster, there are no alternative server or standby server
+ which can be promoted.
+ </para>
+
+ <para>
+ In this case you can use <xref linkend="guc-backend-flag"> to avoid
+ failover. By setting below in pgpool.conf will avoid failover of
+ backend0.
+ <programlisting>
+ backend_flag0 = DISALLOW_TO_FAILOVER
+ </programlisting>
+ This will take effect by reloading or restarting
+ <productname>Pgpool-II</productname>. If this flag is set, failover
+ will not happen if the backend is not available. While the backend
+ is not available, clients will get error message:
+ <programlisting>
+ psql: error: could not connect to server: FATAL: failed to create a backend connection
+ DETAIL: executing failover on backend
+ </programlisting>
+ After restarting the backend, clients can connect as usual.
+
+ To allow failover on the backend again, you can set:
+ <programlisting>
+ backend_flag0 = ALLOW_TO_FAILOVER
+ </programlisting>
+ and reload or restart <productname>Pgpool-II</productname>.
+ </para>
+
+ </sect1>
+
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-ssl">
+ <title>Secure Socket Layer (SSL)</title>
+
+ <sect2 id="runtime-config-ssl-settings">
+
+ <title>SSL Settings</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-ssl" xreflabel="ssl">
+ <term><varname>ssl</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>ssl</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, <productname>Pgpool-II</productname> enables the <acronym>SSL</acronym>
+ for both the frontend and backend communications.
+ Default is off.
+ </para>
+ <note>
+ <para>
+ <xref linkend="guc-ssl-key"> and <xref linkend="guc-ssl-cert"> must also be
+ configured in order for SSL to work with frontend connections.
+ </para>
+ </note>
+ <note>
+ <para>
+ For SSL to work <productname>Pgpool-II</productname> must be build with OpenSSL support.
+ See <xref linkend="install-pgpool"> for details on building the
+ <productname>Pgpool-II</productname>.
+ </para>
+ </note>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-key" xreflabel="ssl_key">
+ <term><varname>ssl_key</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_key</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the private key file to be used for
+ incoming frontend connections. Relative paths are relative to
+ <productname>Pgpool-II</productname> configuration directory.
+ There is no default value for this option, and if left unset
+ <acronym>SSL</acronym> will be disabled for incoming frontend connections.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-cert" xreflabel="ssl_cert">
+ <term><varname>ssl_cert</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_cert</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the public x509 certificate file to be used
+ for the incoming frontend connections. Relative paths are relative to
+ <productname>Pgpool-II</productname> configuration directory.
+ There is no default value for this option, and if left unset
+ <acronym>SSL</acronym> will be disabled for incoming frontend connections.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-ca-cert" xreflabel="ssl_ca_cert">
+ <term><varname>ssl_ca_cert</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_ca_cert</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a <acronym>PEM</acronym> format <acronym>CA</acronym>
+ certificate file, which can be used to verify the backend server
+ certificates. Relative paths are relative to
+ <productname>Pgpool-II</productname> configuration directory. This is
+ analogous to the <command>-CApath</command> option of the
+ <command>OpenSSL verify(1)</command> command.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-ca-cert-dir" xreflabel="ssl_ca_cert_dir">
+ <term><varname>ssl_ca_cert_dir</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_ca_cert_dir</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the path to a directory containing <acronym>PEM</acronym>
+ format <acronym>CA</acronym> certificate files, which can be used
+ to verify the backend server certificates. This is analogous to
+ the <command>-CApath</command> option of the
+ <command>OpenSSL verify(1)</command> command.
+ </para>
+ <para>
+ The default value for this option is unset, which means no
+ verification takes place. Verification will still happen if
+ this option is not set but a value is provided for
+ <xref linkend="guc-ssl-ca-cert">.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-crl-file" xreflabel="ssl_crl_file">
+ <term><varname>ssl_crl_file</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_crl_file</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the file containing the SSL server certificate
+ revocation list (CRL). Relative paths are relative to
+ <productname>Pgpool-II</productname> configuration directory.
+ The default is empty, meaning no <acronym>CRL</acronym> file is loaded.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-ciphers" xreflabel="ssl_ciphers">
+ <term><varname>ssl_ciphers</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_ciphers</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies a list of <acronym>SSL</acronym> cipher suites that
+ are allowed to be used by SSL connections. See
+ the <citerefentry><refentrytitle>ciphers</refentrytitle></citerefentry>
+ manual page in the <application>OpenSSL</application> package
+ for the syntax of this setting and a list of supported values.
+ Only connections using TLS version 1.2 and lower are affected.
+ There is currently no setting that controls the cipher choices
+ used by TLS version 1.3 connections.
+ The default value
+ is <literal>HIGH:MEDIUM:+3DES:!aNULL</literal>, which is same
+ as <productname>PostgreSQL</productname>.
+ See <productname>PostgreSQL</productname> manual to know why
+ the value is chosen.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-prefer-server-ciphers" xreflabel="ssl_prefer_server_ciphers">
+ <term><varname>ssl_prefer_server_ciphers</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>ssl_prefer_server_ciphers</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies whether to use the server's <acronym>SSL</acronym>
+ cipher preferences, rather than the client's.
+ The default value is false.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-ecdh-curve" xreflabel="ssl_ecdh_curve">
+ <term><varname>ssl_ecdh_curve</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_ecdh_curve</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the name of the curve to use in <acronym>ECDH</acronym> key
+ exchange. It needs to be supported by all clients that connect.
+ It does not need to be the same curve used by the server's Elliptic
+ Curve key. The default value is <literal>prime256v1</literal>.
+ </para>
+ <para>
+ OpenSSL names for the most common curves are:
+ <literal>prime256v1</literal> (NIST P-256),
+ <literal>secp384r1</literal> (NIST P-384),
+ <literal>secp521r1</literal> (NIST P-521).
+ The full list of available curves can be shown with the command
+ <command>openssl ecparam -list_curves</command>. Not all of them
+ are usable in <acronym>TLS</acronym> though.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-dh-params-file" xreflabel="ssl_dh_params_file">
+ <term><varname>ssl_dh_params_file</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_dh_params_file</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the name of the file containing Diffie-Hellman parameters
+ used for so-called ephemeral DH family of SSL ciphers. The default is
+ empty. In which case compiled-in default DH parameters used. Using
+ Custom DH parameters reduces the exposure if an attacker manages to
+ crack the well-known compiled-in DH parameters. You can create your own
+ DH parameters file with the command <command>openssl -out dhparams.pem 2048</command>.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ssl-passphrase-command" xreflabel="ssl_passphrase_command">
+ <term><varname>ssl_passphrase_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ssl_passphrase_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Sets an external command to be invoked when a passphrase for decrypting
+ an SSL file such as a private key needs to be obtained. By default,
+ this parameter is empty, which means SSL file will not be loaded if passphrase is required.
+ </para>
+ <para>
+ The command must print the passphrase to the standard output and
+ exit with code 0. In the parameter value, %p is replaced by a prompt
+ string. (Write %% for a literal %.) Note that the prompt string will probably
+ contain whitespace, so be sure to quote adequately. A single newline is stripped
+ from the end of the output if present.
+ </para>
+ <para>
+ The command does not actually have to prompt the user for a passphrase.
+ It can read it from a file, obtain it from a keychain facility, or similar.
+ It is up to the user to make sure the chosen mechanism is adequately secure.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="runtime-g-connection-pooling-settings">
+
+ <title>Generating SSL certificates</title>
+
+ <para>
+ Certificate handling is outside the scope of this document. The
+ <ulink url="http://developer.postgresql.org/pgdocs/postgres/ssl-tcp.html">
+ Secure TCP/IP Connections with SSL</> page at postgresql.org has
+ pointers with sample commands for how to generate self-signed
+ certificates.
+ </para>
+
+ </sect2>
+
+</sect1>
--- /dev/null
+<!-- doc/src/sgml/start.sgml -->
+
+<chapter id="tutorial-start">
+ <title>Getting Started</title>
+
+ <sect1 id="tutorial-install">
+ <title>Installation</title>
+
+ <para>
+ In this section we assume that you have already
+ installed <productname>Pgpool-II</productname> following an
+ instruction described in <xref linkend="admin">.
+ Alternatively you can use <xref linkend="PGPOOL-SETUP"> to
+ create a temporary installation
+ of <productname>Pgpool-II</productname>
+ and <productname>PostgreSQL</productname>.
+ </para>
+ </sect1>
+
+ <sect1 id="tutorial-replication">
+ <title>Your First Replication</title>
+
+ <para>
+ In this section we are going to explain how to manage a
+ <productname>PostgreSQL</productname> cluster with streaming
+ replication using <productname>Pgpool-II</productname>, which is
+ one of most common setup.
+ </para>
+
+ <para>
+ Before going further, you should properly set
+ up <filename>pgpool.conf</filename> with streaming replication
+ mode. Sample configurations are provided with
+ <productname>Pgpool-II</productname>, there configuration file
+ are located at /usr/local/etc with default installation from
+ source code. you can copy
+ <filename>pgpool.conf.sample-stream</filename> as pgpool.conf.
+ <programlisting>
+ cp /usr/local/etc/pgpool.conf.sample-stream pgpool.conf
+ </programlisting>
+ </para>
+ <para>
+ If you plan to use <command>pgpool_setup</command>, type:
+ <programlisting>
+ pgpool_setup
+ </programlisting>
+ This will create
+ a <productname>Pgpool-II</productname> with streaming
+ replication mode installation,
+ primary <productname>PostgreSQL</productname> installation, and
+ a async standby <productname>PostgreSQL</productname>
+ installation.
+ </para>
+ <para>
+ From now on, we assume that you
+ use <command>pgpool_setup</command> to create the installation
+ under current directory. Please note that the current directory
+ must be empty before executing <command>pgpool_setup</command>.
+ </para>
+ <para>
+ To start the whole system, type:
+ <programlisting>
+ ./startall
+ </programlisting>
+ </para>
+ <para>
+ Once the system starts, you can check the cluster status by
+ issuing a pseudo SQL command called "show pool_nodes" to any of
+ databases. <command>pgpool_setup</command> automatically creates
+ "test" database. We use the database. Note that the port number
+ is 11000, which is the default port number assigned
+ to <productname>Pgpool-II</productname>
+ by <command>pgpool_setup</command>.
+ <programlisting>
+ $ psql -p 11000 -c "show pool_nodes" test
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | false | 0 | 2019-01-31 10:23:09
+ 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | true | 0 | 2019-01-31 10:23:09
+ (2 rows)
+ </programlisting>
+ The result shows that the "status" column is "up", which means
+ the
+ <productname>PostgreSQL</productname> is up and running, which
+ is good.
+ </para>
+ </sect1>
+
+ <sect1 id="tutorial-testing-replication">
+ <title>Testing Replication</title>
+
+ <para>
+ Let's test the replication functionality using a benchmark
+ tool <command>pgbench</command>, which comes with the
+ standard <productname>PostgreSQL</productname> installation.
+ Type following to create the benchmark tables.
+ <programlisting>
+ $ pgbench -i -p 11000 test
+ </programlisting>
+ To see if the replication works correctly, directly connect to
+ the primary and the standby server to see if they return
+ identical results.
+ <programlisting>
+ $ psql -p 11002 test
+ \dt
+ List of relations
+ Schema | Name | Type | Owner
+ --------+------------------+-------+---------
+ public | pgbench_accounts | table | t-ishii
+ public | pgbench_branches | table | t-ishii
+ public | pgbench_history | table | t-ishii
+ public | pgbench_tellers | table | t-ishii
+ (4 rows)
+ \q
+ $ psql -p 11003 test
+ \dt
+ List of relations
+ Schema | Name | Type | Owner
+ --------+------------------+-------+---------
+ public | pgbench_accounts | table | t-ishii
+ public | pgbench_branches | table | t-ishii
+ public | pgbench_history | table | t-ishii
+ public | pgbench_tellers | table | t-ishii
+ (4 rows)
+ </programlisting>
+ The primary server (port 11002) and the standby server (port
+ 11003) return identical results. Next, let's run pgbench for a
+ while and check to results.
+ <programlisting>
+ $ pgbench -p 11000 -T 10 test
+ starting vacuum...end.
+ transaction type: <builtin: TPC-B (sort of)>
+ scaling factor: 1
+ query mode: simple
+ number of clients: 1
+ number of threads: 1
+ duration: 10 s
+ number of transactions actually processed: 4276
+ latency average = 2.339 ms
+ tps = 427.492167 (including connections establishing)
+ tps = 427.739078 (excluding connections establishing)
+
+ $ psql -p 11002 -c "SELECT sum(abalance) FROM pgbench_accounts" test
+ sum
+ --------
+ 216117
+ (1 row)
+
+ $ psql -p 11003 -c "SELECT sum(abalance) FROM pgbench_accounts" test
+ sum
+ --------
+ 216117
+ (1 row)
+ </programlisting>
+ Again, the results are identical.
+ </para>
+ </sect1>
+
+ <sect1 id="tutorial-testing-load-balance">
+ <title>Testing Load Balance</title>
+ <para>
+ <productname>Pgpool-II</productname> allows read query load
+ balancing. It is enabled by default. To see the effect, let's
+ use <command>pgbench -S</command> command.
+ <programlisting>
+ $ ./shutdownall
+ $ ./startall
+ $ pgbench -p 11000 -c 10 -j 10 -S -T 60 test
+ starting vacuum...end.
+ transaction type: <builtin: select only>
+ scaling factor: 1
+ query mode: simple
+ number of clients: 10
+ number of threads: 10
+ duration: 60 s
+ number of transactions actually processed: 1086766
+ latency average = 0.552 ms
+ tps = 18112.487043 (including connections establishing)
+ tps = 18125.572952 (excluding connections establishing)
+
+ $ psql -p 11000 -c "show pool_nodes" test
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 537644 | false | 0 | 2019-01-31 11:51:58
+ 1 | /tmp | 11003 | up | 0.500000 | standby | 548582 | true | 0 | 2019-01-31 11:51:58
+ (2 rows)
+ </programlisting>
+ "select_cnt" column shows how many SELECT are dispatched to each
+ node. Since with the default
+ configuration, <productname>Pgpool-II</productname> tries to
+ dispatch equal number of SELECT, the column shows almost same
+ numbers.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> offers more sophisticated
+ strategy for load
+ balancing. See <xref linkend="runtime-config-load-balancing">
+ for more details.
+ </para>
+ </sect1>
+
+ <sect1 id="tutorial-testing-failover">
+ <title>Testing Fail Over</title>
+
+ <para>
+ <productname>Pgpool-II</productname> allows an automatic fail
+ over when <productname>PostgreSQL</productname> server goes
+ down. In this case <productname>Pgpool-II</productname> sets the
+ status of the server to "down" and continue the database
+ operation using remaining servers.
+ <programlisting>
+ $ pg_ctl -D data1 stop
+ waiting for server to shut down.... done
+ server stopped
+ $ psql -p 11000 -c "show pool_nodes" test
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 4276 | true | 0 | 2019-01-31 12:00:09
+ 1 | /tmp | 11003 | down | 0.500000 | standby | 1 | false | 0 | 2019-01-31 12:03:07
+ (2 rows)
+ </programlisting>
+ The standby node was shut down by pg_ctl
+ command. <productname>Pgpool-II</productname> detects it and
+ detaches the standby node. "show pool_nodes" command shows that
+ the standby node is in down status. You can continue to use the
+ cluster without the standby node:
+ <programlisting>
+ $ psql -p 11000 -c "SELECT sum(abalance) FROM pgbench_accounts" test
+ sum
+ --------
+ 216117
+ (1 row)
+ </programlisting>
+ What happens if the primary server goes down? In this case, one
+ of remaining standby server is promoted to new primary
+ server. For this testing, we start from the state in which both
+ nodes are up.
+ <programlisting>
+ $ psql -p 11000 -c "show pool_nodes" test
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | false | 0 | 2019-01-31 12:04:58
+ 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | true | 0 | 2019-01-31 12:04:58
+ (2 rows)
+
+ $ pg_ctl -D data0 stop
+ waiting for server to shut down.... done
+ server stopped
+ $ psql -p 11000 -c "show pool_nodes" test
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
+ 0 | /tmp | 11002 | down | 0.500000 | standby | 0 | false | 0 | 2019-01-31 12:05:20
+ 1 | /tmp | 11003 | up | 0.500000 | primary | 0 | true | 0 | 2019-01-31 12:05:20
+ (2 rows)
+ </programlisting>
+ Now the primary node is changed from 0 to 1. What happens
+ inside? When the node 0 goes
+ down, <productname>Pgpool-II</productname> detects it and
+ executes <varname>failover_command</varname> defined
+ in <filename>pgpool.conf</filename>. Here is the content of the
+ file.
+ <programlisting>
+ #! /bin/sh
+ # Execute command by failover.
+ # special values: %d = node id
+ # %h = host name
+ # %p = port number
+ # %D = database cluster path
+ # %m = new main node id
+ # %M = old main node id
+ # %H = new main node host name
+ # %P = old primary node id
+ # %R = new main database cluster path
+ # %r = new main port number
+ # %% = '%' character
+ failed_node_id=$1
+ failed_host_name=$2
+ failed_port=$3
+ failed_db_cluster=$4
+ new_main_id=$5
+ old_main_id=$6
+ new_main_host_name=$7
+ old_primary_node_id=$8
+ new_main_port_number=$9
+ new_main_db_cluster=${10}
+ mydir=/home/t-ishii/tmp/Tutorial
+ log=$mydir/log/failover.log
+ pg_ctl=/usr/local/pgsql/bin/pg_ctl
+ cluster0=$mydir/data0
+ cluster1=$mydir/data1
+
+ date >> $log
+ echo "failed_node_id $failed_node_id failed_host_name $failed_host_name failed_port $failed_port failed_db_cluster $failed_db_cluster new_main_id $new_main_id old_main_id $old_main_id new_main_host_name $new_main_host_name old_primary_node_id $old_primary_node_id new_main_port_number $new_main_port_number new_main_db_cluster $new_main_db_cluster" >> $log
+
+ if [ a"$failed_node_id" = a"$old_primary_node_id" ];then # main failed
+ ! new_primary_db_cluster=${mydir}/data"$new_main_id"
+ echo $pg_ctl -D $new_primary_db_cluster promote >>$log # let standby take over
+ $pg_ctl -D $new_primary_db_cluster promote >>$log # let standby take over
+ sleep 2
+ fi
+ </programlisting>
+ The script receives necessary information as parameters
+ from <productname>Pgpool-II</productname>. If the primary server
+ goes down, it executes "pg_ctl -D data1 promote", which should
+ promote the standby server to a new primary server.
+ </para>
+ </sect1>
+
+
+ <sect1 id="tutorial-testing-online-recovery">
+ <title>Testing Online Recovery</title>
+ <para>
+ <productname>Pgpool-II</productname> allows to recover a downed
+ node by technique called "Online Recovery". This copies data
+ from the primary node to a standby node so that it sync with the
+ primary. This may take long time and database may be updated
+ during the process. That's no problem because in the streaming
+ configuration, the standby will receive WAL log and applies it
+ to catch up the primary. To test online recovery, let's start
+ with previous cluster, where node 0 is in down state.
+ <programlisting>
+ $ pcp_recovery_node -p 11001 -n 0
+ Password:
+ pcp_recovery_node -- Command Successful
+
+ $ psql -p 11000 -c "show pool_nodes" test
+ node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | last_status_change
+ ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+---------------------
+ 0 | /tmp | 11002 | up | 0.500000 | standby | 0 | false | 0 | 2019-01-31 12:06:48
+ 1 | /tmp | 11003 | up | 0.500000 | primary | 0 | true | 0 | 2019-01-31 12:05:20
+ (2 rows)
+ </programlisting>
+ <xref linkend="pcp-recovery-node"> is one of control commands
+ coming with <productname>Pgpool-II</productname>
+ installation. The argument -p is to specify the port number
+ assigned to the command, which is 11001 set
+ by <command>pgpool_setup</command>. The argument -n is to
+ specify the node id to be recovered. After executing the command,
+ node 0 returned to "up" status.
+ </para>
+ <para>
+ The script executed by <command>pcp_recovery_node</command> is
+ specified as "recovery_1st_stage_command"
+ in <filename>pgpool.conf</filename>. Here is the file installed
+ by <command>pgpool_setup</command>.
+ <programlisting>
+ #! /bin/sh
+ psql=/usr/local/pgsql/bin/psql
+ DATADIR_BASE=/home/t-ishii/tmp/Tutorial
+ PGSUPERUSER=t-ishii
+
+ main_db_cluster=$1
+ recovery_node_host_name=$2
+ DEST_CLUSTER=$3
+ PORT=$4
+ recovery_node=$5
+
+ pg_rewind_failed="true"
+
+ log=$DATADIR_BASE/log/recovery.log
+ echo >> $log
+ date >> $log
+ if [ $pg_rewind_failed = "true" ];then
+
+ $psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication', true)" postgres
+
+ echo "source: $main_db_cluster dest: $DEST_CLUSTER" >> $log
+
+ rsync -C -a -c --delete --exclude postgresql.conf --exclude postmaster.pid \
+ --exclude postmaster.opts --exclude pg_log \
+ --exclude recovery.conf --exclude recovery.done \
+ --exclude pg_xlog \
+ $main_db_cluster/ $DEST_CLUSTER/
+
+ rm -fr $DEST_CLUSTER/pg_xlog
+ mkdir $DEST_CLUSTER/pg_xlog
+ chmod 700 $DEST_CLUSTER/pg_xlog
+ rm $DEST_CLUSTER/recovery.done
+ fi
+ cat > $DEST_CLUSTER/recovery.conf $lt;$lt;REOF
+ standby_mode = 'on'
+ primary_conninfo = 'port=$PORT user=$PGSUPERUSER'
+ recovery_target_timeline='latest'
+ restore_command = 'cp $DATADIR_BASE/archivedir/%f "%p" 2> /dev/null'
+ REOF
+
+ if [ $pg_rewind_failed = "true" ];then
+ $psql -p $PORT -c "SELECT pg_stop_backup()" postgres
+ fi
+
+ if [ $pg_rewind_failed = "false" ];then
+ cp /tmp/postgresql.conf $DEST_CLUSTER/
+ fi
+ </programlisting>
+ </para>
+ </sect1>
+
+ <sect1 id="tutorial-arch">
+ <title>Architectural Fundamentals</title>
+
+ <para>
+ <productname>Pgpool-II</productname> is a proxy server sitting
+ between clients and <productname>PostgreSQL</productname>.
+ <productname>Pgpool-II</productname> understands the wire level
+ protocol used by <productname>PostgreSQL</productname> called
+ "frontend and backend protocol". For more details of the
+ protocol, see the <productname>PostgreSQL</productname> manual.
+ No modified <productname>PostgreSQL</productname> is required to
+ use <productname>Pgpool-II</productname> (more precisely, you
+ will need a few extensions to use full functions
+ of <productname>Pgpool-II</productname>). So <productname>Pgpool-II</productname>
+ can cope with variety of <productname>PostgreSQL</productname>
+ versions. In theory, even the earliest version
+ of <productname>PostgreSQL</productname> can be used
+ with <productname>Pgpool-II</productname>. Same thing can be
+ said to client side. As long as it follows the
+ protocol, <productname>Pgpool-II</productname> happily accept
+ connections from it, no matter what kind of languages or drivers
+ it uses.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> consists of multiple
+ process. There is a main process, which is the parent process of
+ all other process. It is responsible for forking child process
+ each of which accepts connections from clients. There are some
+ worker process those are forked from the main process as well,
+ which is responsible for detecting streaming replication
+ delay. There is also a special process called "pcp process",
+ which is solely used for management
+ of <productname>Pgpool-II</productname>
+ itself. <productname>Pgpool-II</productname> has a built-in high
+ availability function called "watchdog". Watchdog consists of
+ some process. For more details of watchdog,
+ see <xref linkend="tutorial-watchdog">.
+ </para>
+ <para>
+ <figure>
+ <title>Process architecture of <productname>Pgpool-II</productname></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="process-diagram.gif">
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </para>
+
+ </sect1>
+
+</chapter>
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-streaming-replication-check">
+ <title>Streaming Replication Check</title>
+
+ <para>
+ <productname>Pgpool-II</productname> can work with <productname>PostgreSQL</> native
+ Streaming Replication, that is available since <productname>PostgreSQL</> 9.0.
+ To configure <productname>Pgpool-II</productname> with streaming
+ replication, set
+ <xref linkend="guc-backend-clustering-mode"> to <literal>'streaming-replication'</literal>.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> assumes that Streaming Replication
+ is configured with Hot Standby on PostgreSQL, which means that the
+ standby database can handle read-only queries.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-sr-check-period" xreflabel="sr_check_period">
+ <term><varname>sr_check_period</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>sr_check_period</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the time interval in seconds to check the streaming
+ replication delay.
+ Default is 0, which means the check is disabled.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-sr-check-user" xreflabel="sr_check_user">
+ <term><varname>sr_check_user</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>sr_check_user</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the <productname>PostgreSQL</> user name to perform streaming replication check.
+ The user must have LOGIN privilege and exist on all the
+ <productname>PostgreSQL</> backends.
+ </para>
+ <note>
+ <para>
+ <xref linkend="guc-sr-check-user"> and <xref
+ linkend="guc-sr-check-password"> are used even when <xref
+ linkend="guc-sr-check-period"> is set to 0 (disabled) for the
+ identification of the primary server.
+ </para>
+ </note>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-sr-check-password" xreflabel="sr_check_password">
+ <term><varname>sr_check_password</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>sr_check_password</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the password of the <xref linkend="guc-sr-check-user"> <productname>PostgreSQL</> user
+ to perform the streaming replication checks.
+ Use <literal>''</literal> (empty string) if the user does not requires a password.
+ </para>
+ <para>
+ If <varname>sr_check_password</varname> is left blank <productname>Pgpool-II</productname>
+ will first try to get the password for <xref linkend="guc-sr-check-user"> from
+ <xref linkend="guc-pool-passwd"> file before using the empty password.
+ </para>
+
+ <para>
+ <productname>Pgpool-II</productname> accepts following forms
+ of password in either <varname>sr_check_password</varname>
+ or <xref linkend="guc-pool-passwd"> file:
+ <variablelist>
+
+ <varlistentry>
+ <term>AES256-CBC encrypted password</term>
+ <listitem>
+ <para>
+ Most secure and recommended way to store password. The
+ password string must be prefixed
+ with <literal>AES</literal>.
+ You can use <xref linkend="PG-ENC"> utility to create the correctly formatted
+ <literal>AES</literal> encrypted password strings.
+ <productname>Pgpool-II</productname> will require a valid decryption key at the
+ startup to use the encrypted passwords.
+ see <xref linkend="auth-aes-decryption-key"> for more details on providing the
+ decryption key to <productname>Pgpool-II</productname>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>MD5 hashed password</term>
+ <listitem>
+ <para>
+ Not so secure as AES256, but still better than clear
+ text password. The password string must be prefixed
+ with <literal>MD5</literal>. Note that the backend
+ must set up MD5 authentication as well. You can
+ use <xref linkend="PG-MD5"> utility to create the
+ correctly formatted
+ <literal>MD5</literal> hashed password strings.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Plain text password</term>
+ <listitem>
+ <para>
+ Not encrypted, clear text password. You should avoid
+ to use this if possible. The password string must be
+ prefixed with <literal>TEXT</literal>. For example if
+ you want to set <literal>mypass</literal> as a
+ password, you should
+ specify <literal>TEXTmypass</literal> in the password
+ field. In the absence of a valid
+ prefix, <productname>Pgpool-II</productname> will
+ considered the string as a plain text password.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-sr-check-database" xreflabel="sr_check_database">
+ <term><varname>sr_check_database</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>sr_check_database</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the database to perform streaming replication delay checks.
+ The default is <literal>"postgres"</literal>.
+ </para>
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-delay-threshold" xreflabel="delay_threshold">
+ <term><varname>delay_threshold</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>delay_threshold</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies the maximum tolerance level of replication delay in
+ <acronym>WAL</acronym> bytes on the standby server against the
+ primary server. If the delay exceeds this configured level,
+ <productname>Pgpool-II</productname> stops sending the <acronym>
+ SELECT</acronym> queries to the standby server and starts routing
+ everything to the primary server even if <xref linkend="guc-load-balance-mode">
+ is enabled, until the standby catches-up with the primary.
+ Setting this parameter to 0 disables the delay checking.
+ This delay threshold check is performed every <xref linkend="guc-sr-check-period">.
+ Default is 0.
+ </para>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</>configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-log-standby-delay" xreflabel="log_standby_delay">
+ <term><varname>log_standby_delay</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>log_standby_delay</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+
+ <para>
+ Specifies when to log the replication delay. Below table contains the list
+ of all valid values for the parameter.
+ </para>
+
+ <table id="log-standby-delay-table">
+ <title>Log standby delay options</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Value</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>'none'</literal></entry>
+ <entry>Never log the standby delay (the default)</entry>
+ </row>
+
+ <row>
+ <entry><literal>'always'</literal></entry>
+ <entry>Log the standby delay if it's greater than 0, every time the replication delay is checked</entry>
+ </row>
+
+ <row>
+ <entry><literal>'if_over_threshold'</literal></entry>
+ <entry>Only log the standby delay, when it exceeds <xref linkend="guc-delay-threshold"> value</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+</sect1>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+<!--
+ This file contains XSLT stylesheet customizations that are common to
+ all output formats (HTML, HTML Help, XSL-FO, etc.).
+ -->
+
+
+<!-- Parameters -->
+
+<xsl:param name="pg.fast" select="'0'"/>
+
+<!--
+<xsl:param name="draft.mode">
+ <xsl:choose>
+ <xsl:when test="contains($pg.version, 'devel')">yes</xsl:when>
+ <xsl:otherwise>no</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+-->
+
+<xsl:param name="show.comments">
+ <xsl:choose>
+ <xsl:when test="contains($pg.version, 'devel')">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+
+<xsl:param name="callout.graphics" select="'0'"></xsl:param>
+<xsl:param name="toc.section.depth">2</xsl:param>
+<xsl:param name="linenumbering.extension" select="'0'"></xsl:param>
+<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param>
+<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param>
+<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param>
+<xsl:param name="refentry.xref.manvolnum" select="0"/>
+<xsl:param name="formal.procedures" select="0"></xsl:param>
+<xsl:param name="punct.honorific" select="''"></xsl:param>
+<xsl:param name="variablelist.term.break.after">1</xsl:param>
+<xsl:param name="variablelist.term.separator"></xsl:param>
+
+
+<!-- Change display of some elements -->
+
+<xsl:template match="productname">
+ <xsl:call-template name="inline.charseq"/>
+</xsl:template>
+
+<xsl:template match="structfield">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="structname">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="symbol">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="systemitem">
+ <xsl:call-template name="inline.charseq"/>
+</xsl:template>
+
+<xsl:template match="token">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="type">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="programlisting/emphasis">
+ <xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+
+<!-- Special support for Tcl synopses -->
+
+<xsl:template match="optional[@role='tcl']">
+ ?<xsl:call-template name="inline.charseq"/>?
+</xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
+<xsl:include href="stylesheet-common.xsl" />
+
+<xsl:param name="fop1.extensions" select="1"></xsl:param>
+<xsl:param name="tablecolumns.extension" select="0"></xsl:param>
+<xsl:param name="toc.max.depth">3</xsl:param>
+<xsl:param name="ulink.footnotes" select="1"></xsl:param>
+<xsl:param name="use.extensions" select="1"></xsl:param>
+<xsl:param name="variablelist.as.blocks" select="1"></xsl:param>
+
+<xsl:attribute-set name="monospace.verbatim.properties"
+ use-attribute-sets="verbatim.properties monospace.properties">
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+</xsl:attribute-set>
+
+<!-- Change display of some elements -->
+
+<xsl:template match="command">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<!-- bug fix from <https://sourceforge.net/p/docbook/bugs/1360/#831b> -->
+
+<xsl:template match="varlistentry/term" mode="xref-to">
+ <xsl:param name="verbose" select="1"/>
+ <xsl:apply-templates mode="no.anchor.mode"/>
+</xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'
+ xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ exclude-result-prefixes="#default">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/>
+<xsl:include href="stylesheet-common.xsl" />
+
+<!-- Parameters -->
+<xsl:param name="htmlhelp.use.hhk" select="'1'"/>
+
+<xsl:param name="html.stylesheet" select="'stylesheet.css'"></xsl:param>
+<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
+<xsl:param name="make.valid.html" select="1"></xsl:param>
+<xsl:param name="generate.id.attributes" select="1"></xsl:param>
+<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
+<xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
+<xsl:param name="chunker.output.indent" select="'yes'"/>
+<xsl:param name="chunk.quietly" select="1"></xsl:param>
+
+
+<!-- Change display of some elements -->
+
+<xsl:template match="command">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<!--
+ Format multiple terms in varlistentry vertically, instead
+ of comma-separated.
+ -->
+
+<xsl:template match="varlistentry/term[position()!=last()]">
+ <span class="term">
+ <xsl:call-template name="anchor"/>
+ <xsl:apply-templates/>
+ </span><br/>
+</xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ version='1.0'
+ exclude-result-prefixes="exsl">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
+<xsl:import href="stylesheet-common.xsl" />
+
+
+<!-- Parameters -->
+
+<xsl:param name="man.authors.section.enabled">0</xsl:param>
+<xsl:param name="man.copyright.section.enabled">0</xsl:param>
+<xsl:param name="man.output.base.dir"></xsl:param>
+<xsl:param name="man.output.in.separate.dir" select="1"></xsl:param>
+<xsl:param name="refentry.meta.get.quietly" select="0"></xsl:param>
+<xsl:param name="man.th.title.max.length">32</xsl:param> <!-- enough room for "CREATE TEXT SEARCH CONFIGURATION" -->
+<xsl:param name="man.th.extra3.max.length">40</xsl:param> <!-- enough room for "PostgreSQL X.Ydevel Documentation" -->
+<xsl:param name="refentry.xref.manvolnum" select="1"/> <!-- overridden from stylesheet-common.xsl -->
+
+<!-- Fixup for apostrophe groff output. See the following references:
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457839>
+ <https://sourceforge.net/tracker/?func=detail&aid=2412738&group_id=21935&atid=373747>
+ -->
+<xsl:param name="man.string.subst.map.local.post">
+ <substitution oldstring="\'" newstring="\(aq"></substitution>
+</xsl:param>
+
+
+<!-- Custom templates -->
+
+<!-- Improve output of email element. See also
+ <https://sourceforge.net/tracker/?func=detail&aid=3524417&group_id=21935&atid=373747>
+ -->
+<xsl:template match="email">
+ <xsl:text><</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>></xsl:text>
+</xsl:template>
+
+
+<xsl:template match="refentry" mode="xref-to">
+ <xsl:param name="referrer"/>
+ <xsl:param name="xrefstyle"/>
+
+ <xsl:choose>
+ <!-- If the refname contains a space, we construct a reference
+ like CREATE DATABASE (CREATE_DATABASE(7)), so the reader
+ knows both the command name being referred to and the name of
+ the man page to read about it. -->
+ <xsl:when test="contains(refnamediv/refname[1],' ')">
+ <xsl:variable name="mangled.title">
+ <xsl:value-of select="translate(refnamediv/refname[1],' ','_')"/>
+ </xsl:variable>
+ <xsl:apply-templates select="refnamediv/refname[1]"/>
+ <xsl:text> (</xsl:text>
+ <xsl:call-template name="bold">
+ <xsl:with-param name="node" select="exsl:node-set($mangled.title)"/>
+ <xsl:with-param name="context" select="."/>
+ </xsl:call-template>
+ <xsl:apply-templates select="refmeta/manvolnum"/>
+ <xsl:text>)</xsl:text>
+ </xsl:when>
+
+ <!-- This is the original case, except that boldness has been
+ added, per the convention mentioned in man-pages(7). -->
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="refmeta/refentrytitle">
+ <xsl:call-template name="bold">
+ <xsl:with-param name="node" select="refmeta/refentrytitle"/>
+ <xsl:with-param name="context" select="."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="bold">
+ <xsl:with-param name="node" select="refnamediv/refname[1]"/>
+ <xsl:with-param name="context" select="."/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="refmeta/manvolnum"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+</xsl:template>
+
+
+<!-- For refentries we don't man to generate a man page for, leave out
+ manvolnum, let it default to 0, and skip writing out man files
+ with section 0. -->
+
+<!-- overridden from common/refentry.xsl -->
+<xsl:template name="get.refentry.section">
+ <xsl:choose>
+ <xsl:when test="refmeta/manvolnum">
+ <xsl:value-of select="refmeta/manvolnum"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- overridden from manpages/other.xsl -->
+ <xsl:template name="write.man.file">
+ <xsl:param name="name"/>
+ <xsl:param name="section"/>
+ <xsl:param name="lang"/>
+ <xsl:param name="content"/>
+ <xsl:param name="filename">
+ <xsl:call-template name="make.adjusted.man.filename">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="section" select="$section"/>
+ <xsl:with-param name="lang" select="$lang"/>
+ </xsl:call-template>
+ </xsl:param>
+ <xsl:if test="$section != 0">
+ <xsl:call-template name="write.text.chunk">
+ <xsl:with-param name="filename" select="$filename"/>
+ <xsl:with-param name="suppress-context-node-name" select="1"/>
+ <xsl:with-param name="quiet" select="$man.output.quietly"/>
+ <xsl:with-param
+ name="message-prolog"
+ >Note: </xsl:with-param>
+ <xsl:with-param name="encoding" select="$man.output.encoding"/>
+ <xsl:with-param name="content" select="$content"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+
+<!-- Overridden template as workaround for this problem:
+ <https://sourceforge.net/tracker/?func=detail&aid=2831602&group_id=21935&atid=373747>
+-->
+ <xsl:template name="write.stubs">
+ <xsl:param name="first.refname"/>
+ <xsl:param name="section"/>
+ <xsl:param name="lang"/>
+ <xsl:for-each select="refnamediv/refname">
+ <xsl:if test=". != $first.refname">
+ <xsl:call-template name="write.text.chunk">
+ <xsl:with-param name="filename">
+ <xsl:call-template name="make.adjusted.man.filename">
+ <xsl:with-param name="name" select="."/>
+ <xsl:with-param name="section" select="$section"/>
+ <xsl:with-param name="lang" select="$lang"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="quiet" select="$man.output.quietly"/>
+ <xsl:with-param name="suppress-context-node-name" select="1"/>
+ <xsl:with-param name="message-prolog">Note: </xsl:with-param>
+ <xsl:with-param name="message-epilog"> (soelim stub)</xsl:with-param>
+ <xsl:with-param name="content">
+ <xsl:choose>
+ <xsl:when test="$man.output.in.separate.dir = 0">
+ <xsl:value-of select="concat('.so man', $section, '/')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'.so '"/> <!-- added case -->
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="make.adjusted.man.filename">
+ <xsl:with-param name="name" select="$first.refname"/>
+ <xsl:with-param name="section" select="$section"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+
+ <!-- https://sourceforge.net/tracker/?func=detail&aid=3545150&group_id=21935&atid=373747 -->
+ <xsl:template match="step/title">
+ <xsl:apply-templates/>
+ <xsl:text>: </xsl:text>
+ </xsl:template>
+
+
+ <!-- http://sourceforge.net/p/docbook/bugs/1340/ -->
+ <xsl:template match="indexterm"/>
+
+
+<!-- Gentext customization -->
+
+<!-- see http://www.sagehill.net/docbookxsl/CustomGentext.html -->
+<xsl:param name="local.l10n.xml" select="document('')"/>
+<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
+ <l:l10n language="en">
+ <!-- Use ISO 8601 date format. -->
+ <l:context name="datetime">
+ <l:template name="format" text="Y-m-d"/>
+ </l:context>
+
+ <!-- Slight rephrasing to indicate that missing sections are found
+ in the documentation. -->
+ <l:context name="xref-number-and-title">
+ <l:template name="chapter" text="Chapter %n, %t, in the documentation"/>
+ <l:template name="sect1" text="Section %n, “%t”, in the documentation"/>
+ <l:template name="sect2" text="Section %n, “%t”, in the documentation"/>
+ <l:template name="sect3" text="Section %n, “%t”, in the documentation"/>
+ <l:template name="sect4" text="Section %n, “%t”, in the documentation"/>
+ <l:template name="sect5" text="Section %n, “%t”, in the documentation"/>
+ </l:context>
+ </l:l10n>
+</l:i18n>
+
+</xsl:stylesheet>
--- /dev/null
+/* doc/src/sgml/stylesheet.css */
+
+/* color scheme similar to www.postgresql.org */
+
+@media screen and (min-width: 641px) {
+ BODY > * {
+ width: 90%;
+ margin: auto !important;
+ display: block;
+ text-align: left;
+ }
+}
+
+BODY {
+ color: #000000;
+ background: #FFFFFF;
+ font-family: verdana, sans-serif;
+}
+
+script {
+ display: none;
+}
+
+A:link { color:#0085B0; }
+A:visited { color:#004E66; }
+A:active { color:#0085B0; }
+A:hover { color:#000000; }
+
+p i, pre i, .emphasis em {
+ font-style: normal;
+ font-weight: bold;
+ color: #440000;
+}
+
+.replaceable code {
+ font-style: italic;
+}
+
+pre strong {
+ white-space: nowrap;
+}
+
+p span, pre span, p acronym, pre acronym {
+ font-style: normal;
+ color: #440000;
+}
+
+p tt, pre tt {
+ font-family: monospace;
+ color: #440000;
+}
+
+H1 {
+ font-size: 1.4em;
+ font-weight: bold;
+ margin-top: 0em;
+ margin-bottom: 0em;
+ color: #EC5800;
+}
+
+H2 {
+ font-size: 1.3em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: bold;
+ color: #EC5800;
+}
+
+H3 {
+ font-size: 1.2em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: bold;
+ color: #EC5800;
+}
+
+H4 {
+ font-size: 1.1em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: normal;
+ font-weight: bold;
+ color: #EC5800;
+}
+
+H5 {
+ font-size: 0.9em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: normal;
+}
+
+H6 {
+ font-size: 0.85em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: normal;
+}
+
+p {
+ line-height: 1.3;
+}
+
+/* center some titles */
+
+.BOOK .TITLE, .BOOK .CORPAUTHOR, .BOOK .COPYRIGHT, .book .titlepage {
+ text-align: center;
+}
+
+/* decoration for formal examples */
+DIV.EXAMPLE, div.example {
+ padding-left: 15px;
+ border-style: solid;
+ border-width: 0px;
+ border-left-width: 2px;
+ border-color: black;
+ margin: 0.5ex;
+}
+
+BLOCKQUOTE.NOTE, BLOCKQUOTE.TIP, table.CAUTION, table.WARNING, div.note, div.tip, div.important, div.caution, div.warning, div.blockquote {
+ margin: 4ex auto;
+ color: black;
+ display: block;
+ border-color: #DBDBCC;
+ background-color: #EED;
+ padding: 14px;
+ max-width: 720px;
+ border-width: 1px;
+ border-style: solid;
+ overflow: auto;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ -khtml-border-radius: 8px;
+ border-radius: 8px;
+}
+
+/* less dense spacing of TOC */
+
+.BOOK .TOC DL DT {
+ padding-top: 1.0ex;
+ padding-bottom: 1.0ex;
+}
+
+.BOOK .TOC DL DL DT {
+ padding-top: 0.2ex;
+ padding-bottom: 0.2ex;
+}
+
+/* miscellaneous */
+
+PRE.LITERALLAYOUT, .SCREEN, .SYNOPSIS, .PROGRAMLISTING, pre.literallayout, pre.screen, pre.synopsis, pre.programlisting {
+ margin-left: 4ex;
+ border-color: #CFCFCF;
+ background-color: #F7F7F7;
+ color: #000;
+ border-width: 1px;
+ border-style: solid;
+ padding: 2ex;
+ margin: 2ex 0px 2ex 2ex;
+ overflow: auto;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ -khtml-border-radius: 8px;
+ border-radius: 8px;
+}
+
+/* shadow */
+
+PRE.LITERALLAYOUT, PRE.SCREEN, PRE.SYNOPSIS, PRE.PROGRAMLISTING, BLOCKQUOTE.NOTE, BLOCKQUOTE.TIP, table.CAUTION, table.CALSTABLE, table.WARNING, pre.literallayout, pre.screen, pre.synopsis, pre.programlisting, div.note, div.tip, table.caution, table.calstable, table.warning, div.blockquote, .informaltable table, .table-contents table {
+ -moz-box-shadow: 3px 3px 5px #DFDFDF;
+ -webkit-box-shadow: 3px 3px 5px #DFDFDF;
+ -khtml-box-shadow: 3px 3px 5px #DFDFDF;
+ -o-box-shadow: 3px 3px 5px #DFDFDF;
+ box-shadow: 3px 3px 5px #DFDFDF;
+}
+
+/* Table Styles */
+
+.table-contents table,
+.informaltable table,
+table.CALSTABLE,
+table.CAUTION,
+table.WARNING {
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+.table-contents table,
+.informaltable table,
+table.CALSTABLE {
+ margin: 2ex 0 2ex 2ex;
+ background-color: #E0ECEF;
+ border: 2px solid #A7C6DF;
+}
+
+table.CAUTION,
+table.WARNING {
+ border-collapse: separate;
+ display: block;
+ padding: 0;
+}
+
+table.CAUTION {
+ background-color: #F5F5DC;
+ border-color: #DEDFA7;
+}
+
+table.WARNING, div.warning {
+ background-color: #FFD7D7;
+ border-color: #DF421E;
+}
+
+table.CALSTABLE td,
+table.CALSTABLE th,
+table.CAUTION td,
+table.CAUTION th,
+table.WARNING td,
+table.WARNING th {
+ border-style: solid;
+}
+
+table.CAUTION td,
+table.CAUTION th,
+table.WARNING td,
+table.WARNING th {
+ border-width: 0;
+ padding-left: 2ex;
+ padding-right: 2ex;
+}
+
+table.WARNING td {
+ padding-top: 7px;
+}
+
+.table-contents table td,
+table.CALSTABLE td {
+ background-color: #FFF;
+}
+
+table.CAUTION td,
+table.CAUTION th {
+ border-color: #f3e4d5;
+}
+
+table.WARNING td,
+table.WARNING th {
+ border-color: #ffd7d7;
+}
+
+.table-contents table, .table-contents td, .table-contents th{
+ border: 1px solid #a7c6df;
+ padding: 0.5ex 0.5ex;
+}
+
+.table-contents table td,
+.table-contents table th,
+.informaltable table td,
+.informaltable table th,
+table.CALSTABLE td,
+table.CALSTABLE th {
+ border: 1px solid #a7c6df;
+ padding: 0.5ex 0.5ex;
+}
+
+.informaltable table td {
+ background-color: #FFF;
+}
+
+.table-contents table tr:hover td,
+.informaltable table tr:hover td,
+table.CALSTABLE tr:hover td {
+ background-color: #EFEFEF;
+}
+
+td.c1,
+td.c2,
+td.c3,
+td.c4,
+td.c5,
+td.c6 {
+ font-size: 1.1em;
+ font-weight: bold;
+ border-bottom: 0 solid #ffefef;
+ padding: 1ex 2ex 0;
+}
+
+table.simplelist {
+ border-collapse: collapse;
+}
+table.simplelist th, table.simplelist td {
+ border: 1px solid #ccc;
+ padding: 10px;
+}
+
+.original {
+ display: block;
+ color: #008800;
+}
+
+.actions {
+ font-size: 65%;
+}
+
+.COMMENT,.comment { color: red; }
+
+VAR { font-family: monospace; font-style: italic; }
+/* Konqueror's standard style for ACRONYM is italic. */
+ACRONYM { font-style: inherit; }
--- /dev/null
+<!-- doc/src/sgml/stylesheet.dsl -->
+<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
+
+<!-- must turn on one of these with -i on the jade command line -->
+<!ENTITY % output-html "IGNORE">
+<!ENTITY % output-print "IGNORE">
+<!ENTITY % output-text "IGNORE">
+
+<![ %output-html; [
+<!ENTITY dbstyle PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
+]]>
+
+<![ %output-print; [
+<!ENTITY dbstyle PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA DSSSL>
+]]>
+
+<![ %output-text; [
+<!ENTITY dbstyle PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
+]]>
+
+]>
+
+<style-sheet>
+ <style-specification use="docbook">
+ <style-specification-body>
+
+<!-- general customization ......................................... -->
+
+<!-- (applicable to all output formats) -->
+
+(define draft-mode #f)
+
+(define pgsql-docs-list "pgsql-docs@postgresql.org")
+
+;; Don't show manpage volume numbers
+(define %refentry-xref-manvolnum% #f)
+
+;; Don't use graphics for callouts. (We could probably do that, but
+;; it needs extra work.)
+(define %callout-graphics% #f)
+
+;; Show comments during the development stage.
+(define %show-comments% draft-mode)
+
+;; Don't append period if run-in title ends with any of these
+;; characters. We had to add the colon here. This is fixed in
+;; stylesheets version 1.71, so it can be removed sometime.
+(define %content-title-end-punct%
+ '(#\. #\! #\? #\:))
+
+;; No automatic punctuation after honorific name parts
+(define %honorific-punctuation% "")
+
+;; Change display of some elements
+(element command ($mono-seq$))
+(element envar ($mono-seq$))
+(element lineannotation ($italic-seq$))
+(element literal ($mono-seq$))
+(element option ($mono-seq$))
+(element parameter ($mono-seq$))
+(element structfield ($mono-seq$))
+(element structname ($mono-seq$))
+(element symbol ($mono-seq$))
+(element token ($mono-seq$))
+(element type ($mono-seq$))
+(element varname ($mono-seq$))
+(element (programlisting emphasis) ($bold-seq$)) ;; to highlight sections of code
+
+;; Special support for Tcl synopses
+(element optional
+ (if (equal? (attribute-string (normalize "role")) "tcl")
+ (make sequence
+ (literal "?")
+ ($charseq$)
+ (literal "?"))
+ (make sequence
+ (literal %arg-choice-opt-open-str%)
+ ($charseq$)
+ (literal %arg-choice-opt-close-str%))))
+
+;; Avoid excessive cross-reference labels
+(define (auto-xref-indirect? target ancestor)
+ (cond
+; ;; Always add indirect references to another book
+; ((member (gi ancestor) (book-element-list))
+; #t)
+ ;; Add indirect references to the section or component a block
+ ;; is in iff chapters aren't autolabelled. (Otherwise "Figure 1-3"
+ ;; is sufficient)
+ ((and (member (gi target) (block-element-list))
+ (not %chapter-autolabel%))
+ #t)
+ ;; Add indirect references to the component a section is in if
+ ;; the sections are not autolabelled
+ ((and (member (gi target) (section-element-list))
+ (member (gi ancestor) (component-element-list))
+ (not %section-autolabel%))
+ #t)
+ (else #f)))
+
+
+;; Bibliography things
+
+;; Use the titles of bibliography entries in cross-references
+(define biblio-xref-title #t)
+
+;; Process bibliography entry components in the order shown below, not
+;; in the order they appear in the document. (I suppose this should
+;; be made to fit some publishing standard.)
+(define %biblioentry-in-entry-order% #f)
+
+(define (biblioentry-inline-elements)
+ (list
+ (normalize "author")
+ (normalize "authorgroup")
+ (normalize "title")
+ (normalize "subtitle")
+ (normalize "volumenum")
+ (normalize "edition")
+ (normalize "othercredit")
+ (normalize "contrib")
+ (normalize "editor")
+ (normalize "publishername")
+ (normalize "confgroup")
+ (normalize "publisher")
+ (normalize "isbn")
+ (normalize "issn")
+ (normalize "pubsnumber")
+ (normalize "date")
+ (normalize "pubdate")
+ (normalize "pagenums")
+ (normalize "bibliomisc")))
+
+(mode biblioentry-inline-mode
+
+ (element confgroup
+ (make sequence
+ (literal "Proc. ")
+ (next-match)))
+
+ (element isbn
+ (make sequence
+ (literal "ISBN ")
+ (process-children)))
+
+ (element issn
+ (make sequence
+ (literal "ISSN ")
+ (process-children))))
+
+
+;; The rules in the default stylesheet for productname format it as a
+;; paragraph. This may be suitable for productname directly within
+;; *info, but it's nonsense when productname is used inline, as we do.
+(mode book-titlepage-recto-mode
+ (element (para productname) ($charseq$)))
+(mode book-titlepage-verso-mode
+ (element (para productname) ($charseq$)))
+;; Add more here if needed...
+
+
+;; Replace a sequence of whitespace in a string by a single space
+(define (normalize-whitespace str #!optional (whitespace '(#\space #\U-000D)))
+ (let loop ((characters (string->list str))
+ (result '())
+ (prev-was-space #f))
+ (if (null? characters)
+ (list->string (reverse result))
+ (let ((c (car characters))
+ (rest (cdr characters)))
+ (if (member c whitespace)
+ (if prev-was-space
+ (loop rest result #t)
+ (loop rest (cons #\space result) #t))
+ (loop rest (cons c result) #f))))))
+
+
+<!-- HTML output customization ..................................... -->
+
+<![ %output-html; [
+
+(define %section-autolabel% #t)
+(define %label-preface-sections% #f)
+(define %generate-legalnotice-link% #t)
+(define %html-ext% ".html")
+(define %root-filename% "index")
+(define %link-mailto-url% (string-append "mailto:" pgsql-docs-list))
+(define %use-id-as-filename% #t)
+(define website-stylesheet #f)
+(define %stylesheet% (if website-stylesheet "http://www.postgresql.org/media/css/docs.css" "stylesheet.css"))
+(define %graphic-default-extension% "gif")
+(define %body-attr% '())
+(define ($generate-book-lot-list$) '())
+(define use-output-dir #t)
+(define %output-dir% "html")
+(define html-index-filename "../HTML.index")
+
+
+;; Only build HTML.index or the actual HTML output, not both. Saves a
+;; *lot* of time. (overrides docbook.dsl)
+(root
+ (if (not html-index)
+ (make sequence
+ (process-children)
+ (with-mode manifest
+ (process-children)))
+ (with-mode htmlindex
+ (process-children))))
+
+
+;; Do not combine first section into chapter chunk.
+(define (chunk-skip-first-element-list) '())
+
+;; Returns the depth of auto TOC that should be made at the nd-level
+(define (toc-depth nd)
+ (cond ((string=? (gi nd) (normalize "book")) 2)
+ ((string=? (gi nd) (normalize "part")) 2)
+ ((string=? (gi nd) (normalize "chapter")) 2)
+ (else 1)))
+
+;; Add character encoding and time of creation into HTML header
+(define %html-header-tags%
+ (list (list "META" '("HTTP-EQUIV" "Content-Type") '("CONTENT" "text/html; charset=ISO-8859-1"))
+ (list "META" '("NAME" "creation") (list "CONTENT" (time->string (time) #t)))))
+
+
+;; Block elements are allowed in PARA in DocBook, but not in P in
+;; HTML. With %fix-para-wrappers% turned on, the stylesheets attempt
+;; to avoid putting block elements in HTML P tags by outputting
+;; additional end/begin P pairs around them.
+(define %fix-para-wrappers% #t)
+
+;; ...but we need to do some extra work to make the above apply to PRE
+;; as well. (mostly pasted from dbverb.dsl)
+(define ($verbatim-display$ indent line-numbers?)
+ (let ((content (make element gi: "PRE"
+ attributes: (list
+ (list "CLASS" (gi)))
+ (if (or indent line-numbers?)
+ ($verbatim-line-by-line$ indent line-numbers?)
+ (process-children)))))
+ (if %shade-verbatim%
+ (make element gi: "TABLE"
+ attributes: ($shade-verbatim-attr$)
+ (make element gi: "TR"
+ (make element gi: "TD"
+ content)))
+ (make sequence
+ (para-check)
+ content
+ (para-check 'restart)))))
+
+;; ...and for notes.
+(element note
+ (make sequence
+ (para-check)
+ ($admonition$)
+ (para-check 'restart)))
+
+;;; XXX The above is very ugly. It might be better to run 'tidy' on
+;;; the resulting *.html files.
+
+
+;; Format multiple terms in varlistentry vertically, instead
+;; of comma-separated.
+(element (varlistentry term)
+ (make sequence
+ (process-children-trim)
+ (if (not (last-sibling?))
+ (make empty-element gi: "BR")
+ (empty-sosofo))))
+
+
+;; Customization of header
+;; - make title a link to the home page
+;; - add tool tips to Prev/Next links
+;; - add Up link
+;; (overrides dbnavig.dsl)
+(define (default-header-nav-tbl-noff elemnode prev next prevsib nextsib)
+ (let* ((r1? (nav-banner? elemnode))
+ (r1-sosofo (make element gi: "TR"
+ (make element gi: "TH"
+ attributes: (list
+ (list "COLSPAN" "4")
+ (list "ALIGN" "center")
+ (list "VALIGN" "bottom"))
+ (make element gi: "A"
+ attributes: (list
+ (list "HREF" (href-to (nav-home elemnode))))
+ (nav-banner elemnode)))))
+ (r2? (or (not (node-list-empty? prev))
+ (not (node-list-empty? next))
+ (nav-context? elemnode)))
+ (r2-sosofo (make element gi: "TR"
+ (make element gi: "TD"
+ attributes: (list
+ (list "WIDTH" "10%")
+ (list "ALIGN" "left")
+ (list "VALIGN" "top"))
+ (if (node-list-empty? prev)
+ (make entity-ref name: "nbsp")
+ (make element gi: "A"
+ attributes: (list
+ (list "TITLE" (element-title-string prev))
+ (list "HREF"
+ (href-to
+ prev))
+ (list "ACCESSKEY"
+ "P"))
+ (gentext-nav-prev prev))))
+ (make element gi: "TD"
+ attributes: (list
+ (list "WIDTH" "10%")
+ (list "ALIGN" "left")
+ (list "VALIGN" "top"))
+ (if (nav-up? elemnode)
+ (nav-up elemnode)
+ (nav-home-link elemnode)))
+ (make element gi: "TD"
+ attributes: (list
+ (list "WIDTH" "60%")
+ (list "ALIGN" "center")
+ (list "VALIGN" "bottom"))
+ (nav-context elemnode))
+ (make element gi: "TD"
+ attributes: (list
+ (list "WIDTH" "20%")
+ (list "ALIGN" "right")
+ (list "VALIGN" "top"))
+ (if (node-list-empty? next)
+ (make entity-ref name: "nbsp")
+ (make element gi: "A"
+ attributes: (list
+ (list "TITLE" (element-title-string next))
+ (list "HREF"
+ (href-to
+ next))
+ (list "ACCESSKEY"
+ "N"))
+ (gentext-nav-next next)))))))
+ (if (or r1? r2?)
+ (make element gi: "DIV"
+ attributes: '(("CLASS" "NAVHEADER"))
+ (make element gi: "TABLE"
+ attributes: (list
+ (list "SUMMARY" "Header navigation table")
+ (list "WIDTH" %gentext-nav-tblwidth%)
+ (list "BORDER" "0")
+ (list "CELLPADDING" "0")
+ (list "CELLSPACING" "0"))
+ (if r1? r1-sosofo (empty-sosofo))
+ (if r2? r2-sosofo (empty-sosofo)))
+ (make empty-element gi: "HR"
+ attributes: (list
+ (list "ALIGN" "LEFT")
+ (list "WIDTH" %gentext-nav-tblwidth%))))
+ (empty-sosofo))))
+
+
+;; Put index "quicklinks" (A | B | C | ...) at the top of the bookindex page.
+
+(element index
+ (let ((preamble (node-list-filter-by-not-gi
+ (children (current-node))
+ (list (normalize "indexentry"))))
+ (indexdivs (node-list-filter-by-gi
+ (children (current-node))
+ (list (normalize "indexdiv"))))
+ (entries (node-list-filter-by-gi
+ (children (current-node))
+ (list (normalize "indexentry")))))
+ (html-document
+ (with-mode head-title-mode
+ (literal (element-title-string (current-node))))
+ (make element gi: "DIV"
+ attributes: (list (list "CLASS" (gi)))
+ ($component-separator$)
+ ($component-title$)
+ (if (node-list-empty? indexdivs)
+ (empty-sosofo)
+ (make element gi: "P"
+ attributes: (list (list "CLASS" "INDEXDIV-QUICKLINKS"))
+ (with-mode indexdiv-quicklinks-mode
+ (process-node-list indexdivs))))
+ (process-node-list preamble)
+ (if (node-list-empty? entries)
+ (empty-sosofo)
+ (make element gi: "DL"
+ (process-node-list entries)))))))
+
+
+(mode indexdiv-quicklinks-mode
+ (element indexdiv
+ (make sequence
+ (make element gi: "A"
+ attributes: (list (list "HREF" (href-to (current-node))))
+ (element-title-sosofo))
+ (if (not (last-sibling?))
+ (literal " | ")
+ (literal "")))))
+
+
+;; Changed to strip and normalize index term content (overrides
+;; dbindex.dsl)
+(define (htmlindexterm)
+ (let* ((attr (gi (current-node)))
+ (content (data (current-node)))
+ (string (strip (normalize-whitespace content))) ;; changed
+ (sortas (attribute-string (normalize "sortas"))))
+ (make sequence
+ (make formatting-instruction data: attr)
+ (if sortas
+ (make sequence
+ (make formatting-instruction data: "[")
+ (make formatting-instruction data: sortas)
+ (make formatting-instruction data: "]"))
+ (empty-sosofo))
+ (make formatting-instruction data: " ")
+ (make formatting-instruction data: string)
+ (htmlnewline))))
+
+
+]]> <!-- %output-html -->
+
+
+<!-- Print output customization .................................... -->
+
+<![ %output-print; [
+
+(define %section-autolabel% #t)
+(define %default-quadding% 'justify)
+
+;; Don't know how well hyphenation works with other backends. Might
+;; turn this on if desired.
+(define %hyphenation%
+ (if tex-backend #t #f))
+
+;; Put footnotes at the bottom of the page (rather than end of
+;; section), and put the URLs of links into footnotes.
+;;
+;; bop-footnotes only works with TeX, otherwise it's ignored. But
+;; when both of these are #t and TeX is used, you need at least
+;; stylesheets 1.73 because otherwise you don't get any footnotes at
+;; all for the links.
+(define bop-footnotes #t)
+(define %footnote-ulinks% #t)
+
+(define %refentry-new-page% #t)
+(define %refentry-keep% #f)
+
+;; Disabled because of TeX problems
+;; (http://archives.postgresql.org/pgsql-docs/2007-12/msg00056.php)
+(define ($generate-book-lot-list$) '())
+
+;; Indentation of verbatim environments. (This should really be done
+;; with start-indent in DSSSL.)
+;; Use of indentation in this area exposes a bug in openjade,
+;; http://archives.postgresql.org/pgsql-docs/2006-12/msg00064.php
+;; (define %indent-programlisting-lines% " ")
+;; (define %indent-screen-lines% " ")
+;; (define %indent-synopsis-lines% " ")
+
+
+;; Default graphic format: Jadetex wants eps, pdfjadetex wants pdf.
+;; (Note that pdfjadetex will not accept eps, that's why we need to
+;; create a different .tex file for each.) What works with RTF?
+
+(define texpdf-output #f) ;; override from command line
+
+(define %graphic-default-extension%
+ (cond (tex-backend (if texpdf-output "pdf" "eps"))
+ (rtf-backend "gif")
+ (else "XXX")))
+
+;; Need to add pdf here so that the above works. Default setup
+;; doesn't know about PDF.
+(define preferred-mediaobject-extensions
+ (list "eps" "ps" "jpg" "jpeg" "pdf" "png"))
+
+
+;; Don't show links when citing a bibliography entry. This fouls up
+;; the footnumber counting. To get the link, one can still look into
+;; the bibliography itself.
+(mode xref-title-mode
+ (element ulink
+ (process-children)))
+
+
+;; Format legalnotice justified and with space between paragraphs.
+(mode book-titlepage-verso-mode
+ (element (legalnotice para)
+ (make paragraph
+ use: book-titlepage-verso-style ;; alter this if ever it needs to appear elsewhere
+ quadding: %default-quadding%
+ line-spacing: (* 0.8 (inherited-line-spacing))
+ font-size: (* 0.8 (inherited-font-size))
+ space-before: (* 0.8 %para-sep%)
+ space-after: (* 0.8 %para-sep%)
+ first-line-start-indent: (if (is-first-para)
+ (* 0.8 %para-indent-firstpara%)
+ (* 0.8 %para-indent%))
+ (process-children))))
+
+
+;; Fix spacing problems in variablelists
+
+(element (varlistentry term)
+ (make paragraph
+ space-before: (if (first-sibling?)
+ %para-sep%
+ 0pt)
+ keep-with-next?: #t
+ (process-children)))
+
+(define %varlistentry-indent% 2em)
+
+(element (varlistentry listitem)
+ (make sequence
+ start-indent: (+ (inherited-start-indent) %varlistentry-indent%)
+ (process-children)))
+
+
+;; Whitespace fixes for itemizedlists and orderedlists
+
+(define (process-listitem-content)
+ (if (absolute-first-sibling?)
+ (make sequence
+ (process-children-trim))
+ (next-match)))
+
+
+;; Default stylesheets format simplelists as tables. This spells
+;; trouble for Jade. So we just format them as plain lines.
+
+(define %simplelist-indent% 1em)
+
+(define (my-simplelist-vert members)
+ (make display-group
+ space-before: %para-sep%
+ space-after: %para-sep%
+ start-indent: (+ %simplelist-indent% (inherited-start-indent))
+ (process-children)))
+
+(element simplelist
+ (let ((type (attribute-string (normalize "type")))
+ (cols (if (attribute-string (normalize "columns"))
+ (if (> (string->number (attribute-string (normalize "columns"))) 0)
+ (string->number (attribute-string (normalize "columns")))
+ 1)
+ 1))
+ (members (select-elements (children (current-node)) (normalize "member"))))
+ (cond
+ ((equal? type (normalize "inline"))
+ (if (equal? (gi (parent (current-node)))
+ (normalize "para"))
+ (process-children)
+ (make paragraph
+ space-before: %para-sep%
+ space-after: %para-sep%
+ start-indent: (inherited-start-indent))))
+ ((equal? type (normalize "vert"))
+ (my-simplelist-vert members))
+ ((equal? type (normalize "horiz"))
+ (simplelist-table 'row cols members)))))
+
+(element member
+ (let ((type (inherited-attribute-string (normalize "type"))))
+ (cond
+ ((equal? type (normalize "inline"))
+ (make sequence
+ (process-children)
+ (if (not (last-sibling?))
+ (literal ", ")
+ (literal ""))))
+ ((equal? type (normalize "vert"))
+ (make paragraph
+ space-before: 0pt
+ space-after: 0pt))
+ ((equal? type (normalize "horiz"))
+ (make paragraph
+ quadding: 'start
+ (process-children))))))
+
+
+;; Jadetex doesn't handle links to the content of tables, so
+;; indexterms that point to table entries will go nowhere. We fix
+;; this by pointing the index entry to the table itself instead, which
+;; should be equally useful in practice.
+
+(define (find-parent-table nd)
+ (let ((table (ancestor-member nd ($table-element-list$))))
+ (if (node-list-empty? table)
+ nd
+ table)))
+
+;; (The function below overrides the one in print/dbindex.dsl.)
+
+(define (indexentry-link nd)
+ (let* ((id (attribute-string (normalize "role") nd))
+ (prelim-target (find-indexterm id))
+ (target (find-parent-table prelim-target))
+ (preferred (not (node-list-empty?
+ (select-elements (children (current-node))
+ (normalize "emphasis")))))
+ (sosofo (if (node-list-empty? target)
+ (literal "?")
+ (make link
+ destination: (node-list-address target)
+ (with-mode toc-page-number-mode
+ (process-node-list target))))))
+ (if preferred
+ (make sequence
+ font-weight: 'bold
+ sosofo)
+ sosofo)))
+
+
+;; By default, the part and reference title pages get wrong page
+;; numbers: The first title page gets roman numerals carried over from
+;; preface/toc -- we want Arabic numerals. We also need to make sure
+;; that page-number-restart is set of #f explicitly, because otherwise
+;; it will carry over from the previous component, which is not good.
+;;
+;; (This looks worse than it is. It's copied from print/dbttlpg.dsl
+;; and common/dbcommon.dsl and modified in minor detail.)
+
+(define (first-part?)
+ (let* ((book (ancestor (normalize "book")))
+ (nd (ancestor-member (current-node)
+ (append
+ (component-element-list)
+ (division-element-list))))
+ (bookch (children book)))
+ (let loop ((nl bookch))
+ (if (node-list-empty? nl)
+ #f
+ (if (equal? (gi (node-list-first nl)) (normalize "part"))
+ (if (node-list=? (node-list-first nl) nd)
+ #t
+ #f)
+ (loop (node-list-rest nl)))))))
+
+(define (first-reference?)
+ (let* ((book (ancestor (normalize "book")))
+ (nd (ancestor-member (current-node)
+ (append
+ (component-element-list)
+ (division-element-list))))
+ (bookch (children book)))
+ (let loop ((nl bookch))
+ (if (node-list-empty? nl)
+ #f
+ (if (equal? (gi (node-list-first nl)) (normalize "reference"))
+ (if (node-list=? (node-list-first nl) nd)
+ #t
+ #f)
+ (loop (node-list-rest nl)))))))
+
+
+(define (part-titlepage elements #!optional (side 'recto))
+ (let ((nodelist (titlepage-nodelist
+ (if (equal? side 'recto)
+ (reference-titlepage-recto-elements)
+ (reference-titlepage-verso-elements))
+ elements))
+ ;; partintro is a special case...
+ (partintro (node-list-first
+ (node-list-filter-by-gi elements (list (normalize "partintro"))))))
+ (if (part-titlepage-content? elements side)
+ (make simple-page-sequence
+ page-n-columns: %titlepage-n-columns%
+ ;; Make sure that page number format is correct.
+ page-number-format: ($page-number-format$)
+ ;; Make sure that the page number is set to 1 if this is the
+ ;; first part in the book
+ page-number-restart?: (first-part?)
+ input-whitespace-treatment: 'collapse
+ use: default-text-style
+
+ ;; This hack is required for the RTF backend. If an external-graphic
+ ;; is the first thing on the page, RTF doesn't seem to do the right
+ ;; thing (the graphic winds up on the baseline of the first line
+ ;; of the page, left justified). This "one point rule" fixes
+ ;; that problem.
+ (make paragraph
+ line-spacing: 1pt
+ (literal ""))
+
+ (let loop ((nl nodelist) (lastnode (empty-node-list)))
+ (if (node-list-empty? nl)
+ (empty-sosofo)
+ (make sequence
+ (if (or (node-list-empty? lastnode)
+ (not (equal? (gi (node-list-first nl))
+ (gi lastnode))))
+ (part-titlepage-before (node-list-first nl) side)
+ (empty-sosofo))
+ (cond
+ ((equal? (gi (node-list-first nl)) (normalize "subtitle"))
+ (part-titlepage-subtitle (node-list-first nl) side))
+ ((equal? (gi (node-list-first nl)) (normalize "title"))
+ (part-titlepage-title (node-list-first nl) side))
+ (else
+ (part-titlepage-default (node-list-first nl) side)))
+ (loop (node-list-rest nl) (node-list-first nl)))))
+
+ (if (and %generate-part-toc%
+ %generate-part-toc-on-titlepage%
+ (equal? side 'recto))
+ (make display-group
+ (build-toc (current-node)
+ (toc-depth (current-node))))
+ (empty-sosofo))
+
+ ;; PartIntro is a special case
+ (if (and (equal? side 'recto)
+ (not (node-list-empty? partintro))
+ %generate-partintro-on-titlepage%)
+ ($process-partintro$ partintro #f)
+ (empty-sosofo)))
+
+ (empty-sosofo))))
+
+
+(define (reference-titlepage elements #!optional (side 'recto))
+ (let ((nodelist (titlepage-nodelist
+ (if (equal? side 'recto)
+ (reference-titlepage-recto-elements)
+ (reference-titlepage-verso-elements))
+ elements))
+ ;; partintro is a special case...
+ (partintro (node-list-first
+ (node-list-filter-by-gi elements (list (normalize "partintro"))))))
+ (if (reference-titlepage-content? elements side)
+ (make simple-page-sequence
+ page-n-columns: %titlepage-n-columns%
+ ;; Make sure that page number format is correct.
+ page-number-format: ($page-number-format$)
+ ;; Make sure that the page number is set to 1 if this is the
+ ;; first part in the book
+ page-number-restart?: (first-reference?)
+ input-whitespace-treatment: 'collapse
+ use: default-text-style
+
+ ;; This hack is required for the RTF backend. If an external-graphic
+ ;; is the first thing on the page, RTF doesn't seem to do the right
+ ;; thing (the graphic winds up on the baseline of the first line
+ ;; of the page, left justified). This "one point rule" fixes
+ ;; that problem.
+ (make paragraph
+ line-spacing: 1pt
+ (literal ""))
+
+ (let loop ((nl nodelist) (lastnode (empty-node-list)))
+ (if (node-list-empty? nl)
+ (empty-sosofo)
+ (make sequence
+ (if (or (node-list-empty? lastnode)
+ (not (equal? (gi (node-list-first nl))
+ (gi lastnode))))
+ (reference-titlepage-before (node-list-first nl) side)
+ (empty-sosofo))
+ (cond
+ ((equal? (gi (node-list-first nl)) (normalize "author"))
+ (reference-titlepage-author (node-list-first nl) side))
+ ((equal? (gi (node-list-first nl)) (normalize "authorgroup"))
+ (reference-titlepage-authorgroup (node-list-first nl) side))
+ ((equal? (gi (node-list-first nl)) (normalize "corpauthor"))
+ (reference-titlepage-corpauthor (node-list-first nl) side))
+ ((equal? (gi (node-list-first nl)) (normalize "editor"))
+ (reference-titlepage-editor (node-list-first nl) side))
+ ((equal? (gi (node-list-first nl)) (normalize "subtitle"))
+ (reference-titlepage-subtitle (node-list-first nl) side))
+ ((equal? (gi (node-list-first nl)) (normalize "title"))
+ (reference-titlepage-title (node-list-first nl) side))
+ (else
+ (reference-titlepage-default (node-list-first nl) side)))
+ (loop (node-list-rest nl) (node-list-first nl)))))
+
+ (if (and %generate-reference-toc%
+ %generate-reference-toc-on-titlepage%
+ (equal? side 'recto))
+ (make display-group
+ (build-toc (current-node)
+ (toc-depth (current-node))))
+ (empty-sosofo))
+
+ ;; PartIntro is a special case
+ (if (and (equal? side 'recto)
+ (not (node-list-empty? partintro))
+ %generate-partintro-on-titlepage%)
+ ($process-partintro$ partintro #f)
+ (empty-sosofo)))
+
+ (empty-sosofo))))
+
+]]> <!-- %output-print -->
+
+
+<!-- Plain text output customization ............................... -->
+
+<!--
+This is used for making the INSTALL file and others. We customize the
+HTML stylesheets to be suitable for dumping plain text (via Netscape,
+Lynx, or similar).
+-->
+
+<![ %output-text; [
+
+(define %section-autolabel% #f)
+(define %chapter-autolabel% #f)
+(define $generate-chapter-toc$ (lambda () #f))
+
+;; For text output, produce "ASCII markup" for emphasis and such.
+
+(define ($asterix-seq$ #!optional (sosofo (process-children)))
+ (make sequence
+ (literal "*")
+ sosofo
+ (literal "*")))
+
+(define ($dquote-seq$ #!optional (sosofo (process-children)))
+ (make sequence
+ (literal (gentext-start-quote))
+ sosofo
+ (literal (gentext-end-quote))))
+
+(element (para command) ($dquote-seq$))
+(element (para emphasis) ($asterix-seq$))
+(element (para filename) ($dquote-seq$))
+(element (para option) ($dquote-seq$))
+(element (para replaceable) ($dquote-seq$))
+(element (para userinput) ($dquote-seq$))
+
+]]> <!-- %output-text -->
+
+ </style-specification-body>
+ </style-specification>
+
+ <external-specification id="docbook" document="dbstyle">
+</style-sheet>
--- /dev/null
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'
+ xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ exclude-result-prefixes="#default">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
+<xsl:include href="stylesheet-common.xsl" />
+
+
+<!-- Parameters -->
+<xsl:param name="base.dir" select="'html/'"></xsl:param>
+<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
+<xsl:param name="make.valid.html" select="1"></xsl:param>
+<xsl:param name="generate.id.attributes" select="1"></xsl:param>
+<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
+<xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
+<xsl:param name="chunk.first.sections" select="1"/>
+<xsl:param name="chunk.quietly" select="1"></xsl:param>
+<xsl:param name="toc.max.depth">2</xsl:param>
+
+<xsl:param name="website.stylesheet" select="0"/>
+
+<xsl:param name="html.stylesheet">
+ <xsl:choose>
+ <xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
+ <xsl:otherwise>http://www.postgresql.org/media/css/docs.css</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+
+
+<!-- Change display of some elements -->
+
+<xsl:template match="command">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+
+<!-- table of contents configuration -->
+
+<xsl:param name="generate.toc">
+appendix toc,title
+article/appendix nop
+article toc,title
+book toc,title
+chapter toc,title
+part toc,title
+preface toc,title
+qandadiv toc
+qandaset toc
+reference toc,title
+sect1 toc
+sect2 toc
+sect3 toc
+sect4 toc
+sect5 toc
+section toc
+set toc,title
+</xsl:param>
+
+</xsl:stylesheet>
--- /dev/null
+<!ENTITY version "4.3devel">
--- /dev/null
+<!-- doc/src/sgml/config.sgml -->
+
+<sect1 id="runtime-watchdog-config">
+ <title>Watchdog</title>
+
+ <indexterm zone="runtime-watchdog-config">
+ <primary>configuring watchdog</primary>
+ </indexterm>
+ <para>
+ Watchdog configuration parameters are described in pgpool.conf.
+ There is sample configuration in the WATCHDOG section of
+ <filename>pgpool.conf.sample</filename> file.
+ All following options are required to be specified in watchdog process.
+ </para>
+
+ <sect2 id="config-enable-watchdog">
+ <title>Enable watchdog</title>
+
+ <variablelist>
+ <varlistentry id="guc-use-watchdog" xreflabel="use_watchdog">
+ <term><varname>use_watchdog</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>use_watchdog</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ If on, activates the watchdog. Default is off
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ <para>
+ <productname>Pgpool-II</productname> 4.1 or earlier, because it is required to specify
+ its own pgpool node information and the destination pgpool nodes information, the
+ settings are different per pgpool node.
+ Since <productname>Pgpool-II</productname> 4.2, all configuration parameters are
+ identical on all hosts. If watchdog feature is enabled, to distinguish which host
+ is which, a <filename>pgpool_node_id</filename> file is required.
+ You need to create a <filename>pgpool_node_id</filename> file and specify the
+ pgpool (watchdog) node number (e.g. 0, 1, 2 ...) to identify pgpool (watchdog) host.
+ </para>
+ <example id="example-pgpool-node-id-1">
+ <title>pgpool_node_id configuration</title>
+ <para>
+ If you have 3 pgpool nodes with hostname server1, server2 and server3, create the
+ <filename>pgpool_node_id</filename> file on each host as follows.
+ When installing <productname>Pgpool-II</productname> using RPM,
+ <filename>pgpool.conf</filename> is installed under <filename>/etc/pgpool-II/</filename>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>server1</literal>
+ </para>
+ <programlisting>
+[server1]# cat /etc/pgpool-II/pgpool_node_id
+0
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>server2</literal>
+ </para>
+ <programlisting>
+[server2]# cat /etc/pgpool-II/pgpool_node_id
+1
+ </programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>server3</literal>
+ </para>
+ <programlisting>
+[server3]# cat /etc/pgpool-II/pgpool_node_id
+2
+ </programlisting>
+ </listitem>
+ </itemizedlist>
+ </example>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-communication-watchdog">
+ <title>Watchdog communication</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-hostname" xreflabel="hostname">
+ <term><varname>hostnameX</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>hostnameX</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the hostname or IP address of
+ <productname>Pgpool-II</productname> server.
+ This is used for sending/receiving queries and packets,
+ and also as an identifier of the watchdog node.
+ The number at the end of the parameter name is referred
+ as "pgpool node id", and it starts from 0 (e.g. hostname0).
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-port" xreflabel="wd_port">
+ <term><varname>wd_portX</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>wd_portX</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the port number to be used by watchdog
+ process to listen for connections. Default is 9000.
+ The number at the end of the parameter name is referred
+ as "pgpool node id", and it starts from 0 (e.g. wd_port0).
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-pgpool-port" xreflabel="pgpool_port">
+ <term><varname>pgpool_portX</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>pgpool_portX</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the <productname>Pgpool-II</productname> port number.
+ Default is 9999.
+ The number at the end of the parameter name is referred
+ as "pgpool node id", and it starts from 0 (e.g. pgpool_port0).
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+
+ <example id="example-watchdog-1">
+ <title>Watchdog configuration</title>
+ <para>
+ If you have 3 pgpool nodes with hostname server1, server2 and server3,
+ you can configure <xref linkend="guc-hostname">,
+ <xref linkend="guc-wd-port"> and <xref linkend="guc-pgpool-port"> like below:
+ <programlisting>
+hostname0 = 'server1'
+wd_port0 = 9000
+pgpool_port0 = 9999
+
+hostname1 = 'server2'
+wd_port1 = 9000
+pgpool_port1 = 9999
+
+hostname2 = 'server3'
+wd_port2 = 9000
+pgpool_port2 = 9999
+ </programlisting>
+ </para>
+ </example>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-authkey" xreflabel="wd_authkey">
+ <term><varname>wd_authkey</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_authkey</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the authentication key used for all watchdog communications.
+ All <productname>Pgpool-II</productname> must have the same key.
+ Packets from watchdog having different key will get rejected.
+ This authentication is also applied to the heartbeat signals
+ when the <literal>heartbeat</> mode is used as a lifecheck method.
+ </para>
+ <para>
+ Since in <productname>Pgpool-II</productname><emphasis>V3.5</emphasis> or beyond
+ <varname>wd_authkey</varname> is also used to authenticate
+ the watchdog IPC clients,
+ all clients communicating with <productname>Pgpool-II</productname>
+ watchdog process needs to provide this wd_authkey value
+ for <literal>"IPCAuthKey"</literal> key in the JSON data
+ of the command.
+ </para>
+ <para>
+ Default is <literal>''</literal> (empty) which means disables
+ the watchdog authentication.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-upstream-connections">
+ <title>Upstream server connection</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-trusted-servers" xreflabel="trusted_servers">
+ <term><varname>trusted_servers</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>trusted_servers</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the list of trusted servers to check the up stream connections.
+ Each server in the list is required to respond to ping.
+ Specify a comma separated list of servers such as
+ <literal>"hostA,hostB,hostC"</literal>.
+ If none of the server are reachable, watchdog will regard it as
+ failure of the <productname>Pgpool-II</productname>.
+ Therefore, it is recommended to specify multiple servers.
+ Please note that you should not assign PostgreSQL servers to this parameter.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-ping-path" xreflabel="ping_path">
+ <term><varname>ping_path</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>ping_path</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the path of a ping command for monitoring
+ connection to the upper servers. Set the only path of the directory containing the
+ ping utility, such as <literal>"/bin"</literal> or such directory.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-vip-control">
+ <title>Virtual IP control</title>
+
+ <variablelist>
+
+ <varlistentry id="guc-delegate-IP" xreflabel="delegate_IP">
+ <term><varname>delegate_IP</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>delegate_IP</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the virtual IP address (VIP) of
+ <productname>Pgpool-II</productname> that is connected from
+ client servers (application servers etc.). When a
+ <productname>Pgpool-II</productname> is switched from standby to
+ active, the <productname>Pgpool-II</productname> takes over this
+ VIP. <emphasis>VIP will not be brought up in case the quorum
+ does not exist</emphasis>. Default is <literal>''</literal>(empty): which
+ means virtual IP will never be brought up.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-if-cmd-path" xreflabel="if_cmd_path">
+ <term><varname>if_cmd_path</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>if_cmd_path</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the path to the command that <productname>Pgpool-II</productname>
+ will use to switch the virtual IP on the system.
+ Set only the path of the directory containing the binary,
+ such as <literal>"/sbin"</literal> or such directory.
+ If <xref linkend="guc-if-up-cmd"> or <xref linkend="guc-if-down-cmd"> starts with "/",
+ this parameter will be ignored.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-if-up-cmd" xreflabel="if_up_cmd">
+ <term><varname>if_up_cmd</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>if_up_cmd</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the command to bring up the virtual IP.
+ Set the command and parameters such as
+ <literal>"ip addr add $_IP_$/24 dev eth0 label eth0:0"</literal>.
+ Since root privilege is required to execute this command,
+ use <command>setuid</command> on <command>ip</command> command or
+ allow <productname>Pgpool-II</productname> startup user (<literal>postgres</literal> user by default)
+ to run <command>sudo</command> command without a password, and specify it such as
+ <literal>"/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0"</literal>.
+ <literal>$_IP_$</literal> will get replaced by the IP address
+ specified in the <xref linkend="guc-delegate-IP">.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-if-down-cmd" xreflabel="if_down_cmd">
+ <term><varname>if_down_cmd</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>if_down_cmd</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the command to bring down the virtual IP.
+ Set the command and parameters such as
+ <literal>"ip addr del $_IP_$/24 dev eth0"</literal>.
+ Since root privilege is required to execute this command,
+ use <command>setuid</command> on <command>ip</command> command or
+ allow <productname>Pgpool-II</productname> startup user (<literal>postgres</literal> user by default)
+ to run <command>sudo</command> command without a password, and specify it such as
+ <literal>"/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0"</literal>.
+ <literal>$_IP_$</literal> will get replaced by the IP address
+ specified in the <xref linkend="guc-delegate-IP">.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-arping-path" xreflabel="arping_path">
+ <term><varname>arping_path</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>arping_path</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the path to the command that <productname>Pgpool-II</productname>
+ will use to send the ARP requests after the virtual IP switch.
+ Set only the path of the directory containing the binary,
+ such as <literal>"/usr/sbin"</literal> or such directory.
+ If <xref linkend="guc-arping-cmd"> starts with "/",
+ this parameter will be ignored.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-arping-cmd" xreflabel="arping_cmd">
+ <term><varname>arping_cmd</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>arping_cmd</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the command to use for sending the ARP requests
+ after the virtual IP switch.
+ Set the command and parameters such as
+ <literal>"arping -U $_IP_$ -w 1 -I eth0"</literal>.
+ Since root privilege is required to execute this command,
+ use <command>setuid</command> on <command>ip</command> command or
+ allow <productname>Pgpool-II</productname> startup user (<literal>postgres</literal> user by default)
+ to run <command>sudo</command> command without a password, and specify it such as
+ <literal>"/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0"</literal>.
+ <literal>$_IP_$</literal> will get replaced by
+ the IP address specified in the <varname>delegate_IP</varname>.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-escalation-de-escalation">
+ <title>Behaviour on escalation and de-escalation</title>
+
+ <para>
+ Configuration about behavior when <productname>Pgpool-II</productname>
+ escalates to active (virtual IP holder)
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-clear-memqcache-on-escalation" xreflabel="clear_memqcache_on_escalation">
+ <term><varname>clear_memqcache_on_escalation</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>clear_memqcache_on_escalation</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When set to on, watchdog clears all the query cache in the shared memory
+ when pgpool-II escalates to active. This prevents the new active <productname>Pgpool-II</productname>
+ from using old query caches inconsistent to the old active.
+ </para>
+ <para>
+ Default is on.
+ </para>
+ <para>
+ This works only if <xref linkend="guc-memqcache-method">
+ is <literal>'shmem'</literal>.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-escalation-command" xreflabel="wd_escalation_command">
+ <term><varname>wd_escalation_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_escalation_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Watchdog executes this command on the node that is escalated
+ to the leader watchdog.
+ </para>
+ <para>
+ This command is executed just before bringing up the
+ virtual IP if that is configured on the node.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-de-escalation-command" xreflabel="wd_de_escalation_command">
+ <term><varname>wd_de_escalation_command</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_de_escalation_command</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Watchdog executes this command on the leader <productname>Pgpool-II</productname>
+ watchdog node when that node resigns from the leader node responsibilities.
+ A leader watchdog node can resign from being a leader node,
+ when the leader node <productname>Pgpool-II</productname> shuts down, detects a network
+ blackout or detects the lost of <indexterm><primary>quorum</primary></indexterm><firstterm>quorum</firstterm>.
+ </para>
+ <para>
+ This command is executed before bringing down the virtual/floating IP address
+ if it is configured on the watchdog node.
+ </para>
+ <para>
+ <varname>wd_de_escalation_command</varname> is not available prior to
+ <productname>Pgpool-II </productname><emphasis>V3.5</emphasis>.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-failover-behavior">
+ <title>Controlling the Failover behavior</title>
+
+ <para>
+ These settings are used to control the behavior of backend node failover when the watchdog is enabled.
+ The effect of these configurations is limited to the failover/degenerate requests initiated by
+ <productname>Pgpool-II</productname> internally, while the user initiated detach backend requests
+ (using PCP command) by-pass these configuration settings.
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-failover-when-quorum-exists" xreflabel="failover_when_quorum_exists">
+ <term><varname>failover_when_quorum_exists</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>failover_when_quorum_exists</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When enabled, <productname>Pgpool-II</productname> will consider <indexterm><primary>quorum</primary></indexterm>quorum when it performs the degenerate/failover on backend node.
+ </para>
+ <para>
+ We can say that "quorum exists" if the number of live
+ watchdog nodes (that is number
+ of <productname>Pgpool-II</productname> nodes) can be a
+ majority against the total number of watchdog nodes. For
+ example, suppose number of watchdog nodes is 5. If number of
+ live nodes is greater than or equal to 3, then quorum
+ exists. On the other hand if number of live nodes is 2 or
+ lower, quorum does not exist since it never be
+ majority.
+ </para>
+ <para>
+ If the quorum exists, <productname>Pgpool-II</productname>
+ could work better on failure detection because even if a
+ watchdog node mistakenly detects a failure of backend node,
+ it would be denied by other major watchdog nodes.
+ <productname>Pgpool-II</productname> works that way
+ when <xref linkend="guc-failover-require-consensus"> is on
+ (the default), but you can change it so that immediate
+ failover happens when a failure is detected.
+ A <productname>Pgpool-II</productname> node which mistakenly
+ detects failure of backend node will quarantine the backend
+ node.
+ </para>
+ <para>
+ The existence of quorum can be shown by invoking <xref linkend="pcp-watchdog-info"> command with <literal>--verbose</literal> option.
+ If <literal>Quorum state</literal> is <literal>QUORUM EXIST</literal> or <literal>QUORUM IS ON THE EDGE</literal>, then the quorum exists.
+ If <literal>Quorum state</literal> is <literal>QUORUM ABSENT</literal>, then the quorum does not exist.
+ </para>
+ <para>
+ Please note that if the number of watchdog nodes is even, we
+ regard that quorum exists when the number of live nodes is
+ greater than or equal to half of total watchdog nodes.
+ </para>
+ <para>
+ In the absence of the
+ quorum, <productname>Pgpool-II</productname> node that
+ detects the backend failure will quarantine the failed
+ backend node until the quorum exists again.
+ </para>
+ <para>
+ Although it is possible to force detaching the quarantine
+ node by using <command>pcp_detach_node</command> command, it
+ is not possible to attach the node again by
+ using <command>pcp_attach_node</command> command.
+ </para>
+ <para>
+ The <indexterm><primary>quarantine</primary></indexterm>
+ quarantine nodes behaves similar to the detached backend nodes
+ but unlike failed/degenerated backends the quarantine status is
+ not propagated to the other <productname>Pgpool-II</productname>
+ nodes in the watchdog cluster, So even if the backend node is in
+ the quarantine state on one <productname>Pgpool-II</productname>
+ node, other <productname>Pgpool-II</productname> nodes may still
+ continue to use that backend.
+ </para>
+ <para>
+ Although there are many similarities in quarantine and failover operations, but they both differ in a very
+ fundamental way. The quarantine operations does not executes the <xref linkend="guc-failover-command">
+ and silently detaches the problematic node, So in the case when the main backend node is quarantined, the
+ <productname>Pgpool-II</productname> will not promote the standby to take over the main node responsibilities
+ and until the main node is quarantined the <productname>Pgpool-II</productname> will not have
+ any usable main backend node.
+ </para>
+ <para>
+ Moreover, unlike for the failed nodes,
+ <productname>Pgpool-II</productname> keeps the health-check
+ running on the quarantined nodes and as soon as the quarantined
+ node becomes reachable again it gets automatically
+ re-attached. Note that this is only applied to
+ <productname>Pgpool-II </productname><emphasis>V4.1</emphasis>
+ or greater. If you are using previous versions you need to
+ re-attach the quarantined node by using <xref
+ linkend="pcp-attach-node"> when the connectivity issue is
+ solved.
+ </para>
+ <para>
+ From <productname>Pgpool-II </productname><emphasis>V4.1</emphasis> onward, if the watchdog-leader node
+ fails to build the consensus for primary backend node failover and the primary backend node gets into a
+ quarantine state, then it resigns from its leader/coordinator responsibilities and lowers its wd_priority
+ for next leader election and let the cluster elect some different new leader.
+ <note>
+ <para>
+ When the leader node fails to build the consensus for standby backend node failure, it takes no action
+ and similarly quarantined standby backend nodes on watchdog-leader do not trigger a new leader election.
+ </para>
+ </note>
+ </para>
+ <para>
+ If this parameter is off, failover will be triggered even if
+ quorum does not exist.
+ </para>
+ <para>
+ Default is on.
+ </para>
+ <para>
+ <varname>failover_when_quorum_exists</varname> is not available prior to
+ <productname>Pgpool-II </productname><emphasis>V3.7</emphasis>.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ <note>
+ <para>
+ enabling <varname>failover_when_quorum_exists</varname> is not allowed in native replication mode.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-failover-require-consensus" xreflabel="failover_require_consensus">
+ <term><varname>failover_require_consensus</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>failover_require_consensus</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ When enabled, <productname>Pgpool-II</productname> will perform the degenerate/failover on a
+ backend node if the watchdog quorum exists and at-least minimum number of nodes necessary
+ for the quorum vote for the failover.
+ </para>
+ <para>
+ For example, in a three node watchdog cluster, the failover will only be performed until at
+ least two nodes ask for performing the failover on the particular backend node.
+ </para>
+ <para>
+ If this parameter is off, failover will be triggered even if
+ there's no consensus.
+ </para>
+ <para>
+ Default is on.
+ </para>
+
+ <caution>
+ <para>
+ When <varname>failover_require_consensus</varname> is
+ enabled, <productname>Pgpool-II</productname> does not
+ execute the failover until it get enough votes from
+ other <productname>Pgpool-II</productname> nodes. So it is
+ strongly recommended to enable the backend health check on
+ all
+ <productname>Pgpool-II</productname> nodes to ensure
+ proper detection of backend node failures. For more
+ details of health check,
+ see <xref linkend="runtime-config-health-check">.
+ </para>
+ </caution>
+
+ <note>
+ <para>
+ enabling <varname>failover_require_consensus</varname> is not allowed in native replication mode.
+ </para>
+ </note>
+
+ <para>
+ <varname>failover_require_consensus</varname> is not available prior to
+ <productname>Pgpool-II </productname><emphasis>V3.7</emphasis>. and it is only
+ effective when <xref linkend="guc-failover-when-quorum-exists"> is enabled
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-allow-multiple-failover-requests-from-node" xreflabel="allow_multiple_failover_requests_from_node">
+ <term><varname>allow_multiple_failover_requests_from_node</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>allow_multiple_failover_requests_from_node</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ This parameter works in connection with the
+ <xref linkend="guc-failover-require-consensus">. When enabled, a single <productname>Pgpool-II</productname>
+ node can cast multiple votes for the failover.
+ </para>
+ <para>
+ For example, in a three node watchdog cluster, if one <productname>Pgpool-II</productname> node sends two
+ failover requests for a particular backend node failover, Both requests will be counted as a separate
+ vote in the favor of the failover and <productname>Pgpool-II</productname> will execute the failover,
+ even if it does not get the vote from any other <productname>Pgpool-II</productname> node.
+ </para>
+ <para>
+ For example, if an error found in a health check round does
+ not get enough vote and the error still persists, next round
+ of health check will give one more vote. This parameter is
+ useful if you want to detect a persistent error which might
+ not be found by other watchdog nodes.
+ </para>
+ <para>
+ Default is off.
+ </para>
+ <para>
+ <varname>allow_multiple_failover_requests_from_node</varname> is not available prior to
+ <productname>Pgpool-II </productname><emphasis>V3.7</emphasis>. and it is only
+ effective when both <xref linkend="guc-failover-when-quorum-exists"> and
+ <xref linkend="guc-failover-require-consensus"> are enabled
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-enable-consensus-with-half-votes" xreflabel="enable_consensus_with_half_votes">
+ <term><varname>enable_consensus_with_half_votes</varname> (<type>boolean</type>)
+ <indexterm>
+ <primary><varname>enable_consensus_with_half_votes</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ This parameter configures how the majority rule computation
+ is made by <productname>Pgpool-II</productname> for calculating
+ the quorum and resolving the consensus for failover.
+ </para>
+ <para>
+ When enabled the existence of quorum and consensus on failover requires only half of
+ the total number of votes configured in the cluster. Otherwise, both of these
+ decisions require at least one more vote than half of the total number of votes.
+ For failover, this parameter works in conjunction with the
+ <xref linkend="guc-failover-require-consensus">. In both cases, whether making a
+ decision of quorum existence or building the consensus on failover this
+ parameter only comes into play when the watchdog cluster is configured for even
+ number of <productname>Pgpool-II</productname> nodes.
+ The majority rule decision in the watchdog cluster having an odd number of participants.
+ It is not affected by the value of this configuration parameter.
+ </para>
+ <para>
+ For example, when this parameter is enabled in a two node watchdog
+ cluster, one <productname>Pgpool-II</productname> node needs to
+ be alive to make the quorum exist. If the parameter is off, two
+ nodes need to be alive to make quorum exist.
+ </para>
+ <para>
+ When this parameter is enabled in a four node watchdog cluster,
+ two <productname>Pgpool-II</productname> node needs to be alive
+ to make the quorum exist. If the parameter is off, three nodes
+ need to be alive to make quorum exist.
+ </para>
+ <para>
+ By enabling this parameter, you should aware that you take a
+ risk to make split-brain happen. For example, in four node
+ cluster consisted of node A, B, C and D, it is possible that the
+ cluster goes into two separated networks (A, B) and (C, D). For
+ (A, B) and (C, D) the quorum still exist since for both groups
+ there are two live nodes out of 4. The two groups choose their
+ own leader watchdog, which is a split-brain.
+ </para>
+ <para>
+ Default is off.
+ </para>
+ <para>
+ <varname>enable_consensus_with_half_votes</varname> is not available
+ prior to <productname>Pgpool-II
+ </productname><emphasis>V4.1</emphasis>. The prior versions work
+ as if the parameter is on.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-lifecheck">
+ <title>Life checking <productname>Pgpool-II</productname> </title>
+
+ <para>
+ Watchdog checks pgpool-II status periodically. This is called "life check".
+ </para>
+
+ <variablelist>
+
+ <varlistentry id="guc-wd-lifecheck-method" xreflabel="wd_lifecheck_method">
+ <term><varname>wd_lifecheck_method</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_lifecheck_method</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the method of life check. This can be either of <literal>'heartbeat'</literal> (default),
+ <literal>'query'</literal> or <literal>'external'</literal>.
+ </para>
+ <para>
+ <literal>heartbeat</literal>: In this mode, watchdog sends the heartbeat signals (<acronym>UDP</acronym> packets)
+ periodically to other <productname>Pgpool-II</productname>. Similarly watchdog also receives the signals
+ from other <productname>Pgpool-II</productname> .
+ If there are no signal for a certain period, watchdog regards is as failure
+ of the <productname>Pgpool-II</productname> .
+ </para>
+ <para>
+ <literal>query</literal>: In this mode, watchdog sends the monitoring queries
+ to other <productname>Pgpool-II</productname> and checks the response.
+ When installation location between <productname>Pgpool-II</productname>
+ servers is far, <literal>query</literal> may be useful.
+ <caution>
+ <para>
+ In query mode, you need to set <xref linkend="guc-num-init-children">
+ large enough if you plan to use watchdog.
+ This is because the watchdog process connects to
+ <productname>Pgpool-II</productname> as a client.
+ </para>
+ </caution>
+ </para>
+ <para>
+ <literal>external</literal>: This mode disables the built
+ in lifecheck of <productname>Pgpool-II</productname> watchdog
+ and relies on external system to provide node health checking
+ of local and remote watchdog nodes.
+ </para>
+
+ <para>
+ <literal>external</literal> mode is not available in versions prior to
+ <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-monitoring-interfaces-list" xreflabel="wd_monitoring_interfaces_list">
+ <term><varname>wd_monitoring_interfaces_list</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_monitoring_interfaces_list</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specify a comma separated list of network device names, to be monitored by the watchdog process
+ for the network link state. If all network interfaces in the list becomes inactive
+ (disabled or cable unplugged), the watchdog will consider it as a complete network failure
+ and the <productname>Pgpool-II</productname> node will commit the suicide.
+ Specifying an <literal>''</literal>(empty) list disables the network interface monitoring.
+ Setting it to <literal>'any'</literal> enables the monitoring on all available network interfaces
+ except the loopback. Default is <literal>''</literal> empty list (monitoring disabled).
+ </para>
+
+ <para>
+ <varname>wd_monitoring_interfaces_list</varname> is not available in versions prior to
+ <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-interval" xreflabel="wd_interval">
+ <term><varname>wd_interval</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>wd_interval</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the interval between life checks of <productname>Pgpool-II</productname>
+ in seconds. (A number greater than or equal to 1) Default is 10.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-priority" xreflabel="wd_priority">
+ <term><varname>wd_priority</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>wd_priority</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ This parameter can be used to elevate the local watchdog node priority in the elections
+ to select leader watchdog node.
+ The node with the higher <varname>wd_priority</varname> value will get selected
+ as leader watchdog node when cluster will be electing its new leader node
+ in the event of old leader watchdog node failure.
+ <varname>wd_priority</varname> is also valid at the time of cluster startup.
+ When some watchdog nodes start up at same time,a node with the higher <varname>wd_priority</varname>
+ value is selected as a leader node.
+ So we should start watchdog nodes in order of <varname>wd_priority</varname> priority to prevent
+ unintended nodes from being selected as leader.
+ </para>
+ <para>
+ <varname>wd_priority</varname> is not available in versions prior to
+ <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>.
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-ipc-socket-dir" xreflabel="wd_ipc_socket_dir">
+ <term><varname>wd_ipc_socket_dir</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_ipc_socket_dir</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ The directory where the <acronym>UNIX</acronym> domain socket
+ accepting <productname>Pgpool-II</productname>
+ watchdog <acronym>IPC</acronym> connections will be created.
+ Default is <literal>'/tmp'</literal>.
+ Be aware that this socket might be deleted by a cron job.
+ We recommend to set this value to <literal>'/var/run'</literal> or such directory.
+ </para>
+ <para>
+ <varname>wd_ipc_socket_dir</varname> is not available in versions prior to
+ <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>.
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-lifecheck-heartbeat">
+ <title>Lifecheck Heartbeat mode configuration</title>
+ <variablelist>
+ <varlistentry id="guc-heartbeat-hostname" xreflabel="heartbeat_hostname">
+ <term><varname>heartbeat_hostnameX</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>heartbeat_hostnameX</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the <acronym>IP</acronym> address or <acronym>hostname</acronym>
+ for sending and receiving the heartbeat signals.
+ The number at the end of the parameter name is referred
+ as "pgpool node id", and it starts from 0 (e.g. heartbeat_hostname0).
+ You can specify multiple <acronym>IP</acronym> address or <acronym>hostname</acronym>
+ by separating them using semicolon (;).
+ </para>
+ <para>
+ <varname>heartbeat_hostnameX</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'heartbeat'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-heartbeat-port" xreflabel="heartbeat_port">
+ <term><varname>heartbeat_portX</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>heartbeat_portX</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the port number for sending and receiving the heartbeat signals.
+ Specify only one port number here. Default is 9694.
+ The number at the end of the parameter name is referred
+ as "pgpool node id", and it starts from 0 (e.g. heartbeat_port0).
+ </para>
+ <para>
+ <varname>heartbeat_portX</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'heartbeat'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-heartbeat-device" xreflabel="heartbeat_device">
+ <term><varname>heartbeat_deviceX</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>heartbeat_deviceX</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the network device name for sending and receiving the heartbeat signals.
+ The number at the end of the parameter name is referred
+ as "pgpool node id", and it starts from 0 (e.g. heartbeat_device0).
+ You can specify multiple network devices by separating them using semicolon (;).
+ </para>
+ <para>
+ <varname>heartbeat_deviceX</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'heartbeat'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ <example id="example-heartbeat-1">
+ <title>Heartbeat configuration</title>
+ <para>
+ If you have 3 pgpool nodes with hostname server1, server2 and server3,
+ you can configure <xref linkend="guc-heartbeat-hostname">,
+ <xref linkend="guc-heartbeat-port"> and <xref linkend="guc-heartbeat-device"> like below:
+ <programlisting>
+ heartbeat_hostname0 = 'server1'
+ heartbeat_port0 = 9694
+ heartbeat_device0 = ''
+
+ heartbeat_hostname1 = 'server2'
+ heartbeat_port1 = 9694
+ heartbeat_device1 = ''
+
+ heartbeat_hostname2 = 'server3'
+ heartbeat_port2 = 9694
+ heartbeat_device2 = ''
+ </programlisting>
+ </para>
+ </example>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-heartbeat-keepalive" xreflabel="wd_heartbeat_keepalive">
+ <term><varname>wd_heartbeat_keepalive</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>wd_heartbeat_keepalive</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the interval time in seconds between sending the heartbeat signals.
+ Default is 2.
+ <varname>wd_heartbeat_keepalive</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'heartbeat'</literal>
+ </para>
+
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-heartbeat-deadtime" xreflabel="wd_heartbeat_deadtime">
+ <term><varname>wd_heartbeat_deadtime</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>wd_heartbeat_deadtime</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the time in seconds before marking the remote watchdog node as failed/dead node,
+ if no heartbeat signal is received within that time.
+ Default is <literal>30</literal>
+ <varname>wd_heartbeat_deadtime</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'heartbeat'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </sect2>
+
+ <sect2 id="config-watchdog-lifecheck-query">
+ <title>Lifecheck Query mode configuration</title>
+ <variablelist>
+
+ <varlistentry id="guc-wd-life-point" xreflabel="wd_life_point">
+ <term><varname>wd_life_point</varname> (<type>integer</type>)
+ <indexterm>
+ <primary><varname>wd_life_point</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the number of times to retry a failed life check of pgpool-II.
+ Valid value could be a number greater than or equal to 1.
+ Default is 3.
+ </para>
+ <para>
+ <varname>wd_life_point</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'query'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-lifecheck-query" xreflabel="wd_lifecheck_query">
+ <term><varname>wd_lifecheck_query</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_lifecheck_query</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the query to use for the life check of remote <productname>Pgpool-II</productname>.
+ Default is <literal>"SELECT 1"</literal>.
+ </para>
+ <para>
+ <varname>wd_lifecheck_query</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'query'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-lifecheck-dbname" xreflabel="wd_lifecheck_dbname">
+ <term><varname>wd_lifecheck_dbname</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_lifecheck_dbname</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the database name for the connection used for the
+ life check of remote <productname>Pgpool-II</productname>.
+ Default is <literal>"template1"</literal>.
+ </para>
+ <para>
+ <varname>wd_lifecheck_dbname</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'query'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-lifecheck-user" xreflabel="wd_lifecheck_user">
+ <term><varname>wd_lifecheck_user</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_lifecheck_user</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the user name for the connection used for the life
+ check of remote <productname>Pgpool-II</productname>.
+ Default is <literal>"nobody"</literal>.
+ </para>
+ <para>
+ <varname>wd_lifecheck_user</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'query'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="guc-wd-lifecheck-password" xreflabel="wd_lifecheck_password">
+ <term><varname>wd_lifecheck_password</varname> (<type>string</type>)
+ <indexterm>
+ <primary><varname>wd_lifecheck_password</varname> configuration parameter</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>
+ Specifies the password for the user used for the life check of remote <productname>Pgpool-II</productname>.
+ </para>
+ <para>
+ If <varname>wd_lifecheck_password</varname> is left blank <productname>Pgpool-II</productname>
+ will first try to get the password for <xref linkend="guc-wd-lifecheck-user"> from
+ <xref linkend="guc-pool-passwd"> file before using the empty password.
+ </para>
+ <para>
+ You can also specify AES256-CBC encrypted password in <varname>wd_lifecheck_password</varname> field.
+ To specify the <literal>AES</literal> encrypted password, password string must be prefixed with
+ <literal>AES</literal> after encrypting (using <literal>aes-256-cbc</literal> algorithm) and
+ encoding to <literal>base64</literal>.
+ </para>
+ <para>
+ To specify the unencrypted clear text password, prefix the password string with
+ <literal>TEXT</literal>. For example if you want to set <literal>mypass</literal> as
+ a password, you should specify <literal>TEXTmypass</literal> in the password field.
+ In the absence of a valid prefix, <productname>Pgpool-II</productname> will considered
+ the string as a plain text password.
+ </para>
+ <para>
+ You can also use <xref linkend="PG-ENC"> utility to create the correctly formatted
+ <literal>AES</literal> encrypted password strings.
+ <note>
+ <para>
+ <productname>Pgpool-II</productname> will require a valid decryption key at the
+ startup to use the encrypted passwords.
+ see <xref linkend="auth-aes-decryption-key"> for more details on providing the
+ decryption key to <productname>Pgpool-II</productname>
+ </para>
+ </note>
+ </para>
+ <para>
+ <varname>wd_lifecheck_password</varname> is only applicable if the
+ <xref linkend="guc-wd-lifecheck-method"> is set to <literal>'query'</literal>
+ </para>
+ <para>
+ This parameter can only be set at server start.
+ </para>
+ <para>
+ Default is <literal>''</literal>(empty).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </sect2>
+</sect1>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+<!--
+ This file contains XSLT stylesheet customizations that are common to
+ all output formats (HTML, HTML Help, XSL-FO, etc.).
+ -->
+
+
+<!-- Parameters -->
+
+<xsl:param name="pg.fast" select="'0'"/>
+
+<!--
+<xsl:param name="draft.mode">
+ <xsl:choose>
+ <xsl:when test="contains($pgpool.version, 'devel')">yes</xsl:when>
+ <xsl:otherwise>no</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+-->
+
+<xsl:param name="show.comments">
+ <xsl:choose>
+ <xsl:when test="contains($pgpool.version, 'devel')">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+
+<xsl:param name="callout.graphics" select="'0'"></xsl:param>
+<xsl:param name="toc.section.depth">2</xsl:param>
+<xsl:param name="linenumbering.extension" select="'0'"></xsl:param>
+<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param>
+<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param>
+<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param>
+<xsl:param name="refentry.xref.manvolnum" select="0"/>
+<xsl:param name="formal.procedures" select="0"></xsl:param>
+<xsl:param name="punct.honorific" select="''"></xsl:param>
+<xsl:param name="variablelist.term.break.after">1</xsl:param>
+<xsl:param name="variablelist.term.separator"></xsl:param>
+
+
+<!-- Change display of some elements -->
+
+<xsl:template match="productname">
+ <xsl:call-template name="inline.charseq"/>
+</xsl:template>
+
+<xsl:template match="structfield">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="structname">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="symbol">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="systemitem">
+ <xsl:call-template name="inline.charseq"/>
+</xsl:template>
+
+<xsl:template match="token">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="type">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="programlisting/emphasis">
+ <xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+
+<!-- Special support for Tcl synopses -->
+
+<xsl:template match="optional[@role='tcl']">
+ ?<xsl:call-template name="inline.charseq"/>?
+</xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+/* doc/src/sgml/stylesheet.css */
+
+/* color scheme similar to www.postgresql.org */
+
+BODY {
+ color: #000000;
+ background: #FFFFFF;
+ font-family: verdana, sans-serif;
+}
+
+A:link { color:#0066A2; }
+A:visited { color:#004E66; }
+A:active { color:#0066A2; }
+A:hover { color:#000000; }
+
+H1 {
+ font-size: 1.4em;
+ font-weight: bold;
+ margin-top: 0em;
+ margin-bottom: 0em;
+ color: #EC5800;
+}
+
+H2 {
+ font-size: 1.2em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: bold;
+ color: #666;
+}
+
+H3 {
+ font-size: 1.1em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: bold;
+ color: #666;
+}
+
+H4 {
+ font-size: 0.95em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: normal;
+ color: #666;
+}
+
+H5 {
+ font-size: 0.9em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: normal;
+}
+
+H6 {
+ font-size: 0.85em;
+ margin: 1.2em 0em 1.2em 0em;
+ font-weight: normal;
+}
+
+/* center some titles */
+
+.BOOK .TITLE, .BOOK .CORPAUTHOR, .BOOK .COPYRIGHT {
+ text-align: center;
+}
+
+/* decoration for formal examples */
+
+DIV.EXAMPLE {
+ padding-left: 15px;
+ border-style: solid;
+ border-width: 0px;
+ border-left-width: 2px;
+ border-color: black;
+ margin: 0.5ex;
+}
+
+/* less dense spacing of TOC */
+
+.BOOK .TOC DL DT {
+ padding-top: 1.5ex;
+ padding-bottom: 1.5ex;
+}
+
+.BOOK .TOC DL DL DT {
+ padding-top: 0ex;
+ padding-bottom: 0ex;
+}
+
+/* miscellaneous */
+
+PRE.LITERALLAYOUT, .SCREEN, .SYNOPSIS, .PROGRAMLISTING {
+ margin-left: 4ex;
+}
+
+.COMMENT { color: red; }
+
+VAR { font-family: monospace; font-style: italic; }
+/* Konqueror's standard style for ACRONYM is italic. */
+ACRONYM { font-style: inherit; }
--- /dev/null
+<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
+<!ENTITY % html "IGNORE">
+<![%html;[
+<!ENTITY % print "IGNORE">
+<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
+]]>
+<!ENTITY % print "INCLUDE">
+<![%print;[
+<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
+]]>
+]>
+<style-sheet>
+<style-specification id="print" use="docbook">
+<style-specification-body>
+
+;; customize the print stylesheet
+
+</style-specification-body>
+</style-specification>
+<style-specification id="html" use="docbook">
+<style-specification-body>
+
+;; customize the html stylesheet
+
+</style-specification-body>
+</style-specification>
+<external-specification id="docbook" document="docbook.dsl">
+</style-sheet>
--- /dev/null
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'
+ xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ exclude-result-prefixes="#default">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
+<xsl:include href="stylesheet-common.xsl" />
+
+
+<!-- Parameters -->
+<xsl:param name="base.dir" select="'html/'"></xsl:param>
+<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
+<xsl:param name="make.valid.html" select="1"></xsl:param>
+<xsl:param name="generate.id.attributes" select="1"></xsl:param>
+<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
+<xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
+<xsl:param name="chunk.first.sections" select="1"/>
+<xsl:param name="chunk.quietly" select="1"></xsl:param>
+<xsl:param name="toc.max.depth">2</xsl:param>
+
+<xsl:param name="website.stylesheet" select="0"/>
+
+<xsl:param name="html.stylesheet">
+ <xsl:choose>
+ <xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
+ <xsl:otherwise>http://www.postgresql.org/media/css/docs.css</xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+
+
+<!-- Change display of some elements -->
+
+<xsl:template match="command">
+ <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+
+<!-- table of contents configuration -->
+
+<xsl:param name="generate.toc">
+appendix toc,title
+article/appendix nop
+article toc,title
+book toc,title
+chapter toc,title
+part toc,title
+preface toc,title
+qandadiv toc
+qandaset toc
+reference toc,title
+sect1 toc
+sect2 toc
+sect3 toc
+sect4 toc
+sect5 toc
+section toc
+set toc,title
+</xsl:param>
+
+</xsl:stylesheet>