# config/docbook.m4
-# PGAC_PROG_NSGMLS
-# ----------------
-AC_DEFUN([PGAC_PROG_NSGMLS],
-[PGAC_PATH_PROGS(NSGMLS, [onsgmls nsgmls])])
+# PGAC_PATH_XMLLINT
+# -----------------
+AC_DEFUN([PGAC_PATH_XMLLINT],
+[PGAC_PATH_PROGS(XMLLINT, xmllint)])
# PGAC_CHECK_DOCBOOK(VERSION)
# ---------------------------
AC_DEFUN([PGAC_CHECK_DOCBOOK],
-[AC_REQUIRE([PGAC_PROG_NSGMLS])
-AC_CACHE_CHECK([for DocBook V$1], [pgac_cv_check_docbook],
-[cat >conftest.sgml <<EOF
-<!doctype book PUBLIC "-//OASIS//DTD DocBook V$1//EN">
+[AC_REQUIRE([PGAC_PATH_XMLLINT])
+AC_CACHE_CHECK([for DocBook XML V$1], [pgac_cv_check_docbook],
+[cat >conftest.xml <<EOF
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V$1//EN" "http://www.oasis-open.org/docbook/xml/$1/docbookx.dtd">
<book>
<title>test</title>
<chapter>
pgac_cv_check_docbook=no
-if test -n "$NSGMLS"; then
- $NSGMLS -s conftest.sgml 1>&AS_MESSAGE_LOG_FD 2>&1
+if test -n "$XMLLINT"; then
+ $XMLLINT --noout --valid conftest.xml 1>&AS_MESSAGE_LOG_FD 2>&1
if test $? -eq 0; then
pgac_cv_check_docbook=yes
fi
fi
-rm -f conftest.sgml])
+rm -f conftest.xml])
have_docbook=$pgac_cv_check_docbook
AC_SUBST([have_docbook])
PG_VERSION_NUM
PROVE
FOP
-OSX
XSLTPROC
-XMLLINT
DBTOEPUB
have_docbook
-NSGMLS
+XMLLINT
TCL_SHLIB_LD_LIBS
TCL_SHARED_BUILD
TCL_LIB_SPEC
#
# Check for DocBook and tools
#
-if test -z "$NSGMLS"; then
- for ac_prog in onsgmls nsgmls
+if test -z "$XMLLINT"; then
+ for ac_prog in xmllint
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_NSGMLS+:} false; then :
+if ${ac_cv_path_XMLLINT+:} false; then :
$as_echo_n "(cached) " >&6
else
- case $NSGMLS in
+ case $XMLLINT in
[\\/]* | ?:[\\/]*)
- ac_cv_path_NSGMLS="$NSGMLS" # Let the user override the test with a path.
+ ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_NSGMLS="$as_dir/$ac_word$ac_exec_ext"
+ ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
;;
esac
fi
-NSGMLS=$ac_cv_path_NSGMLS
-if test -n "$NSGMLS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
-$as_echo "$NSGMLS" >&6; }
+XMLLINT=$ac_cv_path_XMLLINT
+if test -n "$XMLLINT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
+$as_echo "$XMLLINT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- test -n "$NSGMLS" && break
+ test -n "$XMLLINT" && break
done
else
- # Report the value of NSGMLS in configure's output in all cases.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSGMLS" >&5
-$as_echo_n "checking for NSGMLS... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
-$as_echo "$NSGMLS" >&6; }
+ # Report the value of XMLLINT in configure's output in all cases.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLLINT" >&5
+$as_echo_n "checking for XMLLINT... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
+$as_echo "$XMLLINT" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5
-$as_echo_n "checking for DocBook V4.2... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.2" >&5
+$as_echo_n "checking for DocBook XML V4.2... " >&6; }
if ${pgac_cv_check_docbook+:} false; then :
$as_echo_n "(cached) " >&6
else
- cat >conftest.sgml <<EOF
-<!doctype book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
+ cat >conftest.xml <<EOF
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>
<title>test</title>
<chapter>
pgac_cv_check_docbook=no
-if test -n "$NSGMLS"; then
- $NSGMLS -s conftest.sgml 1>&5 2>&1
+if test -n "$XMLLINT"; then
+ $XMLLINT --noout --valid conftest.xml 1>&5 2>&1
if test $? -eq 0; then
pgac_cv_check_docbook=yes
fi
fi
-rm -f conftest.sgml
+rm -f conftest.xml
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
$as_echo "$pgac_cv_check_docbook" >&6; }
$as_echo "$DBTOEPUB" >&6; }
fi
-if test -z "$XMLLINT"; then
- for ac_prog in xmllint
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XMLLINT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $XMLLINT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-XMLLINT=$ac_cv_path_XMLLINT
-if test -n "$XMLLINT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
-$as_echo "$XMLLINT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$XMLLINT" && break
-done
-
-else
- # Report the value of XMLLINT in configure's output in all cases.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLLINT" >&5
-$as_echo_n "checking for XMLLINT... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
-$as_echo "$XMLLINT" >&6; }
-fi
-
if test -z "$XSLTPROC"; then
for ac_prog in xsltproc
do
$as_echo "$XSLTPROC" >&6; }
fi
-if test -z "$OSX"; then
- for ac_prog in osx sgml2xml sx
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_OSX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $OSX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_OSX="$OSX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_OSX="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-OSX=$ac_cv_path_OSX
-if test -n "$OSX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
-$as_echo "$OSX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$OSX" && break
-done
-
-else
- # Report the value of OSX in configure's output in all cases.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSX" >&5
-$as_echo_n "checking for OSX... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
-$as_echo "$OSX" >&6; }
-fi
-
if test -z "$FOP"; then
for ac_prog in fop
do
#
# Check for DocBook and tools
#
-PGAC_PROG_NSGMLS
+PGAC_PATH_XMLLINT
PGAC_CHECK_DOCBOOK(4.2)
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
-PGAC_PATH_PROGS(XMLLINT, xmllint)
PGAC_PATH_PROGS(XSLTPROC, xsltproc)
-PGAC_PATH_PROGS(OSX, [osx sgml2xml sx])
PGAC_PATH_PROGS(FOP, fop)
#
FOP = $(missing) fop
endif
-SGMLINCLUDE = -D . -D $(srcdir)
-
-ifndef NSGMLS
-NSGMLS = $(missing) nsgmls
-endif
-
-ifndef OSX
-OSX = $(missing) osx
-endif
+XMLINCLUDE = --path .
ifndef XMLLINT
XMLLINT = $(missing) xmllint
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
-# Enable some extra warnings
-# -wfully-tagged needed to throw a warning on missing tags
-# for older tool chains, 2007-08-31
-# -wnet catches XML-style empty-element tags like <xref linkend="abc"/>.
-override SPFLAGS += -wall -wno-unused-param -wfully-tagged -wnet
-# Additional warnings for XML compatibility. The conditional is meant
-# to detect whether we are using OpenSP rather than the ancient
-# original SP.
-override SPFLAGS += -wempty
-ifneq (,$(filter o%,$(notdir $(OSX))))
-override SPFLAGS += -wdata-delim -winstance-ignore-ms -winstance-include-ms -winstance-param-entity
-endif
-
##
## Man pages
man distprep-man: man-stamp
-man-stamp: stylesheet-man.xsl postgres.xml
- $(XMLLINT) --noout --valid postgres.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
+man-stamp: stylesheet-man.xsl postgres.sgml $(ALLSGML)
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $(wordlist 1,2,$^)
touch $@
$(XMLLINT) --noout --valid $*.xml
$(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^ >$@
-INSTALL.xml: standalone-profile.xsl standalone-install.xml postgres.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(wordlist 1,2,$^) >$@
-
-
-##
-## SGML->XML conversion
-##
-
-# For obscure reasons, GNU make 3.81 complains about circular dependencies
-# if we try to do "make all" in a VPATH build without the explicit
-# $(srcdir) on the postgres.sgml dependency in this rule. GNU make bug?
-postgres.xml: $(srcdir)/postgres.sgml $(ALLSGML)
- $(OSX) $(SPFLAGS) $(SGMLINCLUDE) -x lower $< >$@.tmp
- $(call mangle-xml,book)
-
-define mangle-xml
-$(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 $(1) PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
- <$@.tmp > $@
-rm $@.tmp
-endef
+INSTALL.xml: standalone-profile.xsl standalone-install.xml postgres.sgml $(ALLSGML)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --xinclude $(wordlist 1,2,$^) >$@
##
html: html-stamp
-html-stamp: stylesheet.xsl postgres.xml
- $(XMLLINT) --noout --valid postgres.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
+html-stamp: stylesheet.xsl postgres.sgml $(ALLSGML)
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $(wordlist 1,2,$^)
cp $(srcdir)/stylesheet.css html/
touch $@
-htmlhelp: stylesheet-hh.xsl postgres.xml
- $(XMLLINT) --noout --valid postgres.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $^
+htmlhelp: stylesheet-hh.xsl postgres.sgml $(ALLSGML)
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(wordlist 1,2,$^)
# single-page HTML
-postgres.html: stylesheet-html-nochunk.xsl postgres.xml
- $(XMLLINT) --noout --valid postgres.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) -o $@ $^
+postgres.html: stylesheet-html-nochunk.xsl postgres.sgml $(ALLSGML)
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) -o $@ $(wordlist 1,2,$^)
# single-page text
postgres.txt: postgres.html
postgres.pdf:
$(error Invalid target; use postgres-A4.pdf or postgres-US.pdf as targets)
-%-A4.fo: stylesheet-fo.xsl %.xml
- $(XMLLINT) --noout --valid $*.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
+%-A4.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $(wordlist 1,2,$^)
-%-US.fo: stylesheet-fo.xsl %.xml
- $(XMLLINT) --noout --valid $*.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
+%-US.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
+ $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $(wordlist 1,2,$^)
%.pdf: %.fo
$(FOP) -fo $< -pdf $@
##
epub: postgres.epub
-postgres.epub: postgres.xml
+postgres.epub: postgres.sgml $(ALLSGML)
$(XMLLINT) --noout --valid $<
$(DBTOEPUB) $<
DB2X_XSLTPROC = db2x_xsltproc
MAKEINFO = makeinfo
-%.texixml: %.xml
+%.texixml: %.sgml $(ALLSGML)
+ $(XMLLINT) --noout --valid $<
$(DB2X_XSLTPROC) -s texi -g output-file=$(basename $@) $< -o $@
%.texi: %.texixml
# Quick syntax check without style processing
check: postgres.sgml $(ALLSGML) check-tabs
- $(NSGMLS) $(SPFLAGS) $(SGMLINCLUDE) -s $<
+ $(XMLLINT) $(XMLINCLUDE) --noout --valid $<
##
# This allows removing some files from the distribution tarballs while
# keeping the dependencies satisfied.
-.SECONDARY: postgres.xml $(GENERATED_SGML)
+.SECONDARY: $(GENERATED_SGML)
.SECONDARY: INSTALL.html INSTALL.xml
.SECONDARY: postgres-A4.fo postgres-US.fo
rm -f *.fo *.pdf
# generated SGML files
rm -f $(GENERATED_SGML)
-# SGML->XML conversion
- rm -f postgres.xml *.tmp
# HTML Help
rm -f htmlhelp.hhp toc.hhc index.hhk
# EPUB
</para>
<para>
- The functions shown in <xref linkend="functions-adminpack-table"> provide
+ The functions shown in <xref linkend="functions-adminpack-table"/> provide
write access to files on the machine hosting the server. (See also the
- functions in <xref linkend="functions-admin-genfile-table">, which
+ functions in <xref linkend="functions-admin-genfile-table"/>, which
provide read-only access.)
Only files within the database cluster directory can be accessed, but
either a relative or absolute path is allowable.
</indexterm>
<para>
<function>pg_logdir_ls</function> returns the start timestamps and path
- names of all the log files in the <xref linkend="guc-log-directory">
- directory. The <xref linkend="guc-log-filename"> parameter must have its
+ names of all the log files in the <xref linkend="guc-log-directory"/>
+ directory. The <xref linkend="guc-log-filename"/> parameter must have its
default setting (<literal>postgresql-%Y-%m-%d_%H%M%S.log</literal>) to use this
function.
</para>
<para>
The functions shown
- in <xref linkend="functions-adminpack-deprecated-table"> are deprecated
+ in <xref linkend="functions-adminpack-deprecated-table"/> are deprecated
and should not be used in new applications; instead use those shown
- in <xref linkend="functions-admin-signal-table">
- and <xref linkend="functions-admin-genfile-table">. These functions are
+ in <xref linkend="functions-admin-signal-table"/>
+ and <xref linkend="functions-admin-genfile-table"/>. These functions are
provided in <filename>adminpack</filename> only for compatibility with old
versions of <application>pgAdmin</application>.
</para>
<para>
This chapter will on occasion refer to examples found in <xref
- linkend="tutorial-sql"> to change or improve them, so it will be
+ linkend="tutorial-sql"/> to change or improve them, so it will be
useful to have read that chapter. Some examples from
this chapter can also be found in
<filename>advanced.sql</filename> in the tutorial directory. This
file also contains some sample data to load, which is not
- repeated here. (Refer to <xref linkend="tutorial-sql-intro"> for
+ repeated here. (Refer to <xref linkend="tutorial-sql-intro"/> for
how to use the file.)
</para>
</sect1>
</indexterm>
<para>
- Refer back to the queries in <xref linkend="tutorial-join">.
+ Refer back to the queries in <xref linkend="tutorial-join"/>.
Suppose the combined listing of weather records and city location
is of particular interest to your application, but you do not want
to type the query each time you need it. You can create a
<para>
Recall the <classname>weather</classname> and
<classname>cities</classname> tables from <xref
- linkend="tutorial-sql">. Consider the following problem: You
+ linkend="tutorial-sql"/>. Consider the following problem: You
want to make sure that no one can insert rows in the
<classname>weather</classname> table that do not have a matching
entry in the <classname>cities</classname> table. This is called
<para>
The behavior of foreign keys can be finely tuned to your
application. We will not go beyond this simple example in this
- tutorial, but just refer you to <xref linkend="ddl">
+ tutorial, but just refer you to <xref linkend="ddl"/>
for more information. Making correct use of
foreign keys will definitely improve the quality of your database
applications, so you are strongly encouraged to learn about them.
<para>
There are options to define the window frame in other ways, but
this tutorial does not cover them. See
- <xref linkend="syntax-window-functions"> for details.
+ <xref linkend="syntax-window-functions"/> for details.
</para>
</footnote>
Here is an example using <function>sum</function>:
<para>
More details about window functions can be found in
- <xref linkend="syntax-window-functions">,
- <xref linkend="functions-window">,
- <xref linkend="queries-window">, and the
- <xref linkend="sql-select"> reference page.
+ <xref linkend="syntax-window-functions"/>,
+ <xref linkend="functions-window"/>,
+ <xref linkend="queries-window"/>, and the
+ <xref linkend="sql-select"/> reference page.
</para>
</sect1>
<para>
Although inheritance is frequently useful, it has not been integrated
with unique constraints or foreign keys, which limits its usefulness.
- See <xref linkend="ddl-inherit"> for more detail.
+ See <xref linkend="ddl-inherit"/> for more detail.
</para>
</note>
</sect1>
index scans themselves, which may be user-defined operator class
code. For example, B-Tree index verification relies on comparisons
made with one or more B-Tree support function 1 routines. See <xref
- linkend="xindex-support"> for details of operator class support
+ linkend="xindex-support"/> for details of operator class support
functions.
</para>
<para>
index that is ordered using an affected collation, simply because
<emphasis>indexed</emphasis> values might happen to have the same
absolute ordering regardless of the behavioral inconsistency. See
- <xref linkend="locale"> and <xref linkend="collation"> for
+ <xref linkend="locale"/> and <xref linkend="collation"/> for
further details about how <productname>PostgreSQL</productname> uses
operating system locales and collations.
</para>
logical inconsistency to be introduced. One obvious testing
strategy is to call <filename>amcheck</filename> functions continuously
when running the standard regression tests. See <xref
- linkend="regress-run"> for details on running the tests.
+ linkend="regress-run"/> for details on running the tests.
</para>
</listitem>
<listitem>
There is no general method of repairing problems that
<filename>amcheck</filename> detects. An explanation for the root cause of
an invariant violation should be sought. <xref
- linkend="pageinspect"> may play a useful role in diagnosing
+ linkend="pageinspect"/> may play a useful role in diagnosing
corruption that <filename>amcheck</filename> detects. A <command>REINDEX</command>
may not be effective in repairing corruption.
</para>
<title>Author</title>
<para>
This chapter originated as part of
- <xref linkend="sim98">, Stefan Simkovics'
+ <xref linkend="sim98"/>, Stefan Simkovics'
Master's Thesis prepared at Vienna University of Technology under the direction
of O.Univ.Prof.Dr. Georg Gottlob and Univ.Ass. Mag. Katrin Seyr.
</para>
<para>
The client process can be any program that understands the
<productname>PostgreSQL</productname> protocol described in
- <xref linkend="protocol">. Many clients are based on the
+ <xref linkend="protocol"/>. Many clients are based on the
C-language library <application>libpq</application>, but several independent
implementations of the protocol exist, such as the Java
<application>JDBC</application> driver.
<para>
The query rewriter is discussed in some detail in
- <xref linkend="rules">, so there is no need to cover it here.
+ <xref linkend="rules"/>, so there is no need to cover it here.
We will only point out that both the input and the output of the
rewriter are query trees, that is, there is no change in the
representation or level of semantic detail in the trees. Rewriting
involving large numbers of join operations. In order to determine
a reasonable (not necessarily optimal) query plan in a reasonable amount
of time, <productname>PostgreSQL</productname> uses a <firstterm>Genetic
- Query Optimizer</firstterm> (see <xref linkend="geqo">) when the number of joins
- exceeds a threshold (see <xref linkend="guc-geqo-threshold">).
+ Query Optimizer</firstterm> (see <xref linkend="geqo"/>) when the number of joins
+ exceeds a threshold (see <xref linkend="guc-geqo-threshold"/>).
</para>
</note>
</para>
<para>
- If the query uses fewer than <xref linkend="guc-geqo-threshold">
+ If the query uses fewer than <xref linkend="guc-geqo-threshold"/>
relations, a near-exhaustive search is conducted to find the best
join sequence. The planner preferentially considers joins between any
two relations for which there exist a corresponding join clause in the
<para>
When <varname>geqo_threshold</varname> is exceeded, the join
sequences considered are determined by heuristics, as described
- in <xref linkend="geqo">. Otherwise the process is the same.
+ in <xref linkend="geqo"/>. Otherwise the process is the same.
</para>
<para>
<para>
(These kinds of array constants are actually only a special case of
the generic type constants discussed in <xref
- linkend="sql-syntax-constants-generic">. The constant is initially
+ linkend="sql-syntax-constants-generic"/>. The constant is initially
treated as a string and passed to the array input conversion
routine. An explicit type specification might be necessary.)
</para>
expressions; for instance, string literals are single quoted, instead of
double quoted as they would be in an array literal. The <literal>ARRAY</literal>
constructor syntax is discussed in more detail in
- <xref linkend="sql-syntax-array-constructors">.
+ <xref linkend="sql-syntax-array-constructors"/>.
</para>
</sect2>
However, this quickly becomes tedious for large arrays, and is not
helpful if the size of the array is unknown. An alternative method is
- described in <xref linkend="functions-comparisons">. The above
+ described in <xref linkend="functions-comparisons"/>. The above
query could be replaced by:
<programlisting>
WHERE pay_by_quarter[s] = 10000;
</programlisting>
- This function is described in <xref linkend="functions-srf-subscripts">.
+ This function is described in <xref linkend="functions-srf-subscripts"/>.
</para>
<para>
</programlisting>
This and other array operators are further described in
- <xref linkend="functions-array">. It can be accelerated by an appropriate
- index, as described in <xref linkend="indexes-types">.
+ <xref linkend="functions-array"/>. It can be accelerated by an appropriate
+ index, as described in <xref linkend="indexes-types"/>.
</para>
<para>
or backslashes disables this and allows the literal string value
<quote>NULL</quote> to be entered. Also, for backward compatibility with
pre-8.2 versions of <productname>PostgreSQL</productname>, the <xref
- linkend="guc-array-nulls"> configuration parameter can be turned
+ linkend="guc-array-nulls"/> configuration parameter can be turned
<literal>off</literal> to suppress recognition of <literal>NULL</literal> as a NULL.
</para>
with a data type whose input routine also treated backslashes specially,
<type>bytea</type> for example, we might need as many as eight backslashes
in the command to get one backslash into the stored array element.)
- Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting">) can be
+ Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting"/>) can be
used to avoid the need to double backslashes.
</para>
</note>
<tip>
<para>
The <literal>ARRAY</literal> constructor syntax (see
- <xref linkend="sql-syntax-array-constructors">) is often easier to work
+ <xref linkend="sql-syntax-array-constructors"/>) is often easier to work
with than the array-literal syntax when writing array values in SQL
commands. In <literal>ARRAY</literal>, individual element values are written the
same way they would be written when not members of an array.
<para>
In order to function, this module must be loaded via
- <xref linkend="guc-shared-preload-libraries"> in <filename>postgresql.conf</filename>.
+ <xref linkend="guc-shared-preload-libraries"/> in <filename>postgresql.conf</filename>.
</para>
<sect2>
<para>
The <filename>auto_explain</filename> module provides a means for
logging execution plans of slow statements automatically, without
- having to run <xref linkend="sql-explain">
+ having to run <xref linkend="sql-explain"/>
by hand. This is especially helpful for tracking down un-optimized queries
in large applications.
</para>
(You must be superuser to do that.) More typical usage is to preload
it into some or all sessions by including <literal>auto_explain</literal> in
- <xref linkend="guc-session-preload-libraries"> or
- <xref linkend="guc-shared-preload-libraries"> in
+ <xref linkend="guc-session-preload-libraries"/> or
+ <xref linkend="guc-shared-preload-libraries"/> in
<filename>postgresql.conf</filename>. Then you can track unexpectedly slow queries
no matter when they happen. Of course there is a price in overhead for
that.
commands that, when fed back to the server, will recreate the
database in the same state as it was at the time of the dump.
<productname>PostgreSQL</productname> provides the utility program
- <xref linkend="app-pgdump"> for this purpose. The basic usage of this
+ <xref linkend="app-pgdump"/> for this purpose. The basic usage of this
command is:
<synopsis>
pg_dump <replaceable class="parameter">dbname</replaceable> > <replaceable class="parameter">outfile</replaceable>
environment variable <envar>PGUSER</envar>. Remember that
<application>pg_dump</application> connections are subject to the normal
client authentication mechanisms (which are described in <xref
- linkend="client-authentication">).
+ linkend="client-authentication"/>).
</para>
<para>
class="parameter">dbname</replaceable></literal>). <application>psql</application>
supports options similar to <application>pg_dump</application> for specifying
the database server to connect to and the user name to use. See
- the <xref linkend="app-psql"> reference page for more information.
+ the <xref linkend="app-psql"/> reference page for more information.
Non-text file dumps are restored using the <xref
- linkend="app-pgrestore"> utility.
+ linkend="app-pgrestore"/> utility.
</para>
<para>
<para>
After restoring a backup, it is wise to run <xref
- linkend="sql-analyze"> on each
+ linkend="sql-analyze"/> on each
database so the query optimizer has useful statistics;
- see <xref linkend="vacuum-for-statistics">
- and <xref linkend="autovacuum"> for more information.
+ see <xref linkend="vacuum-for-statistics"/>
+ and <xref linkend="autovacuum"/> for more information.
For more advice on how to load large amounts of data
into <productname>PostgreSQL</productname> efficiently, refer to <xref
- linkend="populate">.
+ linkend="populate"/>.
</para>
</sect2>
and it does not dump information about roles or tablespaces
(because those are cluster-wide rather than per-database).
To support convenient dumping of the entire contents of a database
- cluster, the <xref linkend="app-pg-dumpall"> program is provided.
+ cluster, the <xref linkend="app-pg-dumpall"/> program is provided.
<application>pg_dumpall</application> backs up each database in a given
cluster, and also preserves cluster-wide data such as role and
tablespace definitions. The basic usage of this command is:
pg_restore -d <replaceable class="parameter">dbname</replaceable> <replaceable class="parameter">filename</replaceable>
</programlisting>
- See the <xref linkend="app-pgdump"> and <xref
- linkend="app-pgrestore"> reference pages for details.
+ See the <xref linkend="app-pgdump"/> and <xref
+ linkend="app-pgrestore"/> reference pages for details.
</para>
</formalpara>
<para>
An alternative backup strategy is to directly copy the files that
<productname>PostgreSQL</productname> uses to store the data in the database;
- <xref linkend="creating-cluster"> explains where these files
+ <xref linkend="creating-cluster"/> explains where these files
are located. You can use whatever method you prefer
for doing file system backups; for example:
an atomic snapshot of the state of the file system,
but also because of internal buffering within the server).
Information about stopping the server can be found in
- <xref linkend="server-shutdown">. Needless to say, you
+ <xref linkend="server-shutdown"/>. Needless to say, you
also need to shut down the server before restoring the data.
</para>
</listitem>
If simultaneous snapshots are not possible, one option is to shut down
the database server long enough to establish all the frozen snapshots.
Another option is to perform a continuous archiving base backup (<xref
- linkend="backup-base-backup">) because such backups are immune to file
+ linkend="backup-base-backup"/>) because such backups are immune to file
system changes during the backup. This requires enabling continuous
archiving just during the backup process; restore is done using
- continuous archive recovery (<xref linkend="backup-pitr-recovery">).
+ continuous archive recovery (<xref linkend="backup-pitr-recovery"/>).
</para>
<para>
</para>
<para>
- To enable WAL archiving, set the <xref linkend="guc-wal-level">
+ To enable WAL archiving, set the <xref linkend="guc-wal-level"/>
configuration parameter to <literal>replica</literal> or higher,
- <xref linkend="guc-archive-mode"> to <literal>on</literal>,
+ <xref linkend="guc-archive-mode"/> to <literal>on</literal>,
and specify the shell command to use in the <xref
- linkend="guc-archive-command"> configuration parameter. In practice
+ linkend="guc-archive-command"/> configuration parameter. In practice
these settings will always be placed in the
<filename>postgresql.conf</filename> file.
In <varname>archive_command</varname>,
than through SQL operations.
You might wish to keep the configuration files in a location that will
be backed up by your regular file system backup procedures. See
- <xref linkend="runtime-config-file-locations"> for how to relocate the
+ <xref linkend="runtime-config-file-locations"/> for how to relocate the
configuration files.
</para>
where it does so), there could be a long delay between the completion
of a transaction and its safe recording in archive storage. To put
a limit on how old unarchived data can be, you can set
- <xref linkend="guc-archive-timeout"> to force the server to switch
+ <xref linkend="guc-archive-timeout"/> to force the server to switch
to a new WAL segment file at least that often. Note that archived
files that are archived early due to a forced switch are still the same
length as completely full files. It is therefore unwise to set a very
<function>pg_switch_wal</function> if you want to ensure that a
just-finished transaction is archived as soon as possible. Other utility
functions related to WAL management are listed in <xref
- linkend="functions-admin-backup-table">.
+ linkend="functions-admin-backup-table"/>.
</para>
<para>
When <varname>wal_level</varname> is <literal>minimal</literal> some SQL commands
are optimized to avoid WAL logging, as described in <xref
- linkend="populate-pitr">. If archiving or streaming replication were
+ linkend="populate-pitr"/>. If archiving or streaming replication were
turned on during execution of one of these statements, WAL would not
contain enough information for archive recovery. (Crash recovery is
unaffected.) For this reason, <varname>wal_level</varname> can only be changed at
<para>
The easiest way to perform a base backup is to use the
- <xref linkend="app-pgbasebackup"> tool. It can create
+ <xref linkend="app-pgbasebackup"/> tool. It can create
a base backup either as regular files or as a tar archive. If more
- flexibility than <xref linkend="app-pgbasebackup"> can provide is
+ flexibility than <xref linkend="app-pgbasebackup"/> can provide is
required, you can also make a base backup using the low level API
- (see <xref linkend="backup-lowlevel-base-backup">).
+ (see <xref linkend="backup-lowlevel-base-backup"/>).
</para>
<para>
<para>
The backup history file is just a small text file. It contains the
- label string you gave to <xref linkend="app-pgbasebackup">, as well as
+ label string you gave to <xref linkend="app-pgbasebackup"/>, as well as
the starting and ending times and WAL segments of the backup.
If you used the label to identify the associated dump file,
then the archived history file is enough to tell you which dump file to
<para>
The procedure for making a base backup using the low level
APIs contains a few more steps than
- the <xref linkend="app-pgbasebackup"> method, but is relatively
+ the <xref linkend="app-pgbasebackup"/> method, but is relatively
simple. It is very important that these steps are executed in
sequence, and that the success of a step is verified before
proceeding to the next step.
A non-exclusive low level backup is one that allows other
concurrent backups to be running (both those started using
the same backup API and those started using
- <xref linkend="app-pgbasebackup">).
+ <xref linkend="app-pgbasebackup"/>).
</para>
<para>
<orderedlist>
required for the checkpoint will be spread out over a significant
period of time, by default half your inter-checkpoint interval
(see the configuration parameter
- <xref linkend="guc-checkpoint-completion-target">). This is
+ <xref linkend="guc-checkpoint-completion-target"/>). This is
usually what you want, because it minimizes the impact on query
processing. If you want to start the backup as soon as
possible, change the second parameter to <literal>true</literal>, which will
<application>pg_dumpall</application>). It is neither
necessary nor desirable to stop normal operation of the database
while you do this. See
- <xref linkend="backup-lowlevel-base-backup-data"> for things to
+ <xref linkend="backup-lowlevel-base-backup-data"/> for things to
consider during this backup.
</para>
</listitem>
required for the checkpoint will be spread out over a significant
period of time, by default half your inter-checkpoint interval
(see the configuration parameter
- <xref linkend="guc-checkpoint-completion-target">). This is
+ <xref linkend="guc-checkpoint-completion-target"/>). This is
usually what you want, because it minimizes the impact on query
processing. If you want to start the backup as soon as
possible, use:
<application>pg_dumpall</application>). It is neither
necessary nor desirable to stop normal operation of the database
while you do this. See
- <xref linkend="backup-lowlevel-base-backup-data"> for things to
+ <xref linkend="backup-lowlevel-base-backup-data"/> for things to
consider during this backup.
</para>
<para>
<filename>pg_snapshots/</filename>, <filename>pg_stat_tmp/</filename>,
and <filename>pg_subtrans/</filename> (but not the directories themselves) can be
omitted from the backup as they will be initialized on postmaster startup.
- If <xref linkend="guc-stats-temp-directory"> is set and is under the data
+ If <xref linkend="guc-stats-temp-directory"/> is set and is under the data
directory then the contents of that directory can also be omitted.
</para>
<listitem>
<para>
Create a recovery command file <filename>recovery.conf</filename> in the cluster
- data directory (see <xref linkend="recovery-config">). You might
+ data directory (see <xref linkend="recovery-config"/>). You might
also want to temporarily modify <filename>pg_hba.conf</filename> to prevent
ordinary users from connecting until you are sure the recovery was successful.
</para>
at the start of recovery for a file named something like
<filename>00000001.history</filename>. This is also normal and does not
indicate a problem in simple recovery situations; see
- <xref linkend="backup-timelines"> for discussion.
+ <xref linkend="backup-timelines"/> for discussion.
</para>
<para>
<para>
As with base backups, the easiest way to produce a standalone
- hot backup is to use the <xref linkend="app-pgbasebackup">
+ hot backup is to use the <xref linkend="app-pgbasebackup"/>
tool. If you include the <literal>-X</literal> parameter when calling
it, all the write-ahead log required to use the backup will be
included in the backup automatically, and no special action is
<tip>
<para>
When using an <varname>archive_command</varname> script, it's desirable
- to enable <xref linkend="guc-logging-collector">.
+ to enable <xref linkend="guc-logging-collector"/>.
Any messages written to <systemitem>stderr</systemitem> from the script will then
appear in the database server log, allowing complex configurations to
be diagnosed easily if they fail.
<itemizedlist>
<listitem>
<para>
- If a <xref linkend="sql-createdatabase">
+ If a <xref linkend="sql-createdatabase"/>
command is executed while a base backup is being taken, and then
the template database that the <command>CREATE DATABASE</command> copied
is modified while the base backup is still in progress, it is
<listitem>
<para>
- <xref linkend="sql-createtablespace">
+ <xref linkend="sql-createtablespace"/>
commands are WAL-logged with the literal absolute path, and will
therefore be replayed as tablespace creations with the same
absolute path. This might be undesirable if the log is being
your system hardware and software, the risk of partial writes might
be small enough to ignore, in which case you can significantly
reduce the total volume of archived logs by turning off page
- snapshots using the <xref linkend="guc-full-page-writes">
- parameter. (Read the notes and warnings in <xref linkend="wal">
+ snapshots using the <xref linkend="guc-full-page-writes"/>
+ parameter. (Read the notes and warnings in <xref linkend="wal"/>
before you do so.) Turning off page snapshots does not prevent
use of the logs for PITR operations. An area for future
development is to compress archived WAL data by removing
<para>
The maximum number of registered background workers is limited by
- <xref linkend="guc-max-worker-processes">.
+ <xref linkend="guc-max-worker-processes"/>.
</para>
</chapter>
<para>
The core <productname>PostgreSQL</productname> distribution
includes the <acronym>BRIN</acronym> operator classes shown in
- <xref linkend="brin-builtin-opclasses-table">.
+ <xref linkend="brin-builtin-opclasses-table"/>.
</para>
<para>
To write an operator class for a data type that implements a totally
ordered set, it is possible to use the minmax support procedures
alongside the corresponding operators, as shown in
- <xref linkend="brin-extensibility-minmax-table">.
+ <xref linkend="brin-extensibility-minmax-table"/>.
All operator class members (procedures and operators) are mandatory.
</para>
To write an operator class for a complex data type which has values
included within another type, it's possible to use the inclusion support
procedures alongside the corresponding operators, as shown
- in <xref linkend="brin-extensibility-inclusion-table">. It requires
+ in <xref linkend="brin-extensibility-inclusion-table"/>. It requires
only a single additional function, which can be written in any language.
More functions can be defined for additional functionality. All operators
are optional. Some operators require other operators, as shown as
additional data types to be supported by defining extra sets
of operators. Inclusion operator class operator strategies are dependent
on another operator strategy as shown in
- <xref linkend="brin-extensibility-inclusion-table">, or the same
+ <xref linkend="brin-extensibility-inclusion-table"/>, or the same
operator strategy as themselves. They require the dependency
operator to be defined with the <literal>STORAGE</literal> data type as the
left-hand-side argument and the other supported data type to be the
<title>Overview</title>
<para>
- <xref linkend="catalog-table"> lists the system catalogs.
+ <xref linkend="catalog-table"/> lists the system catalogs.
More detailed documentation of each catalog follows below.
</para>
<para>
New aggregate functions are registered with the <xref
- linkend="sql-createaggregate">
- command. See <xref linkend="xaggr"> for more information about
+ linkend="sql-createaggregate"/>
+ command. See <xref linkend="xaggr"/> for more information about
writing aggregate functions and the meaning of the transition
functions, etc.
</para>
relation access methods. There is one row for each access method supported
by the system.
Currently, only indexes have access methods. The requirements for index
- access methods are discussed in detail in <xref linkend="indexam">.
+ access methods are discussed in detail in <xref linkend="indexam"/>.
</para>
<table>
methods. That data is now only directly visible at the C code level.
However, <function>pg_index_column_has_property()</function> and related
functions have been added to allow SQL queries to inspect index access
- method properties; see <xref linkend="functions-info-catalog-table">.
+ method properties; see <xref linkend="functions-info-catalog-table"/>.
</para>
</note>
<entry>
<structfield>attstattarget</structfield> controls the level of detail
of statistics accumulated for this column by
- <xref linkend="sql-analyze">.
+ <xref linkend="sql-analyze"/>.
A zero value indicates that no statistics should be collected.
A negative value says to use the system default statistics target.
The exact meaning of positive values is data type-dependent.
</para>
<para>
- <xref linkend="user-manag"> contains detailed information about user and
+ <xref linkend="user-manag"/> contains detailed information about user and
privilege management.
</para>
<entry><type>bool</type></entry>
<entry>
Role bypasses every row level security policy, see
- <xref linkend="ddl-rowsecurity"> for more information.
+ <xref linkend="ddl-rowsecurity"/> for more information.
</entry>
</row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
The catalog <structname>pg_collation</structname> describes the
available collations, which are essentially mappings from an SQL
name to operating system locale categories.
- See <xref linkend="collation"> for more information.
+ See <xref linkend="collation"/> for more information.
</para>
<table>
<para>
The catalog <structname>pg_conversion</structname> describes
- encoding conversion procedures. See <xref linkend="sql-createconversion">
+ encoding conversion procedures. See <xref linkend="sql-createconversion"/>
for more information.
</para>
<para>
The catalog <structname>pg_database</structname> stores information about
the available databases. Databases are created with the <xref
- linkend="sql-createdatabase"> command.
- Consult <xref linkend="managing-databases"> for details about the meaning
+ linkend="sql-createdatabase"/> command.
+ Consult <xref linkend="managing-databases"/> for details about the meaning
of some of the parameters.
</para>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<para>
The catalog <structname>pg_description</structname> stores optional descriptions
(comments) for each database object. Descriptions can be manipulated
- with the <xref linkend="sql-comment"> command and viewed with
+ with the <xref linkend="sql-comment"/> command and viewed with
<application>psql</application>'s <literal>\d</literal> commands.
Descriptions of many built-in system objects are provided in the initial
contents of <structname>pg_description</structname>.
<para>
The catalog <structname>pg_event_trigger</structname> stores event triggers.
- See <xref linkend="event-triggers"> for more information.
+ See <xref linkend="event-triggers"/> for more information.
</para>
<table>
<entry><type>char</type></entry>
<entry></entry>
<entry>
- Controls in which <xref linkend="guc-session-replication-role"> modes
+ Controls in which <xref linkend="guc-session-replication-role"/> modes
the event trigger fires.
<literal>O</literal> = trigger fires in <quote>origin</quote> and <quote>local</quote> modes,
<literal>D</literal> = trigger is disabled,
<para>
The catalog <structname>pg_extension</structname> stores information
- about the installed extensions. See <xref linkend="extend-extensions">
+ about the installed extensions. See <xref linkend="extend-extensions"/>
for details about extensions.
</para>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<entry></entry>
<entry>
The initial access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<para>
The catalog <structname>pg_language</structname> registers
languages in which you can write functions or stored procedures.
- See <xref linkend="sql-createlanguage">
- and <xref linkend="xplang"> for more information about language handlers.
+ See <xref linkend="sql-createlanguage"/>
+ and <xref linkend="xplang"/> for more information about language handlers.
</para>
<table>
<entry>
This references a function that is responsible for executing
<quote>inline</quote> anonymous code blocks
- (<xref linkend="sql-do"> blocks).
+ (<xref linkend="sql-do"/> blocks).
Zero if inline blocks are not supported.
</entry>
</row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
</para>
<para>
- Operator classes are described at length in <xref linkend="xindex">.
+ Operator classes are described at length in <xref linkend="xindex"/>.
</para>
<table>
<para>
The catalog <structname>pg_operator</structname> stores information about operators.
- See <xref linkend="sql-createoperator">
- and <xref linkend="xoper"> for more information.
+ See <xref linkend="sql-createoperator"/>
+ and <xref linkend="xoper"/> for more information.
</para>
<table>
</para>
<para>
- Operator families are described at length in <xref linkend="xindex">.
+ Operator families are described at length in <xref linkend="xindex"/>.
</para>
<table>
<para>
The catalog <structname>pg_proc</structname> stores information about functions (or procedures).
- See <xref linkend="sql-createfunction">
- and <xref linkend="xfunc"> for more information.
+ See <xref linkend="sql-createfunction"/>
+ and <xref linkend="xfunc"/> for more information.
</para>
<para>
<entry><type>float4</type></entry>
<entry></entry>
<entry>Estimated execution cost (in units of
- <xref linkend="guc-cpu-operator-cost">); if <structfield>proretset</structfield>,
+ <xref linkend="guc-cpu-operator-cost"/>); if <structfield>proretset</structfield>,
this is cost per row returned</entry>
</row>
<entry><type>regproc</type></entry>
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
<entry>Calls to this function can be simplified by this other function
- (see <xref linkend="xfunc-transform-functions">)</entry>
+ (see <xref linkend="xfunc-transform-functions"/>)</entry>
</row>
<row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<para>
The catalog <structname>pg_publication</structname> contains all
publications created in the database. For more on publications see
- <xref linkend="logical-replication-publication">.
+ <xref linkend="logical-replication-publication"/>.
</para>
<table>
<para>
The catalog <structname>pg_publication_rel</structname> contains the
mapping between relations and publications in the database. This is a
- many-to-many mapping. See also <xref linkend="view-pg-publication-tables">
+ many-to-many mapping. See also <xref linkend="view-pg-publication-tables"/>
for a more user-friendly view of this information.
</para>
<para>
The <structname>pg_replication_origin</structname> catalog contains
all replication origins created. For more on replication origins
- see <xref linkend="replication-origins">.
+ see <xref linkend="replication-origins"/>.
</para>
<table>
<entry><type>char</type></entry>
<entry></entry>
<entry>
- Controls in which <xref linkend="guc-session-replication-role"> modes
+ Controls in which <xref linkend="guc-session-replication-role"/> modes
the rule fires.
<literal>O</literal> = rule fires in <quote>origin</quote> and <quote>local</quote> modes,
<literal>D</literal> = rule is disabled,
<para>
The catalog <structname>pg_seclabel</structname> stores security
labels on database objects. Security labels can be manipulated
- with the <xref linkend="sql-security-label"> command. For an easier
- way to view security labels, see <xref linkend="view-pg-seclabels">.
+ with the <xref linkend="sql-security-label"/> command. For an easier
+ way to view security labels, see <xref linkend="view-pg-seclabels"/>.
</para>
<para>
<para>
The catalog <structname>pg_shdescription</structname> stores optional
descriptions (comments) for shared database objects. Descriptions can be
- manipulated with the <xref linkend="sql-comment"> command and viewed with
+ manipulated with the <xref linkend="sql-comment"/> command and viewed with
<application>psql</application>'s <literal>\d</literal> commands.
</para>
<para>
The catalog <structname>pg_shseclabel</structname> stores security
labels on shared database objects. Security labels can be manipulated
- with the <xref linkend="sql-security-label"> command. For an easier
- way to view security labels, see <xref linkend="view-pg-seclabels">.
+ with the <xref linkend="sql-security-label"/> command. For an easier
+ way to view security labels, see <xref linkend="view-pg-seclabels"/>.
</para>
<para>
<para>
The catalog <structname>pg_statistic</structname> stores
statistical data about the contents of the database. Entries are
- created by <xref linkend="sql-analyze">
+ created by <xref linkend="sql-analyze"/>
and subsequently used by the query planner. Note that all the
statistical data is inherently approximate, even assuming that it
is up-to-date.
The catalog <structname>pg_statistic_ext</structname>
holds extended planner statistics.
Each row in this catalog corresponds to a <firstterm>statistics object</firstterm>
- created with <xref linkend="sql-createstatistics">.
+ created with <xref linkend="sql-createstatistics"/>.
</para>
<table>
<para>
The catalog <structname>pg_subscription</structname> contains all existing
logical replication subscriptions. For more information about logical
- replication see <xref linkend="logical-replication">.
+ replication see <xref linkend="logical-replication"/>.
</para>
<para>
<entry></entry>
<entry>Array of subscribed publication names. These reference the
publications on the publisher server. For more on publications
- see <xref linkend="logical-replication-publication">.
+ see <xref linkend="logical-replication-publication"/>.
</entry>
</row>
</tbody>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
<para>
The catalog <structname>pg_transform</structname> stores information about
transforms, which are a mechanism to adapt data types to procedural
- languages. See <xref linkend="sql-createtransform"> for more information.
+ languages. See <xref linkend="sql-createtransform"/> for more information.
</para>
<table>
<para>
The catalog <structname>pg_trigger</structname> stores triggers on tables
and views.
- See <xref linkend="sql-createtrigger">
+ See <xref linkend="sql-createtrigger"/>
for more information.
</para>
<entry><type>char</type></entry>
<entry></entry>
<entry>
- Controls in which <xref linkend="guc-session-replication-role"> modes
+ Controls in which <xref linkend="guc-session-replication-role"/> modes
the trigger fires.
<literal>O</literal> = trigger fires in <quote>origin</quote> and <quote>local</quote> modes,
<literal>D</literal> = trigger is disabled,
<para>
<productname>PostgreSQL</productname>'s text search features are
- described at length in <xref linkend="textsearch">.
+ described at length in <xref linkend="textsearch"/>.
</para>
<table>
<para>
<productname>PostgreSQL</productname>'s text search features are
- described at length in <xref linkend="textsearch">.
+ described at length in <xref linkend="textsearch"/>.
</para>
<table>
<para>
<productname>PostgreSQL</productname>'s text search features are
- described at length in <xref linkend="textsearch">.
+ described at length in <xref linkend="textsearch"/>.
</para>
<table>
<para>
<productname>PostgreSQL</productname>'s text search features are
- described at length in <xref linkend="textsearch">.
+ described at length in <xref linkend="textsearch"/>.
</para>
<table>
<para>
<productname>PostgreSQL</productname>'s text search features are
- described at length in <xref linkend="textsearch">.
+ described at length in <xref linkend="textsearch"/>.
</para>
<table>
<para>
The catalog <structname>pg_type</structname> stores information about data
types. Base types and enum types (scalar types) are created with
- <xref linkend="sql-createtype">, and
+ <xref linkend="sql-createtype"/>, and
domains with
- <xref linkend="sql-createdomain">.
+ <xref linkend="sql-createdomain"/>.
A composite type is automatically created for each table in the database, to
represent the row structure of the table. It is also possible to create
composite types with <command>CREATE TYPE AS</command>.
<structfield>typcategory</structfield> is an arbitrary classification
of data types that is used by the parser to determine which implicit
casts should be <quote>preferred</quote>.
- See <xref linkend="catalog-typcategory-table">.
+ See <xref linkend="catalog-typcategory-table"/>.
</entry>
</row>
<entry></entry>
<entry>
Access privileges; see
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
for details
</entry>
</row>
</table>
<para>
- <xref linkend="catalog-typcategory-table"> lists the system-defined values
+ <xref linkend="catalog-typcategory-table"/> lists the system-defined values
of <structfield>typcategory</structfield>. Any future additions to this list will
also be upper-case ASCII letters. All other ASCII characters are reserved
for user-defined categories.
</para>
<para>
- The information schema (<xref linkend="information-schema">) provides
+ The information schema (<xref linkend="information-schema"/>) provides
an alternative set of views which overlap the functionality of the system
views. Since the information schema is SQL-standard whereas the views
described here are <productname>PostgreSQL</productname>-specific,
</para>
<para>
- <xref linkend="view-table"> lists the system views described here.
+ <xref linkend="view-table"/> lists the system views described here.
More detailed documentation of each view follows below.
There are some additional views that provide access to the results of
the statistics collector; they are described in <xref
- linkend="monitoring-stats-views-table">.
+ linkend="monitoring-stats-views-table"/>.
</para>
<para>
be used by software packages that want to interface to
<productname>PostgreSQL</productname> to facilitate finding the required header
files and libraries. It provides the same basic information as the
- <xref linkend="app-pgconfig"> <productname>PostgreSQL</productname> client
+ <xref linkend="app-pgconfig"/> <productname>PostgreSQL</productname> client
application.
</para>
<itemizedlist>
<listitem>
<para>
- via the <xref linkend="sql-declare">
+ via the <xref linkend="sql-declare"/>
statement in SQL
</para>
</listitem>
<listitem>
<para>
via the Bind message in the frontend/backend protocol, as
- described in <xref linkend="protocol-flow-ext-query">
+ described in <xref linkend="protocol-flow-ext-query"/>
</para>
</listitem>
<listitem>
<para>
via the Server Programming Interface (SPI), as described in
- <xref linkend="spi-interface">
+ <xref linkend="spi-interface"/>
</para>
</listitem>
</itemizedlist>
</para>
<para>
- See <xref linkend="config-setting"> for more information about the various
+ See <xref linkend="config-setting"/> for more information about the various
ways to change run-time parameters.
</para>
</para>
<para>
- See <xref linkend="client-authentication"> for more information about
+ See <xref linkend="client-authentication"/> for more information about
client authentication configuration.
</para>
</sect1>
<para>
The view <structname>pg_locks</structname> provides access to
information about the locks held by active processes within the
- database server. See <xref linkend="mvcc"> for more discussion
+ database server. See <xref linkend="mvcc"/> for more discussion
of locking.
</para>
<entry><type>text</type></entry>
<entry></entry>
<entry>Name of the lock mode held or desired by this process (see <xref
- linkend="locking-tables"> and <xref linkend="xact-serializable">)</entry>
+ linkend="locking-tables"/> and <xref linkend="xact-serializable"/>)</entry>
</row>
<row>
<entry><structfield>granted</structfield></entry>
queues, nor information about which processes are parallel workers running
on behalf of which other client sessions. It is better to use
the <function>pg_blocking_pids()</function> function
- (see <xref linkend="functions-info-session-table">) to identify which
+ (see <xref linkend="functions-info-session-table"/>) to identify which
process(es) a waiting process is blocked behind.
</para>
<para>
The <structname>pg_prepared_statements</structname> view displays
all the prepared statements that are available in the current
- session. See <xref linkend="sql-prepare"> for more information about prepared
+ session. See <xref linkend="sql-prepare"/> for more information about prepared
statements.
</para>
<structname>pg_prepared_statements</structname> contains one row
for each prepared statement. Rows are added to the view when a new
prepared statement is created and removed when a prepared statement
- is released (for example, via the <xref linkend="sql-deallocate"> command).
+ is released (for example, via the <xref linkend="sql-deallocate"/> command).
</para>
<table>
<para>
The view <structname>pg_prepared_xacts</structname> displays
information about transactions that are currently prepared for two-phase
- commit (see <xref linkend="sql-prepare-transaction"> for details).
+ commit (see <xref linkend="sql-prepare-transaction"/> for details).
</para>
<para>
The <structname>pg_replication_origin_status</structname> view
contains information about how far replay for a certain origin has
progressed. For more on replication origins
- see <xref linkend="replication-origins">.
+ see <xref linkend="replication-origins"/>.
</para>
<table>
<para>
For more on replication slots,
- see <xref linkend="streaming-replication-slots"> and <xref linkend="logicaldecoding">.
+ see <xref linkend="streaming-replication-slots"/> and <xref linkend="logicaldecoding"/>.
</para>
<table>
<entry></entry>
<entry>
Role bypasses every row level security policy, see
- <xref linkend="ddl-rowsecurity"> for more information.
+ <xref linkend="ddl-rowsecurity"/> for more information.
</entry>
</row>
<para>
The view <structname>pg_settings</structname> provides access to
run-time parameters of the server. It is essentially an alternative
- interface to the <xref linkend="sql-show">
- and <xref linkend="sql-set"> commands.
+ interface to the <xref linkend="sql-show"/>
+ and <xref linkend="sql-set"/> commands.
It also provides access to some facts about each parameter that are
not directly available from <command>SHOW</command>, such as minimum and
maximum values.
</variablelist>
<para>
- See <xref linkend="config-setting"> for more information about the various
+ See <xref linkend="config-setting"/> for more information about the various
ways to change these parameters.
</para>
The <structname>pg_settings</structname> view cannot be inserted into or
deleted from, but it can be updated. An <command>UPDATE</command> applied
to a row of <structname>pg_settings</structname> is equivalent to executing
- the <xref linkend="sql-set"> command on that named
+ the <xref linkend="sql-set"/> command on that named
parameter. The change only affects the value used by the current
session. If an <command>UPDATE</command> is issued within a transaction
that is later aborted, the effects of the <command>UPDATE</command> command
<entry></entry>
<entry>
User bypasses every row level security policy, see
- <xref linkend="ddl-rowsecurity"> for more information.
+ <xref linkend="ddl-rowsecurity"/> for more information.
</entry>
</row>
The maximum number of entries in the array fields can be controlled on a
column-by-column basis using the <command>ALTER TABLE SET STATISTICS</command>
command, or globally by setting the
- <xref linkend="guc-default-statistics-target"> run-time parameter.
+ <xref linkend="guc-default-statistics-target"/> run-time parameter.
</para>
</sect1>
The view <structname>pg_timezone_abbrevs</structname> provides a list
of time zone abbreviations that are currently recognized by the datetime
input routines. The contents of this view change when the
- <xref linkend="guc-timezone-abbreviations"> run-time parameter is modified.
+ <xref linkend="guc-timezone-abbreviations"/> run-time parameter is modified.
</para>
<table>
<para>
While most timezone abbreviations represent fixed offsets from UTC,
there are some that have historically varied in value
- (see <xref linkend="datetime-config-files"> for more information).
+ (see <xref linkend="datetime-config-files"/> for more information).
In such cases this view presents their current meaning.
</para>
<entry><type>bool</type></entry>
<entry>
User bypasses every row level security policy, see
- <xref linkend="ddl-rowsecurity"> for more information.
+ <xref linkend="ddl-rowsecurity"/> for more information.
</entry>
</row>
Using the locale features of the operating system to provide
locale-specific collation order, number formatting, translated
messages, and other aspects.
- This is covered in <xref linkend="locale"> and
- <xref linkend="collation">.
+ This is covered in <xref linkend="locale"/> and
+ <xref linkend="collation"/>.
</para>
</listitem>
Providing a number of different character sets to support storing text
in all kinds of languages, and providing character set translation
between client and server.
- This is covered in <xref linkend="multibyte">.
+ This is covered in <xref linkend="multibyte"/>.
</para>
</listitem>
</itemizedlist>
the sort order of indexes, so they must be kept fixed, or indexes on
text columns would become corrupt.
(But you can alleviate this restriction using collations, as discussed
- in <xref linkend="collation">.)
+ in <xref linkend="collation"/>.)
The default values for these
categories are determined when <command>initdb</command> is run, and
those values are used when new databases are created, unless
The other locale categories can be changed whenever desired
by setting the server configuration parameters
that have the same name as the locale categories (see <xref
- linkend="runtime-config-client-format"> for details). The values
+ linkend="runtime-config-client-format"/> for details). The values
that are chosen by <command>initdb</command> are actually only written
into the configuration file <filename>postgresql.conf</filename> to
serve as defaults when the server is started. If you remove these
with <literal>LIKE</literal> clauses under a non-C locale, several custom
operator classes exist. These allow the creation of an index that
performs a strict character-by-character comparison, ignoring
- locale comparison rules. Refer to <xref linkend="indexes-opclass">
+ locale comparison rules. Refer to <xref linkend="indexes-opclass"/>
for more information. Another approach is to create indexes using
the <literal>C</literal> collation, as discussed in
- <xref linkend="collation">.
+ <xref linkend="collation"/>.
</para>
</sect2>
<productname>PostgreSQL</productname> speak their preferred language well.
If messages in your language are currently not available or not fully
translated, your assistance would be appreciated. If you want to
- help, refer to <xref linkend="nls"> or write to the developers'
+ help, refer to <xref linkend="nls"/> or write to the developers'
mailing list.
</para>
</sect2>
these under one concept than to create another infrastructure for
setting <symbol>LC_CTYPE</symbol> per expression.) Also,
a <literal>libc</literal> collation
- is tied to a character set encoding (see <xref linkend="multibyte">).
+ is tied to a character set encoding (see <xref linkend="multibyte"/>).
The same collation name may exist for different encodings.
</para>
for <symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol>, or if new
locales are installed in the operating system after the database system
was initialized, then a new collation may be created using
- the <xref linkend="sql-createcollation"> command.
+ the <xref linkend="sql-createcollation"/> command.
New operating system locales can also be imported en masse using
the <link linkend="functions-admin-collation"><function>pg_import_system_collations()</function></link> function.
</para>
<para>
If the standard and predefined collations are not sufficient, users can
create their own collation objects using the SQL
- command <xref linkend="sql-createcollation">.
+ command <xref linkend="sql-createcollation"/>.
</para>
<para>
defined in the operating system when the database instance is
initialized, it is not often necessary to manually create new ones.
Reasons might be if a different naming system is desired (in which case
- see also <xref linkend="collation-copy">) or if the operating system has
+ see also <xref linkend="collation-copy"/>) or if the operating system has
been upgraded to provide new locale definitions (in which case see
also <link linkend="functions-admin-collation"><function>pg_import_system_collations()</function></link>).
</para>
<title>Copying Collations</title>
<para>
- The command <xref linkend="sql-createcollation"> can also be used to
+ The command <xref linkend="sql-createcollation"/> can also be used to
create a new collation from an existing collation, which can be useful to
be able to use operating-system-independent collation names in
applications, create compatibility names, or use an ICU-provided collation
<title>Supported Character Sets</title>
<para>
- <xref linkend="charset-table"> shows the character sets available
+ <xref linkend="charset-table"/> shows the character sets available
for use in <productname>PostgreSQL</productname>.
</para>
database. When copying any other database, the encoding and locale
settings cannot be changed from those of the source database, because
that might result in corrupt data. For more information see
- <xref linkend="manage-ag-templatedbs">.
+ <xref linkend="manage-ag-templatedbs"/>.
</para>
<para>
character set combinations. The conversion information is stored in the
<literal>pg_conversion</literal> system catalog. <productname>PostgreSQL</productname>
comes with some predefined conversions, as shown in <xref
- linkend="multibyte-translation-table">. You can create a new
+ linkend="multibyte-translation-table"/>. You can create a new
conversion using the SQL command <command>CREATE CONVERSION</command>.
</para>
<listitem>
<para>
- <application>libpq</application> (<xref linkend="libpq-control">) has functions to control the client encoding.
+ <application>libpq</application> (<xref linkend="libpq-control"/>) has functions to control the client encoding.
</para>
</listitem>
<listitem>
<para>
Using the configuration variable <xref
- linkend="guc-client-encoding">. If the
+ linkend="guc-client-encoding"/>. If the
<varname>client_encoding</varname> variable is set, that client
encoding is automatically selected when a connection to the
server is made. (This can subsequently be overridden using any
wants to connect as, much the same way one logs into a Unix computer
as a particular user. Within the SQL environment the active database
user name determines access privileges to database objects — see
- <xref linkend="user-manag"> for more information. Therefore, it is
+ <xref linkend="user-manag"/> for more information. Therefore, it is
essential to restrict which database users can connect.
</para>
<note>
<para>
- As explained in <xref linkend="user-manag">,
+ As explained in <xref linkend="user-manag"/>,
<productname>PostgreSQL</productname> actually does privilege
management in terms of <quote>roles</quote>. In this chapter, we
consistently use <firstterm>database user</firstterm> to mean <quote>role with the
<filename>pg_hba.conf</filename> file is installed when the data
directory is initialized by <command>initdb</command>. It is
possible to place the authentication configuration file elsewhere,
- however; see the <xref linkend="guc-hba-file"> configuration parameter.
+ however; see the <xref linkend="guc-hba-file"/> configuration parameter.
</para>
<para>
<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,
+ <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>
To make use of this option the server must be built with
<acronym>SSL</acronym> support. Furthermore,
<acronym>SSL</acronym> must be enabled
- by setting the <xref linkend="guc-ssl"> configuration parameter (see
- <xref linkend="ssl-tcp"> for more information).
+ by setting the <xref linkend="guc-ssl"/> configuration parameter (see
+ <xref linkend="ssl-tcp"/> for more information).
Otherwise, the <literal>hostssl</literal> record is ignored except for
logging a warning that it cannot match any connections.
</para>
<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">.
+ are in <xref linkend="auth-methods"/>.
<variablelist>
<varlistentry>
<productname>PostgreSQL</productname> database server to login as
any <productname>PostgreSQL</productname> user they wish,
without the need for a password or any other authentication. See <xref
- linkend="auth-trust"> for details.
+ linkend="auth-trust"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Perform SCRAM-SHA-256 authentication to verify the user's
- password. See <xref linkend="auth-password"> for details.
+ password. See <xref linkend="auth-password"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Perform SCRAM-SHA-256 or MD5 authentication to verify the
- user's password. See <xref linkend="auth-password">
+ user's password. See <xref linkend="auth-password"/>
for details.
</para>
</listitem>
authentication.
Since the password is sent in clear text over the
network, this should not be used on untrusted networks.
- See <xref linkend="auth-password"> for details.
+ See <xref linkend="auth-password"/> for details.
</para>
</listitem>
</varlistentry>
<para>
Use GSSAPI to authenticate the user. This is only
available for TCP/IP connections. See <xref
- linkend="gssapi-auth"> for details.
+ linkend="gssapi-auth"/> for details.
</para>
</listitem>
</varlistentry>
<para>
Use SSPI to authenticate the user. This is only
available on Windows. See <xref
- linkend="sspi-auth"> for details.
+ linkend="sspi-auth"/> for details.
</para>
</listitem>
</varlistentry>
Ident authentication can only be used on TCP/IP
connections. When specified for local connections, peer
authentication will be used instead.
- See <xref linkend="auth-ident"> for details.
+ See <xref linkend="auth-ident"/> for details.
</para>
</listitem>
</varlistentry>
Obtain the client's operating system user name from the operating
system and check if it matches the requested database user name.
This is only available for local connections.
- See <xref linkend="auth-peer"> for details.
+ See <xref linkend="auth-peer"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Authenticate using an <acronym>LDAP</acronym> server. See <xref
- linkend="auth-ldap"> for details.
+ linkend="auth-ldap"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Authenticate using a RADIUS server. See <xref
- linkend="auth-radius"> for details.
+ linkend="auth-radius"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Authenticate using SSL client certificates. See
- <xref linkend="auth-cert"> for details.
+ <xref linkend="auth-cert"/> for details.
</para>
</listitem>
</varlistentry>
<para>
Authenticate using the Pluggable Authentication Modules
(PAM) service provided by the operating system. See <xref
- linkend="auth-pam"> for details.
+ linkend="auth-pam"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Authenticate using the BSD Authentication service provided by the
- operating system. See <xref linkend="auth-bsd"> for details.
+ operating system. See <xref linkend="auth-bsd"/> for details.
</para>
</listitem>
</varlistentry>
<para>
Some examples of <filename>pg_hba.conf</filename> entries are shown in
- <xref linkend="example-pg-hba.conf">. See the next section for details on the
+ <xref linkend="example-pg-hba.conf"/>. See the next section for details on the
different authentication methods.
</para>
<filename>pg_ident.conf</filename><indexterm><primary>pg_ident.conf</primary></indexterm>
and is stored in the
cluster's data directory. (It is possible to place the map file
- elsewhere, however; see the <xref linkend="guc-ident-file">
+ elsewhere, however; see the <xref linkend="guc-ident-file"/>
configuration parameter.)
The ident map file contains lines of the general form:
<synopsis>
<para>
If the <replaceable>system-username</replaceable> field starts with a slash (<literal>/</literal>),
the remainder of the field is treated as a regular expression.
- (See <xref linkend="posix-syntax-details"> for details of
+ (See <xref linkend="posix-syntax-details"/> for details of
<productname>PostgreSQL</productname>'s regular expression syntax.) The regular
expression can include a single capture, or parenthesized subexpression,
which can then be referenced in the <replaceable>database-username</replaceable>
<para>
A <filename>pg_ident.conf</filename> file that could be used in
conjunction with the <filename>pg_hba.conf</filename> file in <xref
- linkend="example-pg-hba.conf"> is shown in <xref
- linkend="example-pg-ident.conf">. In this example, anyone
+ linkend="example-pg-hba.conf"/> is shown in <xref
+ linkend="example-pg-ident.conf"/>. In this example, anyone
logged in to a machine on the 192.168 network that does not have the
operating system user name <literal>bryanh</literal>, <literal>ann</literal>, or
<literal>robert</literal> would not be granted access. Unix user
Unix-domain socket file using file-system permissions. To do this, set the
<varname>unix_socket_permissions</varname> (and possibly
<varname>unix_socket_group</varname>) configuration parameters as
- described in <xref linkend="runtime-config-connection">. Or you
+ described in <xref linkend="runtime-config-connection"/>. Or you
could set the <varname>unix_socket_directories</varname>
configuration parameter to place the socket file in a suitably
restricted directory.
<para>
The <literal>md5</literal> method cannot be used with
- the <xref linkend="guc-db-user-namespace"> feature.
+ the <xref linkend="guc-db-user-namespace"/> feature.
</para>
<para>
separate from operating system user passwords. The password for
each database user is stored in the <literal>pg_authid</literal> system
catalog. Passwords can be managed with the SQL commands
- <xref linkend="sql-createrole"> and
- <xref linkend="sql-alterrole">,
+ <xref linkend="sql-createrole"/> and
+ <xref linkend="sql-alterrole"/>,
e.g., <userinput>CREATE ROLE foo WITH LOGIN PASSWORD 'secret'</userinput>,
or the <application>psql</application>
command <literal>\password</literal>.
The availability of the different password-based authentication methods
depends on how a user's password on the server is encrypted (or hashed,
more accurately). This is controlled by the configuration
- parameter <xref linkend="guc-password-encryption"> at the time the
+ parameter <xref linkend="guc-password-encryption"/> at the time the
password is set. If a password was encrypted using
the <literal>scram-sha-256</literal> setting, then it can be used for the
authentication methods <literal>scram-sha-256</literal>
<para>
GSSAPI support has to be enabled when <productname>PostgreSQL</productname> is built;
- see <xref linkend="installation"> for more information.
+ see <xref linkend="installation"/> for more information.
</para>
<para>
The PostgreSQL server will accept any principal that is included in the keytab used by
the server, but care needs to be taken to specify the correct principal details when
making the connection from the client using the <literal>krbsrvname</literal> connection parameter. (See
- also <xref linkend="libpq-paramkeywords">.) The installation default can be
+ also <xref linkend="libpq-paramkeywords"/>.) The installation default can be
changed from the default <literal>postgres</literal> at build time using
<literal>./configure --with-krb-srvnam=</literal><replaceable>whatever</replaceable>.
In most environments,
<para>
Make sure that your server keytab file is readable (and preferably
only readable, not writable) by the <productname>PostgreSQL</productname>
- server account. (See also <xref linkend="postgres-user">.) The location
+ server account. (See also <xref linkend="postgres-user"/>.) The location
of the key file is specified by the <xref
- linkend="guc-krb-server-keyfile"> configuration
+ linkend="guc-krb-server-keyfile"/> configuration
parameter. The default is
<filename>/usr/local/pgsql/etc/krb5.keytab</filename> (or whatever
directory was specified as <varname>sysconfdir</varname> at build time).
database user name <literal>fred</literal>, principal
<literal>fred@EXAMPLE.COM</literal> would be able to connect. To also allow
principal <literal>fred/users.example.com@EXAMPLE.COM</literal>, use a user name
- map, as described in <xref linkend="auth-username-maps">.
+ map, as described in <xref linkend="auth-username-maps"/>.
</para>
<para>
<para>
If set to 0, the realm name from the authenticated user principal is
stripped off before being passed through the user name mapping
- (<xref linkend="auth-username-maps">). This is discouraged and is
+ (<xref linkend="auth-username-maps"/>). This is discouraged and is
primarily available for backwards compatibility, as it is not secure
in multi-realm environments unless <literal>krb_realm</literal> is
also used. It is recommended to
<listitem>
<para>
Allows for mapping between system and database user names. See
- <xref linkend="auth-username-maps"> for details. For a GSSAPI/Kerberos
+ <xref linkend="auth-username-maps"/> for details. For a GSSAPI/Kerberos
principal, such as <literal>username@EXAMPLE.COM</literal> (or, less
commonly, <literal>username/hostbased@EXAMPLE.COM</literal>), the
user name used for mapping is
<para>
When using <productname>Kerberos</productname> authentication,
<productname>SSPI</productname> works the same way
- <productname>GSSAPI</productname> does; see <xref linkend="gssapi-auth">
+ <productname>GSSAPI</productname> does; see <xref linkend="gssapi-auth"/>
for details.
</para>
<para>
If set to 0, the realm name from the authenticated user principal is
stripped off before being passed through the user name mapping
- (<xref linkend="auth-username-maps">). This is discouraged and is
+ (<xref linkend="auth-username-maps"/>). This is discouraged and is
primarily available for backwards compatibility, as it is not secure
in multi-realm environments unless <literal>krb_realm</literal> is
also used. It is recommended to
<listitem>
<para>
Allows for mapping between system and database user names. See
- <xref linkend="auth-username-maps"> for details. For a SSPI/Kerberos
+ <xref linkend="auth-username-maps"/> for details. For a SSPI/Kerberos
principal, such as <literal>username@EXAMPLE.COM</literal> (or, less
commonly, <literal>username/hostbased@EXAMPLE.COM</literal>), the
user name used for mapping is
<note>
<para>
When ident is specified for a local (non-TCP/IP) connection,
- peer authentication (see <xref linkend="auth-peer">) will be
+ peer authentication (see <xref linkend="auth-peer"/>) will be
used instead.
</para>
</note>
<listitem>
<para>
Allows for mapping between system and database user names. See
- <xref linkend="auth-username-maps"> for details.
+ <xref linkend="auth-username-maps"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Allows for mapping between system and database user names. See
- <xref linkend="auth-username-maps"> for details.
+ <xref linkend="auth-username-maps"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Allows for mapping between system and database user names. See
- <xref linkend="auth-username-maps"> for details.
+ <xref linkend="auth-username-maps"/> for details.
</para>
</listitem>
</varlistentry>
<filename>postgresql.auto.conf</filename><indexterm><primary>postgresql.auto.conf</primary></indexterm>,
which has the same format as <filename>postgresql.conf</filename> but should
never be edited manually. This file holds settings provided through
- the <xref linkend="sql-altersystem"> command. This file is automatically
+ the <xref linkend="sql-altersystem"/> command. This file is automatically
read whenever <filename>postgresql.conf</filename> is, and its settings take
effect in the same way. Settings in <filename>postgresql.auto.conf</filename>
override those in <filename>postgresql.conf</filename>.
<para>
<productname>PostgreSQL</productname> provides three SQL
commands to establish configuration defaults.
- The already-mentioned <xref linkend="sql-altersystem"> command
+ The already-mentioned <xref linkend="sql-altersystem"/> command
provides a SQL-accessible means of changing global defaults; it is
functionally equivalent to editing <filename>postgresql.conf</filename>.
In addition, there are two commands that allow setting of defaults
<itemizedlist>
<listitem>
<para>
- The <xref linkend="sql-alterdatabase"> command allows global
+ The <xref linkend="sql-alterdatabase"/> command allows global
settings to be overridden on a per-database basis.
</para>
</listitem>
<listitem>
<para>
- The <xref linkend="sql-alterrole"> command allows both global and
+ The <xref linkend="sql-alterrole"/> command allows both global and
per-database settings to be overridden with user-specific values.
</para>
</listitem>
<itemizedlist>
<listitem>
<para>
- The <xref linkend="sql-show"> command allows inspection of the
+ The <xref linkend="sql-show"/> command allows inspection of the
current value of all parameters. The corresponding function is
<function>current_setting(setting_name text)</function>.
</para>
<listitem>
<para>
- The <xref linkend="sql-set"> command allows modification of the
+ The <xref linkend="sql-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.
The corresponding function is
<listitem>
<para>
- Using <xref linkend="sql-update"> on this view, specifically
+ Using <xref linkend="sql-update"/> on this view, specifically
updating the <structname>setting</structname> column, is the equivalent
of issuing <command>SET</command> commands. For example, the equivalent of
<programlisting>
already mentioned, <productname>PostgreSQL</productname> uses
two other manually-edited configuration files, which control
client authentication (their use is discussed in <xref
- linkend="client-authentication">). By default, all three
+ linkend="client-authentication"/>). By default, all three
configuration files are stored in the database cluster's data
directory. The parameters described in this section allow the
configuration files to be placed elsewhere. (Doing so can ease
Specifies the configuration file for user name mapping
(customarily called <filename>pg_ident.conf</filename>).
This parameter can only be set at server start.
- See also <xref linkend="auth-username-maps">.
+ See also <xref linkend="auth-username-maps"/>.
</para>
</listitem>
</varlistentry>
The default value is <systemitem class="systemname">localhost</systemitem>,
which allows only local TCP/IP <quote>loopback</quote> connections to be
made. While client authentication (<xref
- linkend="client-authentication">) allows fine-grained control
+ linkend="client-authentication"/>) allows fine-grained control
over who can access the server, <varname>listen_addresses</varname>
controls which interfaces accept connection attempts, which
can help prevent repeated malicious connection requests on
<para>
Determines the number of connection <quote>slots</quote> that
are reserved for connections by <productname>PostgreSQL</productname>
- superusers. At most <xref linkend="guc-max-connections">
+ superusers. At most <xref linkend="guc-max-connections"/>
connections can ever be active simultaneously. Whenever the
number of active concurrent connections is at least
<varname>max_connections</varname> minus
<para>
This access control mechanism is independent of the one
- described in <xref linkend="client-authentication">.
+ described in <xref linkend="client-authentication"/>.
</para>
<para>
<listitem>
<para>
Enables <acronym>SSL</acronym> connections. Please read
- <xref linkend="ssl-tcp"> before using this.
+ <xref linkend="ssl-tcp"/> before using this.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line.
The default is <literal>off</literal>.
</term>
<listitem>
<para>
- When a password is specified in <xref linkend="sql-createrole"> or
- <xref linkend="sql-alterrole">, this parameter determines the algorithm
+ When a password is specified in <xref linkend="sql-createrole"/> or
+ <xref linkend="sql-alterrole"/>, this parameter determines the algorithm
to use to encrypt the password. The default value is <literal>md5</literal>,
which stores the password as an MD5 hash (<literal>on</literal> is also
accepted, as alias for <literal>md5</literal>). Setting this parameter to
<para>
Note that older clients might lack support for the SCRAM authentication
mechanism, and hence not work with passwords encrypted with
- SCRAM-SHA-256. See <xref linkend="auth-password"> for more details.
+ SCRAM-SHA-256. See <xref linkend="auth-password"/> for more details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Sets the location of the Kerberos server key file. See
- <xref linkend="gssapi-auth">
+ <xref linkend="gssapi-auth"/>
for details. This parameter can only be set in the
<filename>postgresql.conf</filename> file or on the server command line.
</para>
<para>
The use of huge pages results in smaller page tables and less CPU time
spent on memory management, increasing performance. For more details,
- see <xref linkend="linux-huge-pages">.
+ see <xref linkend="linux-huge-pages"/>.
</para>
<para>
<para>
Sets the maximum number of transactions that can be in the
<quote>prepared</quote> state simultaneously (see <xref
- linkend="sql-prepare-transaction">).
+ linkend="sql-prepare-transaction"/>).
Setting this parameter to zero (which is the default)
disables the prepared-transaction feature.
This parameter can only be set at server start.
should be set to zero to prevent accidental creation of prepared
transactions. If you are using prepared transactions, you will
probably want <varname>max_prepared_transactions</varname> to be at
- least as large as <xref linkend="guc-max-connections">, so that every
+ least as large as <xref linkend="guc-max-connections"/>, so that every
session can have a prepared transaction pending.
</para>
</para>
<para>
Note that when autovacuum runs, up to
- <xref linkend="guc-autovacuum-max-workers"> times this memory
+ <xref linkend="guc-autovacuum-max-workers"/> times this memory
may be allocated, so be careful not to set the default value
too high. It may be useful to control for this by separately
- setting <xref linkend="guc-autovacuum-work-mem">.
+ setting <xref linkend="guc-autovacuum-work-mem"/>.
</para>
</listitem>
</varlistentry>
<para>
Specifies the maximum amount of memory to be used by each
autovacuum worker process. It defaults to -1, indicating that
- the value of <xref linkend="guc-maintenance-work-mem"> should
+ the value of <xref linkend="guc-maintenance-work-mem"/> should
be used instead. The setting has no effect on the behavior of
<command>VACUUM</command> when run in other contexts.
</para>
<title>Cost-based Vacuum Delay</title>
<para>
- During the execution of <xref linkend="sql-vacuum">
- and <xref linkend="sql-analyze">
+ During the execution of <xref linkend="sql-vacuum"/>
+ and <xref linkend="sql-analyze"/>
commands, the system maintains an
internal counter that keeps track of the estimated cost of the
various I/O operations that are performed. When the accumulated
the OS writes data back in larger batches in the background. Often
that will result in greatly reduced transaction latency, but there
also are some cases, especially with workloads that are bigger than
- <xref linkend="guc-shared-buffers">, but smaller than the OS's page
+ <xref linkend="guc-shared-buffers"/>, but smaller than the OS's page
cache, where performance might degrade. This setting may have no
effect on some platforms. The valid range is between
<literal>0</literal>, which disables forced writeback, and
The default is 1 on supported systems, otherwise 0. This value can
be overridden for tables in a particular tablespace by setting the
tablespace parameter of the same name (see
- <xref linkend="sql-altertablespace">).
+ <xref linkend="sql-altertablespace"/>).
</para>
</listitem>
</varlistentry>
<para>
When changing this value, consider also adjusting
- <xref linkend="guc-max-parallel-workers"> and
- <xref linkend="guc-max-parallel-workers-per-gather">.
+ <xref linkend="guc-max-parallel-workers"/> and
+ <xref linkend="guc-max-parallel-workers-per-gather"/>.
</para>
</listitem>
</varlistentry>
Sets the maximum number of workers that can be started by a single
<literal>Gather</literal> or <literal>Gather Merge</literal> node.
Parallel workers are taken from the pool of processes established by
- <xref linkend="guc-max-worker-processes">, limited by
- <xref linkend="guc-max-parallel-workers">. Note that the requested
+ <xref linkend="guc-max-worker-processes"/>, limited by
+ <xref linkend="guc-max-parallel-workers"/>. Note that the requested
number of workers may not actually be available at run time. If this
occurs, the plan will run with fewer workers than expected, which may
be inefficient. The default value is 2. Setting this value to 0
system as an additional user session. This should be taken into
account when choosing a value for this setting, as well as when
configuring other settings that control resource utilization, such
- as <xref linkend="guc-work-mem">. Resource limits such as
+ as <xref linkend="guc-work-mem"/>. Resource limits such as
<varname>work_mem</varname> are applied individually to each worker,
which means the total utilization may be much higher across all
processes than it would normally be for any single process.
<para>
For more information on parallel query, see
- <xref linkend="parallel-query">.
+ <xref linkend="parallel-query"/>.
</para>
</listitem>
</varlistentry>
Sets the maximum number of workers that the system can support for
parallel queries. The default value is 8. When increasing or
decreasing this value, consider also adjusting
- <xref linkend="guc-max-parallel-workers-per-gather">.
+ <xref linkend="guc-max-parallel-workers-per-gather"/>.
Also, note that a setting for this value which is higher than
- <xref linkend="guc-max-worker-processes"> will have no effect,
+ <xref linkend="guc-max-worker-processes"/> will have no effect,
since parallel workers are taken from the pool of worker processes
established by that setting.
</para>
checkpoint, or when the OS writes data back in larger batches in the
background. Often that will result in greatly reduced transaction
latency, but there also are some cases, especially with workloads
- that are bigger than <xref linkend="guc-shared-buffers">, but smaller
+ that are bigger than <xref linkend="guc-shared-buffers"/>, but smaller
than the OS's page cache, where performance might degrade. This
setting may have no effect on some platforms. The valid range is
between <literal>0</literal>, which disables forced writeback,
<para>
For additional information on tuning these settings,
- see <xref linkend="wal-configuration">.
+ see <xref linkend="wal-configuration"/>.
</para>
<sect2 id="runtime-config-wal-settings">
<para>
In <literal>minimal</literal> level, WAL-logging of some bulk
operations can be safely skipped, which can make those
- operations much faster (see <xref linkend="populate-pitr">).
+ operations much faster (see <xref linkend="populate-pitr"/>).
Operations in which this optimization can be applied include:
<simplelist>
<member><command>CREATE TABLE AS</command></member>
But minimal WAL does not contain enough information to reconstruct the
data from a base backup and the WAL logs, so <literal>replica</literal> or
higher must be used to enable WAL archiving
- (<xref linkend="guc-archive-mode">) and streaming replication.
+ (<xref linkend="guc-archive-mode"/>) and streaming replication.
</para>
<para>
In <literal>logical</literal> level, the same information is logged as
If this parameter is on, the <productname>PostgreSQL</productname> server
will try to make sure that updates are physically written to
disk, by issuing <function>fsync()</function> system calls or various
- equivalent methods (see <xref linkend="guc-wal-sync-method">).
+ equivalent methods (see <xref linkend="guc-wal-sync-method"/>).
This ensures that the database cluster can recover to a
consistent state after an operating system or hardware crash.
</para>
</para>
<para>
- In many situations, turning off <xref linkend="guc-synchronous-commit">
+ In many situations, turning off <xref linkend="guc-synchronous-commit"/>
for noncritical transactions can provide much of the potential
performance benefit of turning off <varname>fsync</varname>, without
the attendant risks of data corruption.
<varname>fsync</varname> can only be set in the <filename>postgresql.conf</filename>
file or on the server command line.
If you turn this parameter off, also consider turning off
- <xref linkend="guc-full-page-writes">.
+ <xref linkend="guc-full-page-writes"/>.
</para>
</listitem>
</varlistentry>
is <literal>on</literal>. When <literal>off</literal>, there can be a delay between
when success is reported to the client and when the transaction is
really guaranteed to be safe against a server crash. (The maximum
- delay is three times <xref linkend="guc-wal-writer-delay">.) Unlike
- <xref linkend="guc-fsync">, setting this parameter to <literal>off</literal>
+ delay is three times <xref linkend="guc-wal-writer-delay"/>.) Unlike
+ <xref linkend="guc-fsync"/>, setting this parameter to <literal>off</literal>
does not create any risk of database inconsistency: an operating
system or database crash might
result in some recent allegedly-committed transactions being lost, but
been aborted cleanly. So, turning <varname>synchronous_commit</varname> off
can be a useful alternative when performance is more important than
exact certainty about the durability of a transaction. For more
- discussion see <xref linkend="wal-async-commit">.
+ discussion see <xref linkend="wal-async-commit"/>.
</para>
<para>
- If <xref linkend="guc-synchronous-standby-names"> is non-empty, this
+ If <xref linkend="guc-synchronous-standby-names"/> is non-empty, this
parameter also controls whether or not transaction commits will wait
for their WAL records to be replicated to the standby server(s).
When set to <literal>on</literal>, commits will wait until replies
necessary to change this setting or other aspects of your system
configuration in order to create a crash-safe configuration or
achieve optimal performance.
- These aspects are discussed in <xref linkend="wal-reliability">.
+ These aspects are discussed in <xref linkend="wal-reliability"/>.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line.
</para>
<para>
Turning off this parameter does not affect use of
WAL archiving for point-in-time recovery (PITR)
- (see <xref linkend="continuous-archiving">).
+ (see <xref linkend="continuous-archiving"/>).
</para>
<para>
<para>
When this parameter is <literal>on</literal>, the <productname>PostgreSQL</productname>
server compresses a full page image written to WAL when
- <xref linkend="guc-full-page-writes"> is on or during a base backup.
+ <xref linkend="guc-full-page-writes"/> is on or during a base backup.
A compressed page image will be decompressed during WAL replay.
The default value is <literal>off</literal>.
Only superusers can change this setting.
<para>
The amount of shared memory used for WAL data that has not yet been
written to disk. The default setting of -1 selects a size equal to
- 1/32nd (about 3%) of <xref linkend="guc-shared-buffers">, but not less
+ 1/32nd (about 3%) of <xref linkend="guc-shared-buffers"/>, but not less
than <literal>64kB</literal> nor more than the size of one WAL
segment, typically <literal>16MB</literal>. This value can be set
manually if the automatic choice is too large or too small,
checkpoint, or when the OS writes data back in larger batches in the
background. Often that will result in greatly reduced transaction
latency, but there also are some cases, especially with workloads
- that are bigger than <xref linkend="guc-shared-buffers">, but smaller
+ that are bigger than <xref linkend="guc-shared-buffers"/>, but smaller
than the OS's page cache, where performance might degrade. This
setting may have no effect on some platforms. The valid range is
between <literal>0</literal>, which disables forced writeback,
<para>
When <varname>archive_mode</varname> is enabled, completed WAL segments
are sent to archive storage by setting
- <xref linkend="guc-archive-command">. In addition to <literal>off</literal>,
+ <xref linkend="guc-archive-command"/>. In addition to <literal>off</literal>,
to disable, there are two modes: <literal>on</literal>, and
<literal>always</literal>. During normal operation, there is no
difference between the two modes, but when set to <literal>always</literal>
the WAL archiver is enabled also during archive recovery or standby
mode. In <literal>always</literal> mode, all files restored from the archive
or streamed with streaming replication will be archived (again). See
- <xref linkend="continuous-archiving-in-standby"> for details.
+ <xref linkend="continuous-archiving-in-standby"/> for details.
</para>
<para>
<varname>archive_mode</varname> and <varname>archive_command</varname> are
Use <literal>%%</literal> to embed an actual <literal>%</literal> character in the
command. It is important for the command to return a zero
exit status only if it succeeds. For more information see
- <xref linkend="backup-archiving-wal">.
+ <xref linkend="backup-archiving-wal"/>.
</para>
<para>
This parameter can only be set in the <filename>postgresql.conf</filename>
</term>
<listitem>
<para>
- The <xref linkend="guc-archive-command"> is only invoked for
+ The <xref linkend="guc-archive-command"/> is only invoked for
completed WAL segments. Hence, if your server generates little WAL
traffic (or has slack periods where it does so), there could be a
long delay between the completion of a transaction and its safe
<para>
These settings control the behavior of the built-in
<firstterm>streaming replication</firstterm> feature (see
- <xref linkend="streaming-replication">). Servers will be either a
+ <xref linkend="streaming-replication"/>). Servers will be either a
Master or a Standby server. Masters can send data, while Standby(s)
are always receivers of replicated data. When cascading replication
- (see <xref linkend="cascading-replication">) is used, Standby server(s)
+ (see <xref linkend="cascading-replication"/>) is used, Standby server(s)
can also be senders, as well as receivers.
Parameters are mainly for Sending and Standby servers, though some
parameters have meaning only on the Master server. Settings may vary
processes). The default is 10. The value 0 means replication is
disabled. WAL sender processes count towards the total number
of connections, so the parameter cannot be set higher than
- <xref linkend="guc-max-connections">. Abrupt streaming client
+ <xref linkend="guc-max-connections"/>. Abrupt streaming client
disconnection might cause an orphaned connection slot until
a timeout is reached, so this parameter should be set slightly
higher than the maximum number of expected clients so disconnected
<listitem>
<para>
Specifies the maximum number of replication slots
- (see <xref linkend="streaming-replication-slots">) that the server
+ (see <xref linkend="streaming-replication-slots"/>) that the server
can support. The default is 10. This parameter can only be set at
server start.
<varname>wal_level</varname> must be set
These parameters can be set on the master/primary server that is
to send replication data to one or more standby servers.
Note that in addition to these parameters,
- <xref linkend="guc-wal-level"> must be set appropriately on the master
+ <xref linkend="guc-wal-level"/> must be set appropriately on the master
server, and optionally WAL archiving can be enabled as
- well (see <xref linkend="runtime-config-wal-archiving">).
+ well (see <xref linkend="runtime-config-wal-archiving"/>).
The values of these parameters on standby servers are irrelevant,
although you may wish to set them there in preparation for the
possibility of a standby becoming the master.
<para>
Specifies a list of standby servers that can support
<firstterm>synchronous replication</firstterm>, as described in
- <xref linkend="synchronous-replication">.
+ <xref linkend="synchronous-replication"/>.
There will be one or more active synchronous standbys;
transactions waiting for commit will be allowed to proceed after
these standby servers confirm receipt of their data.
replication. This is the default configuration. Even when
synchronous replication is enabled, individual transactions can be
configured not to wait for replication by setting the
- <xref linkend="guc-synchronous-commit"> parameter to
+ <xref linkend="guc-synchronous-commit"/> parameter to
<literal>local</literal> or <literal>off</literal>.
</para>
<para>
removed as soon as possible, that is, as soon as they are no longer
visible to any open transaction. You may wish to set this to a
non-zero value on a primary server that is supporting hot standby
- servers, as described in <xref linkend="hot-standby">. This allows
+ servers, as described in <xref linkend="hot-standby"/>. This allows
more time for queries on the standby to complete without incurring
conflicts due to early cleanup of rows. However, since the value
is measured in terms of number of write transactions occurring on the
<listitem>
<para>
Specifies whether or not you can connect and run queries during
- recovery, as described in <xref linkend="hot-standby">.
+ recovery, as described in <xref linkend="hot-standby"/>.
The default value is <literal>on</literal>.
This parameter can only be set at server start. It only has effect
during archive recovery or in standby mode.
When Hot Standby is active, this parameter determines how long the
standby server should wait before canceling standby queries that
conflict with about-to-be-applied WAL entries, as described in
- <xref linkend="hot-standby-conflict">.
+ <xref linkend="hot-standby-conflict"/>.
<varname>max_standby_archive_delay</varname> applies when WAL data is
being read from WAL archive (and is therefore not current).
The default is 30 seconds. Units are milliseconds if not specified.
When Hot Standby is active, this parameter determines how long the
standby server should wait before canceling standby queries that
conflict with about-to-be-applied WAL entries, as described in
- <xref linkend="hot-standby-conflict">.
+ <xref linkend="hot-standby-conflict"/>.
<varname>max_standby_streaming_delay</varname> applies when WAL data is
being received via streaming replication.
The default is 30 seconds. Units are milliseconds if not specified.
choose a different plan.
Better ways to improve the quality of the
plans chosen by the optimizer include adjusting the planner cost
- constants (see <xref linkend="runtime-config-query-constants">),
- running <xref linkend="sql-analyze"> manually, increasing
+ constants (see <xref linkend="runtime-config-query-constants"/>),
+ running <xref linkend="sql-analyze"/> manually, increasing
the value of the <xref
- linkend="guc-default-statistics-target"> configuration parameter,
+ linkend="guc-default-statistics-target"/> configuration parameter,
and increasing the amount of statistics collected for
specific columns using <command>ALTER TABLE SET
STATISTICS</command>.
<listitem>
<para>
Enables or disables the query planner's use of index-only-scan plan
- types (see <xref linkend="indexes-index-only-scans">).
+ types (see <xref linkend="indexes-index-only-scans"/>).
The default is <literal>on</literal>.
</para>
</listitem>
that is part of a series of sequential fetches. The default is 1.0.
This value can be overridden for tables and indexes in a particular
tablespace by setting the tablespace parameter of the same name
- (see <xref linkend="sql-altertablespace">).
+ (see <xref linkend="sql-altertablespace"/>).
</para>
</listitem>
</varlistentry>
non-sequentially-fetched disk page. The default is 4.0.
This value can be overridden for tables and indexes in a particular
tablespace by setting the tablespace parameter of the same name
- (see <xref linkend="sql-altertablespace">).
+ (see <xref linkend="sql-altertablespace"/>).
</para>
<para>
complex queries (those joining many relations), at the cost of producing
plans that are sometimes inferior to those found by the normal
exhaustive-search algorithm.
- For more information see <xref linkend="geqo">.
+ For more information see <xref linkend="geqo"/>.
</para>
<variablelist>
do <command>ANALYZE</command>, but might improve the quality of the
planner's estimates. The default is 100. For more information
on the use of statistics by the <productname>PostgreSQL</productname>
- query planner, refer to <xref linkend="planner-stats">.
+ query planner, refer to <xref linkend="planner-stats"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
- Refer to <xref linkend="ddl-partitioning-constraint-exclusion"> for
+ Refer to <xref linkend="ddl-partitioning-constraint-exclusion"/> for
more information on using constraint exclusion and partitioning.
</para>
</listitem>
resulting <literal>FROM</literal> list would have no more than
this many items. Smaller values reduce planning time but might
yield inferior query plans. The default is eight.
- For more information see <xref linkend="explicit-joins">.
+ For more information see <xref linkend="explicit-joins"/>.
</para>
<para>
- Setting this value to <xref linkend="guc-geqo-threshold"> or more
+ Setting this value to <xref linkend="guc-geqo-threshold"/> or more
may trigger use of the GEQO planner, resulting in non-optimal
- plans. See <xref linkend="runtime-config-query-geqo">.
+ plans. See <xref linkend="runtime-config-query-geqo"/>.
</para>
</listitem>
</varlistentry>
the optimal join order, advanced users can elect to
temporarily set this variable to 1, and then specify the join
order they desire explicitly.
- For more information see <xref linkend="explicit-joins">.
+ For more information see <xref linkend="explicit-joins"/>.
</para>
<para>
- Setting this value to <xref linkend="guc-geqo-threshold"> or more
+ Setting this value to <xref linkend="guc-geqo-threshold"/> or more
may trigger use of the GEQO planner, resulting in non-optimal
- plans. See <xref linkend="runtime-config-query-geqo">.
+ plans. See <xref linkend="runtime-config-query-geqo"/>.
</para>
</listitem>
</varlistentry>
log entries are output in <quote>comma separated
value</quote> (<acronym>CSV</acronym>) format, which is convenient for
loading logs into programs.
- See <xref linkend="runtime-config-logging-csvlog"> for details.
- <xref linkend="guc-logging-collector"> must be enabled to generate
+ See <xref linkend="runtime-config-logging-csvlog"/> for details.
+ <xref linkend="guc-logging-collector"/> must be enabled to generate
CSV-format log output.
</para>
<para>
<varname>log_destination</varname>. <productname>PostgreSQL</productname>
can log to <application>syslog</application> facilities
<literal>LOCAL0</literal> through <literal>LOCAL7</literal> (see <xref
- linkend="guc-syslog-facility">), but the default
+ 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>
register an event source and its library with the operating
system so that the Windows Event Viewer can display event
log messages cleanly.
- See <xref linkend="event-log-registration"> for details.
+ See <xref linkend="event-log-registration"/> for details.
</para>
</note>
</listitem>
file names. (Note that if there are
any time-zone-dependent <literal>%</literal>-escapes, the computation
is done in the zone specified
- by <xref linkend="guc-log-timezone">.)
+ by <xref linkend="guc-log-timezone"/>.)
The supported <literal>%</literal>-escapes are similar to those
listed in the Open Group's <ulink
url="http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html">strftime
server owner can read or write the log files. The other commonly
useful setting is <literal>0640</literal>, allowing members of the owner's
group to read the files. Note however that to make use of such a
- setting, you'll need to alter <xref linkend="guc-log-directory"> to
+ setting, you'll need to alter <xref linkend="guc-log-directory"/> to
store the files somewhere outside the cluster data directory. In
any case, it's unwise to make the log files world-readable, since
they might contain sensitive data.
<note>
<para>
When using this option together with
- <xref linkend="guc-log-statement">,
+ <xref linkend="guc-log-statement"/>,
the text of statements that are logged because of
<varname>log_statement</varname> will not be repeated in the
duration log message.
If you are not using <application>syslog</application>, it is recommended
that you log the PID or session ID using
- <xref linkend="guc-log-line-prefix">
+ <xref linkend="guc-log-line-prefix"/>
so that you can link the statement message to the later
duration message using the process ID or session ID.
</para>
</variablelist>
<para>
- <xref linkend="runtime-config-severity-levels"> explains the message
+ <xref linkend="runtime-config-severity-levels"/> explains the message
severity levels used by <productname>PostgreSQL</productname>. If logging output
is sent to <systemitem>syslog</systemitem> or Windows'
<systemitem>eventlog</systemitem>, the severity levels are translated
It is typically set by an application upon connection to the server.
The name will be displayed in the <structname>pg_stat_activity</structname> view
and included in CSV log entries. It can also be included in regular
- log entries via the <xref linkend="guc-log-line-prefix"> parameter.
+ log entries via the <xref linkend="guc-log-line-prefix"/> parameter.
Only printable ASCII characters may be used in the
<varname>application_name</varname> value. Other characters will be
replaced with question marks (<literal>?</literal>).
These messages are emitted at <literal>LOG</literal> message level, so by
default they will appear in the server log but will not be sent to the
client. You can change that by adjusting
- <xref linkend="guc-client-min-messages"> and/or
- <xref linkend="guc-log-min-messages">.
+ <xref linkend="guc-client-min-messages"/> and/or
+ <xref linkend="guc-log-min-messages"/>.
These parameters are off by default.
</para>
</listitem>
<note>
<para>
The difference between setting this option and setting
- <xref linkend="guc-log-min-duration-statement"> to zero is that
+ <xref linkend="guc-log-min-duration-statement"/> to zero is that
exceeding <varname>log_min_duration_statement</varname> forces the text of
the query to be logged, but this option doesn't. Thus, if
<varname>log_duration</varname> is <literal>on</literal> and
the logging of <literal>DETAIL</literal>, <literal>HINT</literal>,
<literal>QUERY</literal>, and <literal>CONTEXT</literal> error information.
<literal>VERBOSE</literal> output includes the <symbol>SQLSTATE</symbol> error
- code (see also <xref linkend="errcodes-appendix">) and the source code file name, function name,
+ code (see also <xref linkend="errcodes-appendix"/>) and the source code file name, function name,
and line number that generated the error.
Only superusers can change this setting.
</para>
<listitem>
<para>
Controls whether a log message is produced when a session waits
- longer than <xref linkend="guc-deadlock-timeout"> to acquire a
+ longer than <xref linkend="guc-deadlock-timeout"/> to acquire a
lock. This is useful in determining if lock waits are causing
poor performance. The default is <literal>off</literal>.
Only superusers can change this setting.
<listitem>
<para>
Causes each replication command to be logged in the server log.
- See <xref linkend="protocol-replication"> for more information about
+ See <xref linkend="protocol-replication"/> for more information about
replication command. The default value is <literal>off</literal>.
Only superusers can change this setting.
</para>
<listitem>
<para>
Sets the time zone used for timestamps written in the server log.
- Unlike <xref linkend="guc-timezone">, this value is cluster-wide,
+ Unlike <xref linkend="guc-timezone"/>, this value is cluster-wide,
so that all sessions will report timestamps consistently.
The built-in default is <literal>GMT</literal>, but that is typically
overridden in <filename>postgresql.conf</filename>; <application>initdb</application>
will install a setting there corresponding to its system environment.
- See <xref linkend="datatype-timezones"> for more information.
+ See <xref linkend="datatype-timezones"/> for more information.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line.
</para>
These settings control how process titles of server processes are
modified. Process titles are typically viewed using programs like
<application>ps</application> or, on Windows, <application>Process Explorer</application>.
- See <xref linkend="monitoring-ps"> for details.
+ See <xref linkend="monitoring-ps"/> for details.
</para>
<variablelist>
When statistics collection is enabled, the data that is produced can be
accessed via the <structname>pg_stat</structname> and
<structname>pg_statio</structname> family of system views.
- Refer to <xref linkend="monitoring"> for more information.
+ Refer to <xref linkend="monitoring"/> for more information.
</para>
<variablelist>
Enables timing of database I/O calls. This parameter is off by
default, because it will repeatedly query the operating system for
the current time, which may cause significant overhead on some
- platforms. You can use the <xref linkend="pgtesttiming"> tool to
+ platforms. You can use the <xref linkend="pgtesttiming"/> tool to
measure the overhead of timing on your system.
I/O timing information is
- displayed in <xref linkend="pg-stat-database-view">, in the output of
- <xref linkend="sql-explain"> when the <literal>BUFFERS</literal> option is
- used, and by <xref linkend="pgstatstatements">. Only superusers can
+ displayed in <xref linkend="pg-stat-database-view"/>, in the output of
+ <xref linkend="sql-explain"/> when the <literal>BUFFERS</literal> option is
+ used, and by <xref linkend="pgstatstatements"/>. Only superusers can
change this setting.
</para>
</listitem>
<para>
These settings control the behavior of the <firstterm>autovacuum</firstterm>
- feature. Refer to <xref linkend="autovacuum"> for more information.
+ feature. Refer to <xref linkend="autovacuum"/> for more information.
Note that many of these settings can be overridden on a per-table
basis; see <xref linkend="sql-createtable-storage-parameters"
- endterm="sql-createtable-storage-parameters-title">.
+ endterm="sql-createtable-storage-parameters-title"/>.
</para>
<variablelist>
<para>
Controls whether the server should run the
autovacuum launcher daemon. This is on by default; however,
- <xref linkend="guc-track-counts"> must also be enabled for
+ <xref linkend="guc-track-counts"/> must also be enabled for
autovacuum to work.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line; however, autovacuuming can be
Note that even when this parameter is disabled, the system
will launch autovacuum processes if necessary to
prevent transaction ID wraparound. See <xref
- linkend="vacuum-for-wraparound"> for more information.
+ linkend="vacuum-for-wraparound"/> for more information.
</para>
</listitem>
</varlistentry>
This parameter can only be set at server start, but the setting
can be reduced for individual tables by
changing table storage parameters.
- For more information see <xref linkend="vacuum-for-wraparound">.
+ For more information see <xref linkend="vacuum-for-wraparound"/>.
</para>
</listitem>
</varlistentry>
400 million multixacts.
This parameter can only be set at server start, but the setting can
be reduced for individual tables by changing table storage parameters.
- For more information see <xref linkend="vacuum-for-multixact-wraparound">.
+ For more information see <xref linkend="vacuum-for-multixact-wraparound"/>.
</para>
</listitem>
</varlistentry>
<para>
Specifies the cost delay value that will be used in automatic
<command>VACUUM</command> operations. If -1 is specified, the regular
- <xref linkend="guc-vacuum-cost-delay"> value will be used.
+ <xref linkend="guc-vacuum-cost-delay"/> value will be used.
The default value is 20 milliseconds.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line;
Specifies the cost limit value that will be used in automatic
<command>VACUUM</command> operations. If -1 is specified (which is the
default), the regular
- <xref linkend="guc-vacuum-cost-limit"> value will be used. Note that
+ <xref linkend="guc-vacuum-cost-limit"/> value will be used. Note that
the value is distributed proportionally among the running autovacuum
workers, if there is more than one, so that the sum of the limits for
each worker does not exceed the value of this variable.
The current effective value of the search path can be examined
via the <acronym>SQL</acronym> function
<function>current_schemas</function>
- (see <xref linkend="functions-info">).
+ (see <xref linkend="functions-info"/>).
This is not quite the same as
examining the value of <varname>search_path</varname>, since
<function>current_schemas</function> shows how the items
</para>
<para>
- For more information on schema handling, see <xref linkend="ddl-schemas">.
+ For more information on schema handling, see <xref linkend="ddl-schemas"/>.
</para>
</listitem>
</varlistentry>
<para>
For more information on row security policies,
- see <xref linkend="sql-createpolicy">.
+ see <xref linkend="sql-createpolicy"/>.
</para>
</listitem>
</varlistentry>
<para>
This variable is not used for temporary tables; for them,
- <xref linkend="guc-temp-tablespaces"> is consulted instead.
+ <xref linkend="guc-temp-tablespaces"/> is consulted instead.
</para>
<para>
<para>
For more information on tablespaces,
- see <xref linkend="manage-ag-tablespaces">.
+ see <xref linkend="manage-ag-tablespaces"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
- See also <xref linkend="guc-default-tablespace">.
+ See also <xref linkend="guc-default-tablespace"/>.
</para>
</listitem>
</varlistentry>
<para>
This parameter is normally on. When set to <literal>off</literal>, it
disables validation of the function body string during <xref
- linkend="sql-createfunction">. Disabling validation avoids side
+ linkend="sql-createfunction"/>. Disabling validation avoids side
effects of the validation process and avoids false positives due
to problems such as forward references. Set this parameter
to <literal>off</literal> before loading functions on behalf of other
</para>
<para>
- Consult <xref linkend="mvcc"> and <xref
- linkend="sql-set-transaction"> for more information.
+ Consult <xref linkend="mvcc"/> and <xref
+ linkend="sql-set-transaction"/> for more information.
</para>
</listitem>
</varlistentry>
</para>
<para>
- Consult <xref linkend="sql-set-transaction"> for more information.
+ Consult <xref linkend="sql-set-transaction"/> for more information.
</para>
</listitem>
</varlistentry>
</para>
<para>
- Consult <xref linkend="sql-set-transaction"> for more information.
+ Consult <xref linkend="sql-set-transaction"/> for more information.
</para>
</listitem>
</varlistentry>
superuser privilege and results in discarding any previously cached
query plans. Possible values are <literal>origin</literal> (the default),
<literal>replica</literal> and <literal>local</literal>.
- See <xref linkend="sql-altertable"> for
+ See <xref linkend="sql-altertable"/> for
more information.
</para>
</listitem>
longer than the specified duration in milliseconds. This allows any
locks held by that session to be released and the connection slot to be reused;
it also allows tuples visible only to this transaction to be vacuumed. See
- <xref linkend="routine-vacuuming"> for more details about this.
+ <xref linkend="routine-vacuuming"/> for more details about this.
</para>
<para>
The default value of 0 disables this feature.
tuples. The default is 150 million transactions. Although users can
set this value anywhere from zero to two billions, <command>VACUUM</command>
will silently limit the effective value to 95% of
- <xref linkend="guc-autovacuum-freeze-max-age">, so that a
+ <xref linkend="guc-autovacuum-freeze-max-age"/>, so that a
periodical manual <command>VACUUM</command> has a chance to run before an
anti-wraparound autovacuum is launched for the table. For more
information see
- <xref linkend="vacuum-for-wraparound">.
+ <xref linkend="vacuum-for-wraparound"/>.
</para>
</listitem>
</varlistentry>
The default is 50 million transactions. Although
users can set this value anywhere from zero to one billion,
<command>VACUUM</command> will silently limit the effective value to half
- the value of <xref linkend="guc-autovacuum-freeze-max-age">, so
+ the value of <xref linkend="guc-autovacuum-freeze-max-age"/>, so
that there is not an unreasonably short time between forced
autovacuums. For more information see <xref
- linkend="vacuum-for-wraparound">.
+ linkend="vacuum-for-wraparound"/>.
</para>
</listitem>
</varlistentry>
tuples. The default is 150 million multixacts.
Although users can set this value anywhere from zero to two billions,
<command>VACUUM</command> will silently limit the effective value to 95% of
- <xref linkend="guc-autovacuum-multixact-freeze-max-age">, so that a
+ <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>, so that a
periodical manual <command>VACUUM</command> has a chance to run before an
anti-wraparound is launched for the table.
- For more information see <xref linkend="vacuum-for-multixact-wraparound">.
+ For more information see <xref linkend="vacuum-for-multixact-wraparound"/>.
</para>
</listitem>
</varlistentry>
is 5 million multixacts.
Although users can set this value anywhere from zero to one billion,
<command>VACUUM</command> will silently limit the effective value to half
- the value of <xref linkend="guc-autovacuum-multixact-freeze-max-age">,
+ the value of <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>,
so that there is not an unreasonably short time between forced
autovacuums.
- For more information see <xref linkend="vacuum-for-multixact-wraparound">.
+ For more information see <xref linkend="vacuum-for-multixact-wraparound"/>.
</para>
</listitem>
</varlistentry>
Sets the output format for values of type <type>bytea</type>.
Valid values are <literal>hex</literal> (the default)
and <literal>escape</literal> (the traditional PostgreSQL
- format). See <xref linkend="datatype-binary"> for more
+ format). See <xref linkend="datatype-binary"/> for more
information. The <type>bytea</type> type always
accepts both formats on input, regardless of this setting.
</para>
<literal>base64</literal> and <literal>hex</literal>, which
are both defined in the XML Schema standard. The default is
<literal>base64</literal>. For further information about
- XML-related functions, see <xref linkend="functions-xml">.
+ XML-related functions, see <xref linkend="functions-xml"/>.
</para>
<para>
Sets whether <literal>DOCUMENT</literal> or
<literal>CONTENT</literal> is implicit when converting between
XML and character string values. See <xref
- linkend="datatype-xml"> for a description of this. Valid
+ linkend="datatype-xml"/> for a description of this. Valid
values are <literal>DOCUMENT</literal> and
<literal>CONTENT</literal>. The default is
<literal>CONTENT</literal>.
The default is four megabytes (<literal>4MB</literal>). This setting
can be overridden for individual GIN indexes by changing
index storage parameters.
- See <xref linkend="gin-fast-update"> and <xref linkend="gin-tips">
+ See <xref linkend="gin-fast-update"/> and <xref linkend="gin-tips"/>
for more information.
</para>
</listitem>
and <literal>European</literal> are synonyms for <literal>DMY</literal>; the
keywords <literal>US</literal>, <literal>NonEuro</literal>, and
<literal>NonEuropean</literal> are synonyms for <literal>MDY</literal>. See
- <xref linkend="datatype-datetime"> for more information. The
+ <xref linkend="datatype-datetime"/> for more information. The
built-in default is <literal>ISO, MDY</literal>, but
<application>initdb</application> will initialize the
configuration file with a setting that corresponds to the
output matching <acronym>SQL</acronym> standard interval literals.
The value <literal>postgres</literal> (which is the default) will produce
output matching <productname>PostgreSQL</productname> releases prior to 8.4
- when the <xref linkend="guc-datestyle">
+ when the <xref linkend="guc-datestyle"/>
parameter was set to <literal>ISO</literal>.
The value <literal>postgres_verbose</literal> will produce output
matching <productname>PostgreSQL</productname> releases prior to 8.4
<para>
The <varname>IntervalStyle</varname> parameter also affects the
interpretation of ambiguous interval input. See
- <xref linkend="datatype-interval-input"> for more information.
+ <xref linkend="datatype-interval-input"/> for more information.
</para>
</listitem>
</varlistentry>
The built-in default is <literal>GMT</literal>, but that is typically
overridden in <filename>postgresql.conf</filename>; <application>initdb</application>
will install a setting there corresponding to its system environment.
- See <xref linkend="datatype-timezones"> for more information.
+ See <xref linkend="datatype-timezones"/> for more information.
</para>
</listitem>
</varlistentry>
which is a collection that works in most of the world; there are
also <literal>'Australia'</literal> and <literal>'India'</literal>,
and other collections can be defined for a particular installation.
- See <xref linkend="datetime-config-files"> for more information.
+ See <xref linkend="datetime-config-files"/> for more information.
</para>
</listitem>
</varlistentry>
partially-significant digits; this is especially useful for dumping
float data that needs to be restored exactly. Or it can be set
negative to suppress unwanted digits.
- See also <xref linkend="datatype-float">.
+ See also <xref linkend="datatype-float"/>.
</para>
</listitem>
</varlistentry>
Sets the client-side encoding (character set).
The default is to use the database encoding.
The character sets supported by the <productname>PostgreSQL</productname>
- server are described in <xref linkend="multibyte-charset-supported">.
+ server are described in <xref linkend="multibyte-charset-supported"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Sets the language in which messages are displayed. Acceptable
- values are system-dependent; see <xref linkend="locale"> for
+ values are system-dependent; see <xref linkend="locale"/> for
more information. If this variable is set to the empty string
(which is the default) then the value is inherited from the
execution environment of the server in a system-dependent way.
Sets the locale to use for formatting monetary amounts, for
example with the <function>to_char</function> family of
functions. Acceptable values are system-dependent; see <xref
- linkend="locale"> for more information. If this variable is
+ linkend="locale"/> for more information. If this variable is
set to the empty string (which is the default) then the value
is inherited from the execution environment of the server in a
system-dependent way.
Sets the locale to use for formatting numbers, for example
with the <function>to_char</function> family of
functions. Acceptable values are system-dependent; see <xref
- linkend="locale"> for more information. If this variable is
+ linkend="locale"/> for more information. If this variable is
set to the empty string (which is the default) then the value
is inherited from the execution environment of the server in a
system-dependent way.
Sets the locale to use for formatting dates and times, for example
with the <function>to_char</function> family of
functions. Acceptable values are system-dependent; see <xref
- linkend="locale"> for more information. If this variable is
+ linkend="locale"/> for more information. If this variable is
set to the empty string (which is the default) then the value
is inherited from the execution environment of the server in a
system-dependent way.
Selects the text search configuration that is used by those variants
of the text search functions that do not have an explicit argument
specifying the configuration.
- See <xref linkend="textsearch"> for further information.
+ See <xref linkend="textsearch"/> for further information.
The built-in default is <literal>pg_catalog.simple</literal>, but
<application>initdb</application> will initialize the
configuration file with a setting that corresponds to the
This variable specifies one or more shared libraries that are to be
preloaded at connection start.
It contains a comma-separated list of library names, where each name
- is interpreted as for the <xref linkend="sql-load"> command.
+ is interpreted as for the <xref linkend="sql-load"/> command.
Whitespace between entries is ignored; surround a library name with
double quotes if you need to include whitespace or commas in the name.
The parameter value only takes effect at the start of the connection.
<para>
However, unless a module is specifically designed to be used in this way by
non-superusers, this is usually not the right setting to use. Look
- at <xref linkend="guc-session-preload-libraries"> instead.
+ at <xref linkend="guc-session-preload-libraries"/> instead.
</para>
</listitem>
</varlistentry>
This variable specifies one or more shared libraries that are to be
preloaded at connection start.
It contains a comma-separated list of library names, where each name
- is interpreted as for the <xref linkend="sql-load"> command.
+ is interpreted as for the <xref linkend="sql-load"/> command.
Whitespace between entries is ignored; surround a library name with
double quotes if you need to include whitespace or commas in the name.
The parameter value only takes effect at the start of the connection.
performance-measurement libraries to be loaded into specific sessions
without an explicit
<command>LOAD</command> command being given. For
- example, <xref linkend="auto-explain"> could be enabled for all
+ example, <xref linkend="auto-explain"/> could be enabled for all
sessions under a given user name by setting this parameter
with <command>ALTER ROLE SET</command>. Also, this parameter can be changed
without restarting the server (but changes only take effect when a new
</para>
<para>
- Unlike <xref linkend="guc-shared-preload-libraries">, there is no large
+ Unlike <xref linkend="guc-shared-preload-libraries"/>, there is no large
performance advantage to loading a library at session start rather than
when it is first used. There is some advantage, however, when
connection pooling is used.
This variable specifies one or more shared libraries to be preloaded at
server start.
It contains a comma-separated list of library names, where each name
- is interpreted as for the <xref linkend="sql-load"> command.
+ is interpreted as for the <xref linkend="sql-load"/> command.
Whitespace between entries is ignored; surround a library name with
double quotes if you need to include whitespace or commas in the name.
This parameter can only be set at server start. If a specified
parameter is recommended only for libraries that will be used in most
sessions. Also, changing this parameter requires a server restart, so
this is not the right setting to use for short-term debugging tasks,
- say. Use <xref linkend="guc-session-preload-libraries"> for that
+ say. Use <xref linkend="guc-session-preload-libraries"/> for that
instead.
</para>
<listitem>
<para>
Soft upper limit of the size of the set returned by GIN index scans. For more
- information see <xref linkend="gin-tips">.
+ information see <xref linkend="gin-tips"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
- When <xref linkend="guc-log-lock-waits"> is set,
+ When <xref linkend="guc-log-lock-waits"/> is set,
this parameter also determines the length of time to wait before
a log message is issued about the lock wait. If you are trying
to investigate locking delays you might want to set a shorter than
<para>
The shared lock table tracks locks on
<varname>max_locks_per_transaction</varname> * (<xref
- linkend="guc-max-connections"> + <xref
- linkend="guc-max-prepared-transactions">) objects (e.g., tables);
+ linkend="guc-max-connections"/> + <xref
+ linkend="guc-max-prepared-transactions"/>) objects (e.g., tables);
hence, no more than this many distinct objects can be locked at
any one time. This parameter controls the average number of object
locks allocated for each transaction; individual transactions
<para>
The shared predicate lock table tracks locks on
<varname>max_pred_locks_per_transaction</varname> * (<xref
- linkend="guc-max-connections"> + <xref
- linkend="guc-max-prepared-transactions">) objects (e.g., tables);
+ linkend="guc-max-connections"/> + <xref
+ linkend="guc-max-prepared-transactions"/>) objects (e.g., tables);
hence, no more than this many distinct objects can be locked at
any one time. This parameter controls the average number of object
locks allocated for each transaction; individual transactions
predicate-locked before the lock is promoted to covering the whole
relation. Values greater than or equal to zero mean an absolute
limit, while negative values
- mean <xref linkend="guc-max-pred-locks-per-transaction"> divided by
+ mean <xref linkend="guc-max-pred-locks-per-transaction"/> divided by
the absolute value of this setting. The default is -2, which keeps
the behavior from previous versions of <productname>PostgreSQL</productname>.
This parameter can only be set in the <filename>postgresql.conf</filename>
</para>
<para>
- See <xref linkend="sql-precedence"> for more information.
+ See <xref linkend="sql-precedence"/> for more information.
</para>
</listitem>
</varlistentry>
output of <command>EXPLAIN</command> as well as the results of functions
like <function>pg_get_viewdef</function>. See also the
<option>--quote-all-identifiers</option> option of
- <xref linkend="app-pgdump"> and <xref linkend="app-pg-dumpall">.
+ <xref linkend="app-pgdump"/> and <xref linkend="app-pg-dumpall"/>.
</para>
</listitem>
</varlistentry>
parameter to determine how string literals will be processed.
The presence of this parameter can also be taken as an indication
that the escape string syntax (<literal>E'...'</literal>) is supported.
- Escape string syntax (<xref linkend="sql-syntax-strings-escape">)
+ Escape string syntax (<xref linkend="sql-syntax-strings-escape"/>)
should be used if an application desires
backslashes to be treated as escape characters.
</para>
</para>
<para>
- Refer to <xref linkend="functions-comparison"> for related information.
+ Refer to <xref linkend="functions-comparison"/> for related information.
</para>
</listitem>
</varlistentry>
Reports the size of a disk block. It is determined by the value
of <literal>BLCKSZ</literal> when building the server. The default
value is 8192 bytes. The meaning of some configuration
- variables (such as <xref linkend="guc-shared-buffers">) is
+ variables (such as <xref linkend="guc-shared-buffers"/>) is
influenced by <varname>block_size</varname>. See <xref
- linkend="runtime-config-resource"> for information.
+ linkend="runtime-config-resource"/> for information.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Reports whether data checksums are enabled for this cluster.
- See <xref linkend="app-initdb-data-checksums"> for more information.
+ See <xref linkend="app-initdb-data-checksums"/> for more information.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Reports the locale in which sorting of textual data is done.
- See <xref linkend="locale"> for more information.
+ See <xref linkend="locale"/> for more information.
This value is determined when a database is created.
</para>
</listitem>
<listitem>
<para>
Reports the locale that determines character classifications.
- See <xref linkend="locale"> for more information.
+ See <xref linkend="locale"/> for more information.
This value is determined when a database is created.
Ordinarily this will be the same as <varname>lc_collate</varname>,
but for special applications it might be set differently.
Reports the database encoding (character set).
It is determined when the database is created. Ordinarily,
clients need only be concerned with the value of <xref
- linkend="guc-client-encoding">.
+ linkend="guc-client-encoding"/>.
</para>
</listitem>
</varlistentry>
Reports the number of blocks (pages) in a WAL segment file.
The total size of a WAL segment file in bytes is equal to
<varname>wal_segment_size</varname> multiplied by <varname>wal_block_size</varname>;
- by default this is 16MB. See <xref linkend="wal-configuration"> for
+ by default this is 16MB. See <xref linkend="wal-configuration"/> for
more information.
</para>
</listitem>
<para>
Generates a great amount of debugging output for the
<command>LISTEN</command> and <command>NOTIFY</command>
- commands. <xref linkend="guc-client-min-messages"> or
- <xref linkend="guc-log-min-messages"> must be
+ commands. <xref linkend="guc-client-min-messages"/> or
+ <xref linkend="guc-log-min-messages"/> must be
<literal>DEBUG1</literal> or lower to send this output to the
client or server logs, respectively.
</para>
<para>
Enables logging of recovery-related debugging output that otherwise
would not be logged. This parameter allows the user to override the
- normal setting of <xref linkend="guc-log-min-messages">, but only for
+ normal setting of <xref linkend="guc-log-min-messages"/>, but only for
specific messages. This is intended for use in debugging Hot Standby.
Valid values are <literal>DEBUG5</literal>, <literal>DEBUG4</literal>,
<literal>DEBUG3</literal>, <literal>DEBUG2</literal>, <literal>DEBUG1</literal>, and
</term>
<listitem>
<para>
- Only has effect if <xref linkend="app-initdb-data-checksums"> are enabled.
+ Only has effect if <xref linkend="app-initdb-data-checksums"/> are enabled.
</para>
<para>
Detection of a checksum failure during a read normally causes
<para>
For convenience there are also single letter command-line option
switches available for some parameters. They are described in
- <xref linkend="runtime-config-short-table">. Some of these
+ <xref linkend="runtime-config-short-table"/>. Some of these
options exist for historical reasons, and their presence as a
single-letter option does not necessarily indicate an endorsement
to use the option heavily.
<para>
This appendix covers extensions and other server plug-in modules found in
- <literal>contrib</literal>. <xref linkend="contrib-prog"> covers utility
+ <literal>contrib</literal>. <xref linkend="contrib-prog"/> covers utility
programs.
</para>
<para>
When building from the source distribution, these components are not built
automatically, unless you build the "world" target
- (see <xref linkend="build">).
+ (see <xref linkend="build"/>).
You can build and install all of them by running:
<screen>
<userinput>make</userinput>
To make use of one of these modules, after you have installed the code
you need to register the new SQL objects in the database system.
In <productname>PostgreSQL</productname> 9.1 and later, this is done by executing
- a <xref linkend="sql-createextension"> command. In a fresh database,
+ a <xref linkend="sql-createextension"/> command. In a fresh database,
you can simply do
<programlisting>
This will update the pre-9.1 objects of the module into a proper
<firstterm>extension</firstterm> object. Future updates to the module will be
- managed by <xref linkend="sql-alterextension">.
+ managed by <xref linkend="sql-alterextension"/>.
For more information about extension updates, see
- <xref linkend="extend-extensions">.
+ <xref linkend="extend-extensions"/>.
</para>
<para>
Note, however, that some of these modules are not <quote>extensions</quote>
in this sense, but are loaded into the server in some other way, for instance
by way of
- <xref linkend="guc-shared-preload-libraries">. See the documentation of each
+ <xref linkend="guc-shared-preload-libraries"/>. See the documentation of each
module for details.
</para>
<para>
This appendix and the previous one contain information regarding the modules that
can be found in the <literal>contrib</literal> directory of the
- <productname>PostgreSQL</productname> distribution. See <xref linkend="contrib"> for
+ <productname>PostgreSQL</productname> distribution. See <xref linkend="contrib"/> for
more information about the <literal>contrib</literal> section in general and
server extensions and plug-ins found in <literal>contrib</literal>
specifically.
This section covers <productname>PostgreSQL</productname> client
applications in <literal>contrib</literal>. They can be run from anywhere,
independent of where the database server resides. See
- also <xref linkend="reference-client"> for information about client
+ also <xref linkend="reference-client"/> for information about client
applications that part of the core <productname>PostgreSQL</productname>
distribution.
</para>
This section covers <productname>PostgreSQL</productname> server-related
applications in <literal>contrib</literal>. They are typically run on the
host where the database server resides. See also <xref
- linkend="reference-server"> for information about server applications that
+ linkend="reference-server"/> for information about server applications that
part of the core <productname>PostgreSQL</productname> distribution.
</para>
<title>Syntax</title>
<para>
- <xref linkend="cube-repr-table"> shows the valid external
+ <xref linkend="cube-repr-table"/> shows the valid external
representations for the <type>cube</type>
type. <replaceable>x</replaceable>, <replaceable>y</replaceable>, etc. denote
floating-point numbers.
<title>Usage</title>
<para>
- <xref linkend="cube-operators-table"> shows the operators provided for
+ <xref linkend="cube-operators-table"/> shows the operators provided for
type <type>cube</type>.
</para>
</para>
<para>
- <xref linkend="cube-functions-table"> shows the available functions.
+ <xref linkend="cube-functions-table"/> shows the available functions.
</para>
<table id="cube-functions-table">
</programlisting>
Convert a custom path to a finished plan. The return value will generally
be a <literal>CustomScan</literal> object, which the callback must allocate and
- initialize. See <xref linkend="custom-scan-plan"> for more details.
+ initialize. See <xref linkend="custom-scan-plan"/> for more details.
</para>
</sect2>
</sect1>
<productname>PostgreSQL</productname> has a rich set of native data
types available to users. Users can add new types to
<productname>PostgreSQL</productname> using the <xref
- linkend="sql-createtype"> command.
+ linkend="sql-createtype"/> command.
</para>
<para>
- <xref linkend="datatype-table"> shows all the built-in general-purpose data
+ <xref linkend="datatype-table"/> shows all the built-in general-purpose data
types. Most of the alternative names listed in the
<quote>Aliases</quote> column are the names used internally by
<productname>PostgreSQL</productname> for historical reasons. In
<para>
Numeric types consist of two-, four-, and eight-byte integers,
four- and eight-byte floating-point numbers, and selectable-precision
- decimals. <xref linkend="datatype-numeric-table"> lists the
+ decimals. <xref linkend="datatype-numeric-table"/> lists the
available types.
</para>
<para>
The syntax of constants for the numeric types is described in
- <xref linkend="sql-syntax-constants">. The numeric types have a
+ <xref linkend="sql-syntax-constants"/>. The numeric types have a
full set of corresponding arithmetic operators and
- functions. Refer to <xref linkend="functions"> for more
+ functions. Refer to <xref linkend="functions"/> for more
information. The following sections describe the types in detail.
</para>
The maximum allowed precision when explicitly specified in the
type declaration is 1000; <type>NUMERIC</type> without a specified
precision is subject to the limits described in <xref
- linkend="datatype-numeric-table">.
+ linkend="datatype-numeric-table"/>.
</para>
</note>
<note>
<para>
- The <xref linkend="guc-extra-float-digits"> setting controls the
+ The <xref linkend="guc-extra-float-digits"/> setting controls the
number of extra significant digits included when a floating point
value is converted to text for output. With the default value of
<literal>0</literal>, the output is the same on every platform
<para>
This section describes a PostgreSQL-specific way to create an
autoincrementing column. Another way is to use the SQL-standard
- identity column feature, described at <xref linkend="sql-createtable">.
+ identity column feature, described at <xref linkend="sql-createtable"/>.
</para>
</note>
from the sequence is still "used up" even if a row containing that
value is never successfully inserted into the table column. This
may happen, for example, if the inserting transaction rolls back.
- See <literal>nextval()</literal> in <xref linkend="functions-sequence">
+ See <literal>nextval()</literal> in <xref linkend="functions-sequence"/>
for details.
</para>
</note>
<para>
The <type>money</type> type stores a currency amount with a fixed
fractional precision; see <xref
- linkend="datatype-money-table">. The fractional precision is
- determined by the database's <xref linkend="guc-lc-monetary"> setting.
+ linkend="datatype-money-table"/>. The fractional precision is
+ determined by the database's <xref linkend="guc-lc-monetary"/> setting.
The range shown in the table assumes there are two fractional digits.
Input is accepted in a variety of formats, including integer and
floating-point literals, as well as typical
</table>
<para>
- <xref linkend="datatype-character-table"> shows the
+ <xref linkend="datatype-character-table"/> shows the
general-purpose character types available in
<productname>PostgreSQL</productname>.
</para>
</tip>
<para>
- Refer to <xref linkend="sql-syntax-strings"> for information about
- the syntax of string literals, and to <xref linkend="functions">
+ Refer to <xref linkend="sql-syntax-strings"/> for information about
+ the syntax of string literals, and to <xref linkend="functions"/>
for information about available operators and functions. The
database character set determines the character set used to store
textual values; for more information on character set support,
- refer to <xref linkend="multibyte">.
+ refer to <xref linkend="multibyte"/>.
</para>
<example>
<programlisting>
CREATE TABLE test1 (a character(4));
INSERT INTO test1 VALUES ('ok');
-SELECT a, char_length(a) FROM test1; -- <co id="co.datatype-char">
+SELECT a, char_length(a) FROM test1; -- <co id="co.datatype-char"/>
<computeroutput>
a | char_length
------+-------------
<callout arearefs="co.datatype-char">
<para>
The <function>char_length</function> function is discussed in
- <xref linkend="functions-string">.
+ <xref linkend="functions-string"/>.
</para>
</callout>
</calloutlist>
<para>
There are two other fixed-length character types in
<productname>PostgreSQL</productname>, shown in <xref
- linkend="datatype-character-special-table">. The <type>name</type>
+ linkend="datatype-character-special-table"/>. The <type>name</type>
type exists <emphasis>only</emphasis> for the storage of identifiers
in the internal system catalogs and is not intended for use by the general user. Its
length is currently defined as 64 bytes (63 usable characters plus
<para>
The <type>bytea</type> data type allows storage of binary strings;
- see <xref linkend="datatype-binary-table">.
+ see <xref linkend="datatype-binary-table"/>.
</para>
<table id="datatype-binary-table">
input and output: <productname>PostgreSQL</productname>'s historical
<quote>escape</quote> format, and <quote>hex</quote> format. Both
of these are always accepted on input. The output format depends
- on the configuration parameter <xref linkend="guc-bytea-output">;
+ on the configuration parameter <xref linkend="guc-bytea-output"/>;
the default is hex. (Note that the hex format was introduced in
<productname>PostgreSQL</productname> 9.0; earlier versions and some
tools don't understand it.)
literal using escape string syntax).
Backslash itself (octet value 92) can alternatively be represented by
double backslashes.
- <xref linkend="datatype-binary-sqlesc">
+ <xref linkend="datatype-binary-sqlesc"/>
shows the characters that must be escaped, and gives the alternative
escape sequences where applicable.
</para>
The requirement to escape <emphasis>non-printable</emphasis> octets
varies depending on locale settings. In some instances you can get away
with leaving them unescaped. Note that the result in each of the examples
- in <xref linkend="datatype-binary-sqlesc"> was exactly one octet in
+ in <xref linkend="datatype-binary-sqlesc"/> was exactly one octet in
length, even though the output representation is sometimes
more than one character.
</para>
<para>
The reason multiple backslashes are required, as shown
- in <xref linkend="datatype-binary-sqlesc">, is that an input
+ in <xref linkend="datatype-binary-sqlesc"/>, is that an input
string written as a string literal must pass through two parse
phases in the <productname>PostgreSQL</productname> server.
The first backslash of each pair is interpreted as an escape
to a single octet with a decimal value of 1. Note that the
single-quote character is not treated specially by <type>bytea</type>,
so it follows the normal rules for string literals. (See also
- <xref linkend="sql-syntax-strings">.)
+ <xref linkend="sql-syntax-strings"/>.)
</para>
<para>
Most <quote>printable</quote> octets are represented by their standard
representation in the client character set. The octet with decimal
value 92 (backslash) is doubled in the output.
- Details are in <xref linkend="datatype-binary-resesc">.
+ Details are in <xref linkend="datatype-binary-resesc"/>.
</para>
<table id="datatype-binary-resesc">
<para>
<productname>PostgreSQL</productname> supports the full set of
<acronym>SQL</acronym> date and time types, shown in <xref
- linkend="datatype-datetime-table">. The operations available
+ linkend="datatype-datetime-table"/>. The operations available
on these data types are described in
- <xref linkend="functions-datetime">.
+ <xref linkend="functions-datetime"/>.
Dates are counted according to the Gregorian calendar, even in
years before that calendar was introduced (see <xref
- linkend="datetime-units-history"> for more information).
+ linkend="datetime-units-history"/> for more information).
</para>
<table id="datatype-datetime-table">
traditional <productname>POSTGRES</productname>, and others.
For some formats, ordering of day, month, and year in date input is
ambiguous and there is support for specifying the expected
- ordering of these fields. Set the <xref linkend="guc-datestyle"> parameter
+ ordering of these fields. Set the <xref linkend="guc-datestyle"/> parameter
to <literal>MDY</literal> to select month-day-year interpretation,
<literal>DMY</literal> to select day-month-year interpretation, or
<literal>YMD</literal> to select year-month-day interpretation.
<productname>PostgreSQL</productname> is more flexible in
handling date/time input than the
<acronym>SQL</acronym> standard requires.
- See <xref linkend="datetime-appendix">
+ See <xref linkend="datetime-appendix"/>
for the exact parsing rules of date/time input and for the
recognized text fields including months, days of the week, and
time zones.
<para>
Remember that any date or time literal input needs to be enclosed
in single quotes, like text strings. Refer to
- <xref linkend="sql-syntax-constants-generic"> for more
+ <xref linkend="sql-syntax-constants-generic"/> for more
information.
<acronym>SQL</acronym> requires the following syntax
<synopsis>
</indexterm>
<para>
- <xref linkend="datatype-datetime-date-table"> shows some possible
+ <xref linkend="datatype-datetime-date-table"/> shows some possible
inputs for the <type>date</type> type.
</para>
<para>
Valid input for these types consists of a time of day followed
by an optional time zone. (See <xref
- linkend="datatype-datetime-time-table">
- and <xref linkend="datatype-timezone-table">.) If a time zone is
+ linkend="datatype-datetime-time-table"/>
+ and <xref linkend="datatype-timezone-table"/>.) If a time zone is
specified in the input for <type>time without time zone</type>,
it is silently ignored. You can also specify a date but it will
be ignored, except when you use a time zone name that involves a
</table>
<para>
- Refer to <xref linkend="datatype-timezones"> for more information on how
+ Refer to <xref linkend="datatype-timezones"/> for more information on how
to specify time zones.
</para>
</sect3>
time zone specified is converted to UTC using the appropriate offset
for that time zone. If no time zone is stated in the input string,
then it is assumed to be in the time zone indicated by the system's
- <xref linkend="guc-timezone"> parameter, and is converted to UTC using the
+ <xref linkend="guc-timezone"/> parameter, and is converted to UTC using the
offset for the <varname>timezone</varname> zone.
</para>
current <varname>timezone</varname> zone, and displayed as local time in that
zone. To see the time in another time zone, either change
<varname>timezone</varname> or use the <literal>AT TIME ZONE</literal> construct
- (see <xref linkend="functions-datetime-zoneconvert">).
+ (see <xref linkend="functions-datetime-zoneconvert"/>).
</para>
<para>
<para>
<productname>PostgreSQL</productname> supports several
special date/time input values for convenience, as shown in <xref
- linkend="datatype-datetime-special-table">. The values
+ linkend="datatype-datetime-special-table"/>. The values
<literal>infinity</literal> and <literal>-infinity</literal>
are specially represented inside the system and will be displayed
unchanged; but the others are simply notational shorthands
<literal>CURRENT_TIMESTAMP</literal>, <literal>LOCALTIME</literal>,
<literal>LOCALTIMESTAMP</literal>. The latter four accept an
optional subsecond precision specification. (See <xref
- linkend="functions-datetime-current">.) Note that these are
+ linkend="functions-datetime-current"/>.) Note that these are
SQL functions and are <emphasis>not</emphasis> recognized in data input strings.
</para>
<acronym>SQL</acronym> standard requires the use of the ISO 8601
format. The name of the <quote>SQL</quote> output format is a
historical accident.) <xref
- linkend="datatype-datetime-output-table"> shows examples of each
+ linkend="datatype-datetime-output-table"/> shows examples of each
output style. The output of the <type>date</type> and
<type>time</type> types is generally only the date or time part
in accordance with the given examples. However, the
In the <acronym>SQL</acronym> and POSTGRES styles, day appears before
month if DMY field ordering has been specified, otherwise month appears
before day.
- (See <xref linkend="datatype-datetime-input">
+ (See <xref linkend="datatype-datetime-input"/>
for how this setting also affects interpretation of input values.)
- <xref linkend="datatype-datetime-output2-table"> shows examples.
+ <xref linkend="datatype-datetime-output2-table"/> shows examples.
</para>
<table id="datatype-datetime-output2-table">
<para>
The date/time style can be selected by the user using the
<command>SET datestyle</command> command, the <xref
- linkend="guc-datestyle"> parameter in the
+ linkend="guc-datestyle"/> parameter in the
<filename>postgresql.conf</filename> configuration file, or the
<envar>PGDATESTYLE</envar> environment variable on the server or
client.
<para>
The formatting function <function>to_char</function>
- (see <xref linkend="functions-formatting">) is also available as
+ (see <xref linkend="functions-formatting"/>) is also available as
a more flexible way to format date/time output.
</para>
</sect2>
<para>
All timezone-aware dates and times are stored internally in
<acronym>UTC</acronym>. They are converted to local time
- in the zone specified by the <xref linkend="guc-timezone"> configuration
+ in the zone specified by the <xref linkend="guc-timezone"/> configuration
parameter before being displayed to the client.
</para>
A full time zone name, for example <literal>America/New_York</literal>.
The recognized time zone names are listed in the
<literal>pg_timezone_names</literal> view (see <xref
- linkend="view-pg-timezone-names">).
+ linkend="view-pg-timezone-names"/>).
<productname>PostgreSQL</productname> uses the widely-used IANA
time zone data for this purpose, so the same time zone
names are also recognized by much other software.
contrast to full time zone names which can imply a set of daylight
savings transition-date rules as well. The recognized abbreviations
are listed in the <literal>pg_timezone_abbrevs</literal> view (see <xref
- linkend="view-pg-timezone-abbrevs">). You cannot set the
- configuration parameters <xref linkend="guc-timezone"> or
- <xref linkend="guc-log-timezone"> to a time
+ linkend="view-pg-timezone-abbrevs"/>). You cannot set the
+ configuration parameters <xref linkend="guc-timezone"/> or
+ <xref linkend="guc-log-timezone"/> to a time
zone abbreviation, but you can use abbreviations in
date/time input values and with the <literal>AT TIME ZONE</literal>
operator.
they are obtained from configuration files stored under
<filename>.../share/timezone/</filename> and <filename>.../share/timezonesets/</filename>
of the installation directory
- (see <xref linkend="datetime-config-files">).
+ (see <xref linkend="datetime-config-files"/>).
</para>
<para>
- The <xref linkend="guc-timezone"> configuration parameter can
+ The <xref linkend="guc-timezone"/> configuration parameter can
be set in the file <filename>postgresql.conf</filename>, or in any of the
- other standard ways described in <xref linkend="runtime-config">.
+ other standard ways described in <xref linkend="runtime-config"/>.
There are also some special ways to set it:
<itemizedlist>
of the different units are implicitly added with appropriate
sign accounting. <literal>ago</literal> negates all the fields.
This syntax is also used for interval output, if
- <xref linkend="guc-intervalstyle"> is set to
+ <xref linkend="guc-intervalstyle"/> is set to
<literal>postgres_verbose</literal>.
</para>
The string must start with a <literal>P</literal>, and may include a
<literal>T</literal> that introduces the time-of-day units. The
available unit abbreviations are given in <xref
- linkend="datatype-interval-iso8601-units">. Units may be
+ linkend="datatype-interval-iso8601-units"/>. Units may be
omitted, and may be specified in any order, but units smaller than
a day must appear after <literal>T</literal>. In particular, the meaning of
<literal>M</literal> depends on whether it is before or after
</para>
<para>
- <xref linkend="datatype-interval-input-examples"> shows some examples
+ <xref linkend="datatype-interval-input-examples"/> shows some examples
of valid <type>interval</type> input.
</para>
<literal>postgres_verbose</literal>, or <literal>iso_8601</literal>,
using the command <literal>SET intervalstyle</literal>.
The default is the <literal>postgres</literal> format.
- <xref linkend="interval-style-output-table"> shows examples of each
+ <xref linkend="interval-style-output-table"/> shows examples of each
output style.
</para>
<para>
The output of the <literal>postgres</literal> style matches the output of
<productname>PostgreSQL</productname> releases prior to 8.4 when the
- <xref linkend="guc-datestyle"> parameter was set to <literal>ISO</literal>.
+ <xref linkend="guc-datestyle"/> parameter was set to <literal>ISO</literal>.
</para>
<para>
<para>
<productname>PostgreSQL</productname> provides the
standard <acronym>SQL</acronym> type <type>boolean</type>;
- see <xref linkend="datatype-boolean-table">.
+ see <xref linkend="datatype-boolean-table"/>.
The <type>boolean</type> type can have several states:
<quote>true</quote>, <quote>false</quote>, and a third state,
<quote>unknown</quote>, which is represented by the
</para>
<para>
- <xref linkend="datatype-boolean-example"> shows that
+ <xref linkend="datatype-boolean-example"/> shows that
<type>boolean</type> values are output using the letters
<literal>t</literal> and <literal>f</literal>.
</para>
<para>
Enum types are created using the <xref
- linkend="sql-createtype"> command,
+ linkend="sql-createtype"/> command,
for example:
<programlisting>
<para>
Geometric data types represent two-dimensional spatial
- objects. <xref linkend="datatype-geo-table"> shows the geometric
+ objects. <xref linkend="datatype-geo-table"/> shows the geometric
types available in <productname>PostgreSQL</productname>.
</para>
<para>
A rich set of functions and operators is available to perform various geometric
operations such as scaling, translation, rotation, and determining
- intersections. They are explained in <xref linkend="functions-geometry">.
+ intersections. They are explained in <xref linkend="functions-geometry"/>.
</para>
<sect2>
<para>
<productname>PostgreSQL</productname> offers data types to store IPv4, IPv6, and MAC
- addresses, as shown in <xref linkend="datatype-net-types-table">. It
+ addresses, as shown in <xref linkend="datatype-net-types-table"/>. It
is better to use these types instead of plain text types to store
network addresses, because
these types offer input error checking and specialized
- operators and functions (see <xref linkend="functions-net">).
+ operators and functions (see <xref linkend="functions-net"/>).
</para>
<table tocentry="1" id="datatype-net-types-table">
</para>
<para>
- <xref linkend="datatype-net-cidr-table"> shows some examples.
+ <xref linkend="datatype-net-cidr-table"/> shows some examples.
</para>
<table id="datatype-net-cidr-table">
<para>
Refer to <xref
- linkend="sql-syntax-bit-strings"> for information about the syntax
+ linkend="sql-syntax-bit-strings"/> for information about the syntax
of bit string constants. Bit-logical operators and string
manipulation functions are available; see <xref
- linkend="functions-bitstring">.
+ linkend="functions-bitstring"/>.
</para>
<example>
A bit string value requires 1 byte for each group of 8 bits, plus
5 or 8 bytes overhead depending on the length of the string
(but long values may be compressed or moved out-of-line, as explained
- in <xref linkend="datatype-character"> for character strings).
+ in <xref linkend="datatype-character"/> for character strings).
</para>
</sect1>
The <type>tsvector</type> type represents a document in a form optimized
for text search; the <type>tsquery</type> type similarly represents
a text query.
- <xref linkend="textsearch"> provides a detailed explanation of this
- facility, and <xref linkend="functions-textsearch"> summarizes the
+ <xref linkend="textsearch"/> provides a detailed explanation of this
+ facility, and <xref linkend="functions-textsearch"/> summarizes the
related functions and operators.
</para>
A <type>tsvector</type> value is a sorted list of distinct
<firstterm>lexemes</firstterm>, which are words that have been
<firstterm>normalized</firstterm> to merge different variants of the same word
- (see <xref linkend="textsearch"> for details). Sorting and
+ (see <xref linkend="textsearch"/> for details). Sorting and
duplicate-elimination are done automatically during input, as shown in
this example:
'fat':2 'rat':3
</programlisting>
- Again, see <xref linkend="textsearch"> for more detail.
+ Again, see <xref linkend="textsearch"/> for more detail.
</para>
</sect2>
functions for UUIDs, but the core database does not include any
function for generating UUIDs, because no single algorithm is well
suited for every application. The <xref
- linkend="uuid-ossp"> module
+ linkend="uuid-ossp"/> module
provides functions that implement several standard algorithms.
- The <xref linkend="pgcrypto"> module also provides a generation
+ The <xref linkend="pgcrypto"/> module also provides a generation
function for random UUIDs.
Alternatively, UUIDs could be generated by client applications or
other libraries invoked through a server-side function.
advantage over storing XML data in a <type>text</type> field is that it
checks the input values for well-formedness, and there are support
functions to perform type-safe operations on it; see <xref
- linkend="functions-xml">. Use of this data type requires the
+ linkend="functions-xml"/>. Use of this data type requires the
installation to have been built with <command>configure
--with-libxml</command>.
</para>
results to the client (which is the normal mode), PostgreSQL
converts all character data passed between the client and the
server and vice versa to the character encoding of the respective
- end; see <xref linkend="multibyte">. This includes string
+ end; see <xref linkend="multibyte"/>. This includes string
representations of XML values, such as in the above examples.
This would ordinarily mean that encoding declarations contained in
XML data can become invalid as the character data is converted
</para>
<para>
- For additional information see <xref linkend="sql-createdomain">.
+ For additional information see <xref linkend="sql-createdomain"/>.
</para>
</sect1>
<productname>PostgreSQL</productname> as primary keys for various
system tables. OIDs are not added to user-created tables, unless
<literal>WITH OIDS</literal> is specified when the table is
- created, or the <xref linkend="guc-default-with-oids">
+ created, or the <xref linkend="guc-default-with-oids"/>
configuration variable is enabled. Type <type>oid</type> represents
an object identifier. There are also several alias types for
<type>oid</type>: <type>regproc</type>, <type>regprocedure</type>,
<type>regoper</type>, <type>regoperator</type>, <type>regclass</type>,
<type>regtype</type>, <type>regrole</type>, <type>regnamespace</type>,
<type>regconfig</type>, and <type>regdictionary</type>.
- <xref linkend="datatype-oid-table"> shows an overview.
+ <xref linkend="datatype-oid-table"/> shows an overview.
</para>
<para>
<para>
(The system columns are further explained in <xref
- linkend="ddl-system-columns">.)
+ linkend="ddl-system-columns"/>.)
</para>
</sect1>
useful in situations where a function's behavior does not
correspond to simply taking or returning a value of a specific
<acronym>SQL</acronym> data type. <xref
- linkend="datatype-pseudotypes-table"> lists the existing
+ linkend="datatype-pseudotypes-table"/> lists the existing
pseudo-types.
</para>
<row>
<entry><type>anyelement</type></entry>
<entry>Indicates that a function accepts any data type
- (see <xref linkend="extend-types-polymorphic">).</entry>
+ (see <xref linkend="extend-types-polymorphic"/>).</entry>
</row>
<row>
<entry><type>anyarray</type></entry>
<entry>Indicates that a function accepts any array data type
- (see <xref linkend="extend-types-polymorphic">).</entry>
+ (see <xref linkend="extend-types-polymorphic"/>).</entry>
</row>
<row>
<entry><type>anynonarray</type></entry>
<entry>Indicates that a function accepts any non-array data type
- (see <xref linkend="extend-types-polymorphic">).</entry>
+ (see <xref linkend="extend-types-polymorphic"/>).</entry>
</row>
<row>
<entry><type>anyenum</type></entry>
<entry>Indicates that a function accepts any enum data type
- (see <xref linkend="extend-types-polymorphic"> and
- <xref linkend="datatype-enum">).</entry>
+ (see <xref linkend="extend-types-polymorphic"/> and
+ <xref linkend="datatype-enum"/>).</entry>
</row>
<row>
<entry><type>anyrange</type></entry>
<entry>Indicates that a function accepts any range data type
- (see <xref linkend="extend-types-polymorphic"> and
- <xref linkend="rangetypes">).</entry>
+ (see <xref linkend="extend-types-polymorphic"/> and
+ <xref linkend="rangetypes"/>).</entry>
</row>
<row>
<title>Date/Time Key Words</title>
<para>
- <xref linkend="datetime-month-table"> shows the tokens that are
+ <xref linkend="datetime-month-table"/> shows the tokens that are
recognized as names of months.
</para>
</table>
<para>
- <xref linkend="datetime-dow-table"> shows the tokens that are
+ <xref linkend="datetime-dow-table"/> shows the tokens that are
recognized as names of days of the week.
</para>
</table>
<para>
- <xref linkend="datetime-mod-table"> shows the tokens that serve
+ <xref linkend="datetime-mod-table"/> shows the tokens that serve
various modifier purposes.
</para>
Since timezone abbreviations are not well standardized,
<productname>PostgreSQL</productname> provides a means to customize
the set of abbreviations accepted by the server. The
- <xref linkend="guc-timezone-abbreviations"> run-time parameter
+ <xref linkend="guc-timezone-abbreviations"/> run-time parameter
determines the active set of abbreviations. While this parameter
can be altered by any database user, the possible values for it
are under the control of the database administrator — they
</para>
<para>
- See also <xref linkend="postgres-fdw">, which provides roughly the same
+ See also <xref linkend="postgres-fdw"/>, which provides roughly the same
functionality using a more modern and standards-compliant infrastructure.
</para>
server. It is recommended to use the foreign-data wrapper
<literal>dblink_fdw</literal> when defining the foreign
server. See the example below, as well as
- <xref linkend="sql-createserver"> and
- <xref linkend="sql-createusermapping">.
+ <xref linkend="sql-createserver"/> and
+ <xref linkend="sql-createusermapping"/>.
</para>
</refsect1>
<para><application>libpq</application>-style connection info string, for example
<literal>hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres
password=mypasswd</literal>.
- For details see <xref linkend="libpq-connstring">.
+ For details see <xref linkend="libpq-connstring"/>.
Alternatively, the name of a foreign server.
</para>
</listitem>
the unnamed connection, or on a named connection if specified.
To receive notifications via dblink, <function>LISTEN</function> must
first be issued, using <function>dblink_exec</function>.
- For details see <xref linkend="sql-listen"> and <xref linkend="sql-notify">.
+ For details see <xref linkend="sql-listen"/> and <xref linkend="sql-notify"/>.
</para>
</refsect1>
SQL does not make any guarantees about the order of the rows in a
table. When a table is read, the rows will appear in an unspecified order,
unless sorting is explicitly requested. This is covered in <xref
- linkend="queries">. Furthermore, SQL does not assign unique
+ linkend="queries"/>. Furthermore, SQL does not assign unique
identifiers to rows, so it is possible to have several completely
identical rows in a table. This is a consequence of the
mathematical model that underlies SQL but is usually not desirable.
built-in data types that fit many applications. Users can also
define their own data types. Most built-in data types have obvious
names and semantics, so we defer a detailed explanation to <xref
- linkend="datatype">. Some of the frequently used data types are
+ linkend="datatype"/>. Some of the frequently used data types are
<type>integer</type> for whole numbers, <type>numeric</type> for
possibly fractional numbers, <type>text</type> for character
strings, <type>date</type> for dates, <type>time</type> for
<para>
To create a table, you use the aptly named <xref
- linkend="sql-createtable"> command.
+ linkend="sql-createtable"/> command.
In this command you specify at least a name for the new table, the
names of the columns and the data type of each column. For
example:
<type>text</type>; the second column has the name
<literal>second_column</literal> and the type <type>integer</type>.
The table and column names follow the identifier syntax explained
- in <xref linkend="sql-syntax-identifiers">. The type names are
+ in <xref linkend="sql-syntax-identifiers"/>. The type names are
usually also identifiers, but there are some exceptions. Note that the
column list is comma-separated and surrounded by parentheses.
</para>
<para>
If you no longer need a table, you can remove it using the <xref
- linkend="sql-droptable"> command.
+ linkend="sql-droptable"/> command.
For example:
<programlisting>
DROP TABLE my_first_table;
<para>
If you need to modify a table that already exists, see <xref
- linkend="ddl-alter"> later in this chapter.
+ linkend="ddl-alter"/> later in this chapter.
</para>
<para>
tables. The remainder of this chapter is concerned with adding
features to the table definition to ensure data integrity,
security, or convenience. If you are eager to fill your tables with
- data now you can skip ahead to <xref linkend="dml"> and read the
+ data now you can skip ahead to <xref linkend="dml"/> and read the
rest of this chapter later.
</para>
</sect1>
columns will be filled with their respective default values. A
data manipulation command can also request explicitly that a column
be set to its default value, without having to know what that value is.
- (Details about data manipulation commands are in <xref linkend="dml">.)
+ (Details about data manipulation commands are in <xref linkend="dml"/>.)
</para>
<para>
</programlisting>
where the <literal>nextval()</literal> function supplies successive values
from a <firstterm>sequence object</firstterm> (see <xref
- linkend="functions-sequence">). This arrangement is sufficiently common
+ linkend="functions-sequence"/>). This arrangement is sufficiently common
that there's a special shorthand for it:
<programlisting>
CREATE TABLE products (
);
</programlisting>
The <literal>SERIAL</literal> shorthand is discussed further in <xref
- linkend="datatype-serial">.
+ linkend="datatype-serial"/>.
</para>
</sect1>
<para>
More information about updating and deleting data is in <xref
- linkend="dml">. Also see the description of foreign key constraint
+ linkend="dml"/>. Also see the description of foreign key constraint
syntax in the reference documentation for
- <xref linkend="sql-createtable">.
+ <xref linkend="sql-createtable"/>.
</para>
</sect2>
</indexterm>
The object identifier (object ID) of a row. This column is only
present if the table was created using <literal>WITH
- OIDS</literal>, or if the <xref linkend="guc-default-with-oids">
+ OIDS</literal>, or if the <xref linkend="guc-default-with-oids"/>
configuration variable was set at the time. This column is of type
<type>oid</type> (same name as the column); see <xref
- linkend="datatype-oid"> for more information about the type.
+ linkend="datatype-oid"/> for more information about the type.
</para>
</listitem>
</varlistentry>
<para>
The OID of the table containing this row. This column is
particularly handy for queries that select from inheritance
- hierarchies (see <xref linkend="ddl-inherit">), since without it,
+ hierarchies (see <xref linkend="ddl-inherit"/>), since without it,
it's difficult to tell which individual table a row came from. The
<structfield>tableoid</structfield> can be joined against the
<structfield>oid</structfield> column of
Transaction identifiers are also 32-bit quantities. In a
long-lived database it is possible for transaction IDs to wrap
around. This is not a fatal problem given appropriate maintenance
- procedures; see <xref linkend="maintenance"> for details. It is
+ procedures; see <xref linkend="maintenance"/> for details. It is
unwise, however, to depend on the uniqueness of transaction IDs
over the long term (more than one billion transactions).
</para>
</itemizedlist>
All these actions are performed using the
- <xref linkend="sql-altertable">
+ <xref linkend="sql-altertable"/>
command, whose reference page contains details beyond those given
here.
</para>
<programlisting>
ALTER TABLE products DROP COLUMN description CASCADE;
</programlisting>
- See <xref linkend="ddl-depend"> for a description of the general
+ See <xref linkend="ddl-depend"/> for a description of the general
mechanism behind this.
</para>
</sect2>
object vary depending on the object's type (table, function, etc).
For complete information on the different types of privileges
supported by <productname>PostgreSQL</productname>, refer to the
- <xref linkend="sql-grant"> reference
+ <xref linkend="sql-grant"/> reference
page. The following sections and chapters will also show you how
those privileges are used.
</para>
<para>
An object can be assigned to a new owner with an <command>ALTER</command>
command of the appropriate kind for the object, e.g. <xref
- linkend="sql-altertable">. Superusers can always do
+ linkend="sql-altertable"/>. Superusers can always do
this; ordinary roles can only do it if they are both the current owner
of the object (or a member of the owning role) and a member of the new
owning role.
be used to grant a privilege to every role on the system. Also,
<quote>group</quote> roles can be set up to help manage privileges when
there are many users of a database — for details see
- <xref linkend="user-manag">.
+ <xref linkend="user-manag"/>.
</para>
<para>
the right to grant it in turn to others. If the grant option is
subsequently revoked then all who received the privilege from that
recipient (directly or through a chain of grants) will lose the
- privilege. For details see the <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke"> reference pages.
+ privilege. For details see the <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/> reference pages.
</para>
</sect1>
<para>
In addition to the SQL-standard <link linkend="ddl-priv">privilege
- system</link> available through <xref linkend="sql-grant">,
+ system</link> available through <xref linkend="sql-grant"/>,
tables can have <firstterm>row security policies</firstterm> that restrict,
on a per-user basis, which rows can be returned by normal queries
or inserted, updated, or deleted by data modification commands.
</para>
<para>
- Policies are created using the <xref linkend="sql-createpolicy">
- command, altered using the <xref linkend="sql-alterpolicy"> command,
- and dropped using the <xref linkend="sql-droppolicy"> command. To
+ Policies are created using the <xref linkend="sql-createpolicy"/>
+ command, altered using the <xref linkend="sql-alterpolicy"/> command,
+ and dropped using the <xref linkend="sql-droppolicy"/> command. To
enable and disable row security for a given table, use the
- <xref linkend="sql-altertable"> command.
+ <xref linkend="sql-altertable"/> command.
</para>
<para>
not being applied. For example, when taking a backup, it could be
disastrous if row security silently caused some rows to be omitted
from the backup. In such a situation, you can set the
- <xref linkend="guc-row-security"> configuration parameter
+ <xref linkend="guc-row-security"/> configuration parameter
to <literal>off</literal>. This does not in itself bypass row security;
what it does is throw an error if any query's results would get filtered
by a policy. The reason for the error can then be investigated and
</para>
<para>
- For additional details see <xref linkend="sql-createpolicy">
- and <xref linkend="sql-altertable">.
+ For additional details see <xref linkend="sql-createpolicy"/>
+ and <xref linkend="sql-altertable"/>.
</para>
</sect1>
</indexterm>
<para>
- To create a schema, use the <xref linkend="sql-createschema">
+ To create a schema, use the <xref linkend="sql-createschema"/>
command. Give the schema a name
of your choice. For example:
<programlisting>
<programlisting>
DROP SCHEMA myschema CASCADE;
</programlisting>
- See <xref linkend="ddl-depend"> for a description of the general
+ See <xref linkend="ddl-depend"/> for a description of the general
mechanism behind this.
</para>
</programlisting>
You can even omit the schema name, in which case the schema name
will be the same as the user name. See <xref
- linkend="ddl-schemas-patterns"> for how this can be useful.
+ linkend="ddl-schemas-patterns"/> for how this can be useful.
</para>
<para>
</para>
<para>
- See also <xref linkend="functions-info"> for other ways to manipulate
+ See also <xref linkend="functions-info"/> for other ways to manipulate
the schema search path.
</para>
<quote>public</quote> means <quote>every user</quote>. In the
first sense it is an identifier, in the second sense it is a
key word, hence the different capitalization; recall the
- guidelines from <xref linkend="sql-syntax-identifiers">.)
+ guidelines from <xref linkend="sql-syntax-identifiers"/>.)
</para>
</sect2>
</programlisting>
Given the sample data from the <productname>PostgreSQL</productname>
- tutorial (see <xref linkend="tutorial-sql-intro">), this returns:
+ tutorial (see <xref linkend="tutorial-sql-intro"/>), this returns:
<programlisting>
name | altitude
<structname>capitals</structname> table, but this does not happen:
<command>INSERT</command> always inserts into exactly the table
specified. In some cases it is possible to redirect the insertion
- using a rule (see <xref linkend="rules">). However that does not
+ using a rule (see <xref linkend="rules"/>). However that does not
help for the above case because the <structname>cities</structname> table
does not contain the column <structfield>state</structfield>, and so the
command will be rejected before the rule can be applied.
<para>
Table inheritance is typically established when the child table is
created, using the <literal>INHERITS</literal> clause of the
- <xref linkend="sql-createtable">
+ <xref linkend="sql-createtable"/>
statement.
Alternatively, a table which is already defined in a compatible way can
have a new parent relationship added, using the <literal>INHERIT</literal>
- variant of <xref linkend="sql-altertable">.
+ variant of <xref linkend="sql-altertable"/>.
To do this the new child table must already include columns with
the same names and types as the columns of the parent. It must also include
check constraints with the same names and check expressions as those of the
<literal>NO INHERIT</literal> variant of <command>ALTER TABLE</command>.
Dynamically adding and removing inheritance links like this can be useful
when the inheritance relationship is being used for table
- partitioning (see <xref linkend="ddl-partitioning">).
+ partitioning (see <xref linkend="ddl-partitioning"/>).
</para>
<para>
if they are inherited
from any parent tables. If you wish to remove a table and all of its
descendants, one easy way is to drop the parent table with the
- <literal>CASCADE</literal> option (see <xref linkend="ddl-depend">).
+ <literal>CASCADE</literal> option (see <xref linkend="ddl-depend"/>).
</para>
<para>
- <xref linkend="sql-altertable"> will
+ <xref linkend="sql-altertable"/> will
propagate any changes in column data definitions and check
constraints down the inheritance hierarchy. Again, dropping
columns that are depended on by other tables is only possible when using
that the data is (also) in the parent table. But
the <structname>capitals</structname> table could not be updated directly
without an additional grant. In a similar way, the parent table's row
- security policies (see <xref linkend="ddl-rowsecurity">) are applied to
+ security policies (see <xref linkend="ddl-rowsecurity"/>) are applied to
rows coming from child tables during an inherited query. A child table's
policies, if any, are applied only when it is the table explicitly named
in the query; and in that case, any policies attached to its parent(s) are
</para>
<para>
- Foreign tables (see <xref linkend="ddl-foreign-data">) can also
+ Foreign tables (see <xref linkend="ddl-foreign-data"/>) can also
be part of inheritance hierarchies, either as parent or child
tables, just as regular tables can be. If a foreign table is part
of an inheritance hierarchy then any operations not supported by
typically only work on individual, physical tables and do not
support recursing over inheritance hierarchies. The respective
behavior of each individual command is documented in its reference
- page (<xref linkend="sql-commands">).
+ page (<xref linkend="sql-commands"/>).
</para>
<para>
called <firstterm>sub-partitioning</firstterm>. Partitions may have their
own indexes, constraints and default values, distinct from those of other
partitions. Indexes must be created separately for each partition. See
- <xref linkend="sql-createtable"> for more details on creating partitioned
+ <xref linkend="sql-createtable"/> for more details on creating partitioned
tables and partitions.
</para>
vice versa. However, it is possible to add a regular or partitioned table
containing data as a partition of a partitioned table, or remove a
partition from a partitioned table turning it into a standalone table;
- see <xref linkend="sql-altertable"> to learn more about the
+ see <xref linkend="sql-altertable"/> to learn more about the
<command>ATTACH PARTITION</command> and <command>DETACH PARTITION</command>
sub-commands.
</para>
inheritance with regular tables. Since a partition hierarchy consisting
of the partitioned table and its partitions is still an inheritance
hierarchy, all the normal rules of inheritance apply as described in
- <xref linkend="ddl-inherit"> with some exceptions, most notably:
+ <xref linkend="ddl-inherit"/> with some exceptions, most notably:
<itemizedlist>
<listitem>
<para>
Partitions can also be foreign tables
- (see <xref linkend="sql-createforeigntable">),
+ (see <xref linkend="sql-createforeigntable"/>),
although these have some limitations that normal tables do not. For
example, data inserted into the partitioned table is not routed to
foreign table partitions.
<listitem>
<para>
- Ensure that the <xref linkend="guc-constraint-exclusion">
+ Ensure that the <xref linkend="guc-constraint-exclusion"/>
configuration parameter is not disabled in <filename>postgresql.conf</filename>.
If it is, queries will not be optimized as desired.
</para>
<listitem>
<para>
- Ensure that the <xref linkend="guc-constraint-exclusion">
+ Ensure that the <xref linkend="guc-constraint-exclusion"/>
configuration parameter is not disabled in
<filename>postgresql.conf</filename>.
If it is, queries will not be optimized as desired.
<para>
The default (and recommended) setting of
- <xref linkend="guc-constraint-exclusion"> is actually neither
+ <xref linkend="guc-constraint-exclusion"/> is actually neither
<literal>on</literal> nor <literal>off</literal>, but an intermediate setting
called <literal>partition</literal>, which causes the technique to be
applied only to queries that are likely to be working on partitioned
library that can communicate with an external data source, hiding the
details of connecting to the data source and obtaining data from it.
There are some foreign data wrappers available as <filename>contrib</filename>
- modules; see <xref linkend="contrib">. Other kinds of foreign data
+ modules; see <xref linkend="contrib"/>. Other kinds of foreign data
wrappers might be found as third party products. If none of the existing
foreign data wrappers suit your needs, you can write your own; see <xref
- linkend="fdwhandler">.
+ linkend="fdwhandler"/>.
</para>
<para>
<para>
For additional information, see
- <xref linkend="sql-createforeigndatawrapper">,
- <xref linkend="sql-createserver">,
- <xref linkend="sql-createusermapping">,
- <xref linkend="sql-createforeigntable">, and
- <xref linkend="sql-importforeignschema">.
+ <xref linkend="sql-createforeigndatawrapper"/>,
+ <xref linkend="sql-createserver"/>,
+ <xref linkend="sql-createusermapping"/>,
+ <xref linkend="sql-createforeigntable"/>, and
+ <xref linkend="sql-importforeignschema"/>.
</para>
</sect1>
<para>
Detailed information on
- these topics appears in <xref linkend="server-programming">.
+ these topics appears in <xref linkend="server-programming"/>.
</para>
</sect1>
<productname>PostgreSQL</productname> makes sure that you cannot
drop objects that other objects still depend on. For example,
attempting to drop the products table we considered in <xref
- linkend="ddl-constraints-fk">, with the orders table depending on
+ linkend="ddl-constraints-fk"/>, with the orders table depending on
it, would result in an error message like this:
<screen>
DROP TABLE products;
LANGUAGE SQL;
</programlisting>
- (See <xref linkend="xfunc-sql"> for an explanation of SQL-language
+ (See <xref linkend="xfunc-sql"/> for an explanation of SQL-language
functions.) <productname>PostgreSQL</productname> will be aware that
the <function>get_color_note</function> function depends on the <type>rainbow</type>
type: dropping the type would force dropping the function, because its
</para>
<para>
- Refer back to <xref linkend="xfunc-c-dynload"> about where the
+ Refer back to <xref linkend="xfunc-c-dynload"/> about where the
server expects to find the shared library files.
</para>
</programlisting>
but real-world usage will involve including it in a text search
- configuration as described in <xref linkend="textsearch">.
+ configuration as described in <xref linkend="textsearch"/>.
That might look like this:
<programlisting>
</programlisting>
Real-world usage will involve including it in a text search
- configuration as described in <xref linkend="textsearch">.
+ configuration as described in <xref linkend="textsearch"/>.
That might look like this:
<programlisting>
stored. If the table has any columns with potentially-wide values,
there also might be a <acronym>TOAST</acronym> file associated with the table,
which is used to store values too wide to fit comfortably in the main
- table (see <xref linkend="storage-toast">). There will be one valid index
+ table (see <xref linkend="storage-toast"/>). There will be one valid index
on the <acronym>TOAST</acronym> table, if present. There also might be indexes
associated with the base table. Each table and index is stored in a
separate disk file — possibly more than one file, if the file would
exceed one gigabyte. Naming conventions for these files are described
- in <xref linkend="storage-file-layout">.
+ in <xref linkend="storage-file-layout"/>.
</para>
<para>
You can monitor disk space in three ways:
- using the SQL functions listed in <xref linkend="functions-admin-dbsize">,
- using the <xref linkend="oid2name"> module, or
+ using the SQL functions listed in <xref linkend="functions-admin-dbsize"/>,
+ using the <xref linkend="oid2name"/> module, or
using manual inspection of the system catalogs.
The SQL functions are the easiest to use and are generally recommended.
The remainder of this section shows how to do it by inspection of the
If you cannot free up additional space on the disk by deleting
other things, you can move some of the database files to other file
systems by making use of tablespaces. See <xref
- linkend="manage-ag-tablespaces"> for more information about that.
+ linkend="manage-ag-tablespaces"/> for more information about that.
</para>
<tip>
</para>
<para>
- To create a new row, use the <xref linkend="sql-insert">
+ To create a new row, use the <xref linkend="sql-insert"/>
command. The command requires the
table name and column values. For
- example, consider the products table from <xref linkend="ddl">:
+ example, consider the products table from <xref linkend="ddl"/>:
<programlisting>
CREATE TABLE products (
product_no integer,
WHERE release_date = 'today';
</programlisting>
This provides the full power of the SQL query mechanism (<xref
- linkend="queries">) for computing the rows to be inserted.
+ linkend="queries"/>) for computing the rows to be inserted.
</para>
<tip>
<para>
When inserting a lot of data at the same time, considering using
- the <xref linkend="sql-copy"> command.
- It is not as flexible as the <xref linkend="sql-insert">
+ the <xref linkend="sql-copy"/> command.
+ It is not as flexible as the <xref linkend="sql-insert"/>
command, but is more efficient. Refer
- to <xref linkend="populate"> for more information on improving
+ to <xref linkend="populate"/> for more information on improving
bulk loading performance.
</para>
</tip>
</para>
<para>
- To update existing rows, use the <xref linkend="sql-update">
+ To update existing rows, use the <xref linkend="sql-update"/>
command. This requires
three pieces of information:
<orderedlist spacing="compact">
</para>
<para>
- Recall from <xref linkend="ddl"> that SQL does not, in general,
+ Recall from <xref linkend="ddl"/> that SQL does not, in general,
provide a unique identifier for rows. Therefore it is not
always possible to directly specify which row to update.
Instead, you specify which conditions a row must meet in order to
this does not create any ambiguity. Of course, the
<literal>WHERE</literal> condition does
not have to be an equality test. Many other operators are
- available (see <xref linkend="functions">). But the expression
+ available (see <xref linkend="functions"/>). But the expression
needs to evaluate to a Boolean result.
</para>
</para>
<para>
- You use the <xref linkend="sql-delete">
+ You use the <xref linkend="sql-delete"/>
command to remove rows; the syntax is very similar to the
<command>UPDATE</command> command. For instance, to remove all
rows from the products table that have a price of 10, use:
<para>
The allowed contents of a <literal>RETURNING</literal> clause are the same as
a <command>SELECT</command> command's output list
- (see <xref linkend="queries-select-lists">). It can contain column
+ (see <xref linkend="queries-select-lists"/>). It can contain column
names of the command's target table, or value expressions using those
columns. A common shorthand is <literal>RETURNING *</literal>, which selects
all columns of the target table in order.
</para>
<para>
- If there are triggers (<xref linkend="triggers">) on the target table,
+ If there are triggers (<xref linkend="triggers"/>) on the target table,
the data available to <literal>RETURNING</literal> is the row as modified by
the triggers. Thus, inspecting columns computed by triggers is another
common use-case for <literal>RETURNING</literal>.
<para>
The documentation sources are written in
<firstterm>DocBook</firstterm>, which is a markup language
- superficially similar to <acronym>HTML</acronym>. Both of these
- languages are applications of the <firstterm>Standard Generalized
- Markup Language</firstterm>, <acronym>SGML</acronym>, which is
- essentially a language for describing other languages. In what
- follows, the terms DocBook and <acronym>SGML</acronym> are both
+ defined in <acronym>XML</acronym>. In what
+ follows, the terms DocBook and <acronym>XML</acronym> are both
used, but technically they are not interchangeable.
</para>
- <note>
- <para>
- The PostgreSQL documentation is currently being transitioned from DocBook
- SGML and DSSSL style sheets to DocBook XML and XSLT style sheets. Be
- careful to look at the instructions relating to the PostgreSQL version you
- are dealing with, as the procedures and required tools will change.
- </para>
- </note>
-
<para>
<productname>DocBook</productname> allows an author to specify the
structure and content of a technical document without worrying
<para>
This is the definition of DocBook itself. We currently use version
4.2; you cannot use later or earlier versions. You need
- the <acronym>SGML</acronym> and the <acronym>XML</acronym> variant of
- the DocBook DTD of the same version. These will usually be in separate
- packages.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><ulink url="http://www.oasis-open.org/cover/ISOEnts.zip">ISO 8879 character entities</ulink></term>
- <listitem>
- <para>
- These are required by DocBook SGML but are distributed separately
- because they are maintained by ISO.
+ the <acronym>XML</acronym> variant of the DocBook DTD, not
+ the <acronym>SGML</acronym> variant.
</para>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
- <varlistentry>
- <term><ulink url="http://openjade.sourceforge.net">OpenSP</ulink></term>
- <listitem>
- <para>
- This is the base package of <acronym>SGML</acronym> processing. Note
- that we no longer need OpenJade, the <acronym>DSSSL</acronym>
- processor, only the OpenSP package for converting SGML to XML.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term><ulink url="http://xmlsoft.org/">Libxml2</ulink> for <command>xmllint</command></term>
<listitem>
<para>
To install the required packages, use:
<programlisting>
-yum install docbook-dtds docbook-style-xsl fop libxslt opensp
+yum install docbook-dtds docbook-style-xsl fop libxslt
</programlisting>
</para>
</sect2>
<sect2>
<title>Installation on FreeBSD</title>
- <para>
- The FreeBSD Documentation Project is itself a heavy user of
- DocBook, so it comes as no surprise that there is a full set of
- <quote>ports</quote> of the documentation tools available on
- FreeBSD. The following ports need to be installed to build the
- documentation on FreeBSD.
- <itemizedlist>
- <listitem>
- <para><filename>textproc/docbook-sgml</filename></para>
- </listitem>
- <listitem>
- <para><filename>textproc/docbook-xml</filename></para>
- </listitem>
- <listitem>
- <para><filename>textproc/docbook-xsl</filename></para>
- </listitem>
- <listitem>
- <para><filename>textproc/dsssl-docbook-modular</filename></para>
- </listitem>
- <listitem>
- <para><filename>textproc/libxslt</filename></para>
- </listitem>
- <listitem>
- <para><filename>textproc/fop</filename></para>
- </listitem>
- <listitem>
- <para><filename>textproc/opensp</filename></para>
- </listitem>
- </itemizedlist>
- </para>
-
<para>
To install the required packages with <command>pkg</command>, use:
<programlisting>
-pkg install docbook-sgml docbook-xml docbook-xsl fop libxslt opensp
+pkg install docbook-xml docbook-xsl fop libxslt
</programlisting>
</para>
available for <productname>Debian GNU/Linux</productname>.
To install, simply use:
<programlisting>
-apt-get install docbook docbook-xml docbook-xsl fop libxml2-utils opensp xsltproc
+apt-get install docbook-xml docbook-xsl fop libxml2-utils xsltproc
</programlisting>
</para>
</sect2>
<title>macOS</title>
<para>
- If you use MacPorts, the following will get you set up:
-<programlisting>
-sudo port install docbook-sgml-4.2 docbook-xml-4.2 docbook-xsl fop libxslt opensp
-</programlisting>
+ On macOS, you can build the HTML and man documentation without installing
+ anything extra. If you want to build PDFs or want to install a local copy
+ of DocBook, you can get those from your preferred package manager.
</para>
- </sect2>
-
- <sect2>
- <title>Manual Installation from Source</title>
<para>
- The manual installation process of the DocBook tools is somewhat
- complex, so if you have pre-built packages available, use them.
- We describe here only a standard setup, with reasonably standard
- installation paths, and no <quote>fancy</quote> features. For
- details, you should study the documentation of the respective
- package, and read <acronym>SGML</acronym> introductory material.
- </para>
-
- <sect3>
- <title>Installing OpenSP</title>
-
- <para>
- The installation of OpenSP offers a GNU-style
- <literal>./configure; make; make install</literal> build process.
- Details can be found in the OpenSP source distribution. In a nutshell:
-<synopsis>
-./configure --enable-default-catalog=/usr/local/etc/sgml/catalog
-make
-make install
-</synopsis>
- Be sure to remember where you put the <quote>default catalog</quote>; you
- will need it below. You can also leave it off, but then you will have to
- set the environment variable <envar>SGML_CATALOG_FILES</envar> to point
- to the file whenever you use any programs from OpenSP later on. (This
- method is also an option if OpenSP is already installed and you want to
- install the rest of the toolchain locally.)
- </para>
- </sect3>
-
- <sect3>
- <title>Installing the <productname>DocBook</productname> <acronym>DTD</acronym> Kit</title>
-
- <procedure>
- <step>
- <para>
- Obtain the <ulink url="http://www.docbook.org/sgml/4.2/docbook-4.2.zip">
- DocBook V4.2 distribution</ulink>.
- </para>
- </step>
-
- <step>
- <para>
- Create the directory
- <filename>/usr/local/share/sgml/docbook-4.2</filename> and change
- to it. (The exact location is irrelevant, but this one is
- reasonable within the layout we are following here.)
-<screen>
-<prompt>$ </prompt><userinput>mkdir /usr/local/share/sgml/docbook-4.2</userinput>
-<prompt>$ </prompt><userinput>cd /usr/local/share/sgml/docbook-4.2</userinput>
-</screen>
- </para>
- </step>
-
- <step>
- <para>
- Unpack the archive:
-<screen>
-<prompt>$ </prompt><userinput>unzip -a ...../docbook-4.2.zip</userinput>
-</screen>
- (The archive will unpack its files into the current directory.)
- </para>
- </step>
-
- <step>
- <para>
- Edit the file
- <filename>/usr/local/share/sgml/catalog</filename> (or whatever
- you told jade during installation) and put a line like this
- into it:
+ If you use MacPorts, the following will get you set up:
<programlisting>
-CATALOG "docbook-4.2/docbook.cat"
+sudo port install docbook-xml-4.2 docbook-xsl fop
</programlisting>
- </para>
- </step>
-
- <step>
- <para>
- Download the <ulink url="http://www.oasis-open.org/cover/ISOEnts.zip">
- ISO 8879 character entities archive</ulink>, unpack it, and put the
- files in the same directory you put the DocBook files in:
-<screen>
-<prompt>$ </prompt><userinput>cd /usr/local/share/sgml/docbook-4.2</userinput>
-<prompt>$ </prompt><userinput>unzip ...../ISOEnts.zip</userinput>
-</screen>
- </para>
- </step>
-
- <step>
- <para>
- Run the following command in the directory with the DocBook and ISO files:
+ If you use Homebrew, use this:
<programlisting>
-perl -pi -e 's/iso-(.*).gml/ISO\1/g' docbook.cat
+brew install docbook docbook-xsl fop
</programlisting>
- (This fixes a mixup between the names used in the DocBook
- catalog file and the actual names of the ISO character entity
- files.)
- </para>
- </step>
- </procedure>
- </sect3>
+ </para>
</sect2>
<sect2 id="docguide-toolsets-configure">
Check the output near the end of the run, it should look something
like this:
<screen>
-<computeroutput>
-checking for onsgmls... onsgmls
-checking for DocBook V4.2... yes
-checking for dbtoepub... dbtoepub
checking for xmllint... xmllint
+checking for DocBook XML V4.2... yes
+checking for dbtoepub... dbtoepub
checking for xsltproc... xsltproc
-checking for osx... osx
checking for fop... fop
-</computeroutput>
</screen>
- If neither <filename>onsgmls</filename> nor
- <filename>nsgmls</filename> were found then some of the following tests
- will be skipped. <filename>nsgmls</filename> is part of the OpenSP
- package. You can pass the environment variable
- <envar>NSGMLS</envar> to configure to point
- to the programs if they are not found automatically. If
- <quote>DocBook V4.2</quote> was not found then you did not install
- the DocBook DTD kit in a place where OpenSP can find it, or you have
- not set up the catalog files correctly. See the installation hints
- above.
+ If <filename>xmllint</filename> was not found then some of the following
+ tests will be skipped.
</para>
</sect2>
We use the DocBook XSL stylesheets to
convert <productname>DocBook</productname>
<sgmltag>refentry</sgmltag> pages to *roff output suitable for man
- pages. The man pages are also distributed as a tar archive,
- similar to the <acronym>HTML</acronym> version. To create the man
- pages, use the commands:
+ pages. To create the man pages, use the command:
<screen>
<prompt>doc/src/sgml$ </prompt><userinput>make man</userinput>
</screen>
The installation instructions are also distributed as plain text,
in case they are needed in a situation where better reading tools
are not available. The <filename>INSTALL</filename> file
- corresponds to <xref linkend="installation">, with some minor
+ corresponds to <xref linkend="installation"/>, with some minor
changes to account for the different context. To recreate the
file, change to the directory <filename>doc/src/sgml</filename>
and enter <userinput>make INSTALL</userinput>.
<para>
The provided functions are shown
- in <xref linkend="earthdistance-cube-functions">.
+ in <xref linkend="earthdistance-cube-functions"/>.
</para>
<table id="earthdistance-cube-functions">
<para>
A single operator is provided, shown
- in <xref linkend="earthdistance-point-operators">.
+ in <xref linkend="earthdistance-point-operators"/>.
</para>
<table id="earthdistance-point-operators">
specially marked sections. To build the program, the source code (<filename>*.pgc</filename>)
is first passed through the embedded SQL preprocessor, which converts it
to an ordinary C program (<filename>*.c</filename>), and afterwards it can be processed by a C
- compiler. (For details about the compiling and linking see <xref linkend="ecpg-process">).
+ compiler. (For details about the compiling and linking see <xref linkend="ecpg-process"/>).
Converted ECPG applications call functions in the libpq library
through the embedded SQL library (ecpglib), and communicate with
the PostgreSQL server using the normal frontend-backend protocol.
row can also be executed using
<literal>EXEC SQL</literal> directly. To handle result sets with
multiple rows, an application has to use a cursor;
- see <xref linkend="ecpg-cursors"> below. (As a special case, an
+ see <xref linkend="ecpg-cursors"/> below. (As a special case, an
application can fetch multiple rows at once into an array host
- variable; see <xref linkend="ecpg-variables-arrays">.)
+ variable; see <xref linkend="ecpg-variables-arrays"/>.)
</para>
<para>
<literal>:<replaceable>something</replaceable></literal> are
<firstterm>host variables</firstterm>, that is, they refer to
variables in the C program. They are explained in <xref
- linkend="ecpg-variables">.
+ linkend="ecpg-variables"/>.
</para>
</sect2>
<para>
For more details about declaration of the cursor,
- see <xref linkend="ecpg-sql-declare">, and
- see <xref linkend="sql-fetch"> for <literal>FETCH</literal> command
+ see <xref linkend="ecpg-sql-declare"/>, and
+ see <xref linkend="sql-fetch"/> for <literal>FETCH</literal> command
details.
</para>
interface also supports autocommit of transactions (similar to
<application>psql</application>'s default behavior) via the <option>-t</option>
command-line option to <command>ecpg</command> (see <xref
- linkend="app-ecpg">) or via the <literal>EXEC SQL SET AUTOCOMMIT TO
+ linkend="app-ecpg"/>) or via the <literal>EXEC SQL SET AUTOCOMMIT TO
ON</literal> statement. In autocommit mode, each command is
automatically committed unless it is inside an explicit transaction
block. This mode can be explicitly turned off using <literal>EXEC
<para>
For more details about <literal>PREPARE</literal>,
- see <xref linkend="ecpg-sql-prepare">. Also
- see <xref linkend="ecpg-dynamic"> for more details about using
+ see <xref linkend="ecpg-sql-prepare"/>. Also
+ see <xref linkend="ecpg-dynamic"/> for more details about using
placeholders and input parameters.
</para>
</sect2>
<title>Using Host Variables</title>
<para>
- In <xref linkend="ecpg-commands"> you saw how you can execute SQL
+ In <xref linkend="ecpg-commands"/> you saw how you can execute SQL
statements from an embedded SQL program. Some of those statements
only used fixed values and did not provide a way to insert
user-supplied values into statements or have the program process
<para>
Another way to exchange values between PostgreSQL backends and ECPG
applications is the use of SQL descriptors, described
- in <xref linkend="ecpg-descriptors">.
+ in <xref linkend="ecpg-descriptors"/>.
</para>
<sect2 id="ecpg-variables-overview">
directly. Other PostgreSQL data types, such
as <type>timestamp</type> and <type>numeric</type> can only be
accessed through special library functions; see
- <xref linkend="ecpg-special-types">.
+ <xref linkend="ecpg-special-types"/>.
</para>
<para>
- <xref linkend="ecpg-datatype-hostvars-table"> shows which PostgreSQL
+ <xref linkend="ecpg-datatype-hostvars-table"/> shows which PostgreSQL
data types correspond to which C data types. When you wish to
send or receive a value of a given PostgreSQL data type, you
should declare a C variable of the corresponding C data type in
<row>
<entry><type>decimal</type></entry>
- <entry><type>decimal</type><footnote id="ecpg-datatype-table-fn"><para>This type can only be accessed through special library functions; see <xref linkend="ecpg-special-types">.</para></footnote></entry>
+ <entry><type>decimal</type><footnote id="ecpg-datatype-table-fn"><para>This type can only be accessed through special library functions; see <xref linkend="ecpg-special-types"/>.</para></footnote></entry>
</row>
<row>
<entry><type>numeric</type></entry>
- <entry><type>numeric</type><footnoteref linkend="ecpg-datatype-table-fn"></entry>
+ <entry><type>numeric</type><footnoteref linkend="ecpg-datatype-table-fn"/></entry>
</row>
<row>
<row>
<entry><type>timestamp</type></entry>
- <entry><type>timestamp</type><footnoteref linkend="ecpg-datatype-table-fn"></entry>
+ <entry><type>timestamp</type><footnoteref linkend="ecpg-datatype-table-fn"/></entry>
</row>
<row>
<entry><type>interval</type></entry>
- <entry><type>interval</type><footnoteref linkend="ecpg-datatype-table-fn"></entry>
+ <entry><type>interval</type><footnoteref linkend="ecpg-datatype-table-fn"/></entry>
</row>
<row>
<entry><type>date</type></entry>
- <entry><type>date</type><footnoteref linkend="ecpg-datatype-table-fn"></entry>
+ <entry><type>date</type><footnoteref linkend="ecpg-datatype-table-fn"/></entry>
</row>
<row>
structure. Applications deal with these types by declaring host
variables in special types and accessing them using functions in
the pgtypes library. The pgtypes library, described in detail
- in <xref linkend="ecpg-pgtypes"> contains basic functions to deal
+ in <xref linkend="ecpg-pgtypes"/> contains basic functions to deal
with those types, such that you do not need to send a query to
the SQL server just for adding an interval to a time stamp for
example.
<para>
The follow subsections describe these special data types. For
more details about pgtypes library functions,
- see <xref linkend="ecpg-pgtypes">.
+ see <xref linkend="ecpg-pgtypes"/>.
</para>
<sect4>
program has to include <filename>pgtypes_date.h</filename>, declare a host variable
as the date type and convert a DATE value into a text form using
<function>PGTYPESdate_to_asc()</function> function. For more details about the
- pgtypes library functions, see <xref linkend="ecpg-pgtypes">.
+ pgtypes library functions, see <xref linkend="ecpg-pgtypes"/>.
</para>
</sect4>
allocating some memory space on the heap, and accessing the
variable using the pgtypes library functions. For more details
about the pgtypes library functions,
- see <xref linkend="ecpg-pgtypes">.
+ see <xref linkend="ecpg-pgtypes"/>.
</para>
<para>
There are two use cases for arrays as host variables. The first
is a way to store some text string in <type>char[]</type>
or <type>VARCHAR[]</type>, as
- explained in <xref linkend="ecpg-char">. The second use case is to
+ explained in <xref linkend="ecpg-char"/>. The second use case is to
retrieve multiple rows from a query result without using a
cursor. Without an array, to process a query result consisting
of multiple rows, it is required to use a cursor and
<para>
You can declare pointers to the most common types. Note however
that you cannot use pointers as target variables of queries
- without auto-allocation. See <xref linkend="ecpg-descriptors">
+ without auto-allocation. See <xref linkend="ecpg-descriptors"/>
for more information on auto-allocation.
</para>
Another workaround is to store arrays in their external string
representation in host variables of type <type>char[]</type>
or <type>VARCHAR[]</type>. For more details about this
- representation, see <xref linkend="arrays-input">. Note that
+ representation, see <xref linkend="arrays-input"/>. Note that
this means that the array cannot be accessed naturally as an
array in the host program (without further processing that parses
the text representation).
To enhance this example, the host variables to store values in
the <command>FETCH</command> command can be gathered into one
structure. For more details about the host variable in the
- structure form, see <xref linkend="ecpg-variables-struct">.
+ structure form, see <xref linkend="ecpg-variables-struct"/>.
To switch to the structure, the example can be modified as below.
The two host variables, <varname>intval</varname>
and <varname>textval</varname>, become members of
<para>
Here is an example using the data type <type>complex</type> from
- the example in <xref linkend="xtypes">. The external string
+ the example in <xref linkend="xtypes"/>. The external string
representation of that type is <literal>(%lf,%lf)</literal>,
which is defined in the
functions <function>complex_in()</function>
and <function>complex_out()</function> functions
- in <xref linkend="xtypes">. The following example inserts the
+ in <xref linkend="xtypes"/>. The following example inserts the
complex type values <literal>(1,1)</literal>
and <literal>(3,3)</literal> into the
columns <literal>a</literal> and <literal>b</literal>, and select
<para>
If a query is expected to return more than one result row, a
cursor should be used, as in the following example.
- (See <xref linkend="ecpg-cursors"> for more details about the
+ (See <xref linkend="ecpg-cursors"/> for more details about the
cursor.)
<programlisting>
EXEC SQL BEGIN DECLARE SECTION;
<title>The numeric Type</title>
<para>
The numeric type offers to do calculations with arbitrary precision. See
- <xref linkend="datatype-numeric"> for the equivalent type in the
+ <xref linkend="datatype-numeric"/> for the equivalent type in the
<productname>PostgreSQL</productname> server. Because of the arbitrary precision this
variable needs to be able to expand and shrink dynamically. That's why you
can only create numeric variables on the heap, by means of the
<title>The date Type</title>
<para>
The date type in C enables your programs to deal with data of the SQL type
- date. See <xref linkend="datatype-datetime"> for the equivalent type in the
+ date. See <xref linkend="datatype-datetime"/> for the equivalent type in the
<productname>PostgreSQL</productname> server.
</para>
<para>
currently no variable to change that within ECPG.
</para>
<para>
- <xref linkend="ecpg-pgtypesdate-from-asc-table"> shows the allowed input formats.
+ <xref linkend="ecpg-pgtypesdate-from-asc-table"/> shows the allowed input formats.
</para>
<table id="ecpg-pgtypesdate-from-asc-table">
<title>Valid Input Formats for <function>PGTYPESdate_from_asc</function></title>
All other characters are copied 1:1 to the output string.
</para>
<para>
- <xref linkend="ecpg-pgtypesdate-fmt-asc-example-table"> indicates a few possible formats. This will give
+ <xref linkend="ecpg-pgtypesdate-fmt-asc-example-table"/> indicates a few possible formats. This will give
you an idea of how to use this function. All output lines are based on
the same date: November 23, 1959.
</para>
day.
</para>
<para>
- <xref linkend="ecpg-rdefmtdate-example-table"> indicates a few possible formats. This will give
+ <xref linkend="ecpg-rdefmtdate-example-table"/> indicates a few possible formats. This will give
you an idea of how to use this function.
</para>
<table id="ecpg-rdefmtdate-example-table">
<title>The timestamp Type</title>
<para>
The timestamp type in C enables your programs to deal with data of the SQL
- type timestamp. See <xref linkend="datatype-datetime"> for the equivalent
+ type timestamp. See <xref linkend="datatype-datetime"/> for the equivalent
type in the <productname>PostgreSQL</productname> server.
</para>
<para>
<para>
The function returns the parsed timestamp on success. On error,
<literal>PGTYPESInvalidTimestamp</literal> is returned and <varname>errno</varname> is
- set to <literal>PGTYPES_TS_BAD_TIMESTAMP</literal>. See <xref linkend="pgtypesinvalidtimestamp"> for important notes on this value.
+ set to <literal>PGTYPES_TS_BAD_TIMESTAMP</literal>. See <xref linkend="pgtypesinvalidtimestamp"/> for important notes on this value.
</para>
<para>
In general, the input string can contain any combination of an allowed
specifiers are silently discarded.
</para>
<para>
- <xref linkend="ecpg-pgtypestimestamp-from-asc-example-table"> contains a few examples for input strings.
+ <xref linkend="ecpg-pgtypestimestamp-from-asc-example-table"/> contains a few examples for input strings.
</para>
<table id="ecpg-pgtypestimestamp-from-asc-example-table">
<title>Valid Input Formats for <function>PGTYPEStimestamp_from_asc</function></title>
</para>
<para>
This is the reverse function to <xref
- linkend="pgtypestimestampfmtasc">. See the documentation there in
+ linkend="pgtypestimestampfmtasc"/>. See the documentation there in
order to find out about the possible formatting mask entries.
</para>
</listitem>
<title>The interval Type</title>
<para>
The interval type in C enables your programs to deal with data of the SQL
- type interval. See <xref linkend="datatype-datetime"> for the equivalent
+ type interval. See <xref linkend="datatype-datetime"/> for the equivalent
type in the <productname>PostgreSQL</productname> server.
</para>
<para>
<function>PGTYPESdecimal_free</function>).
There are a lot of other functions that deal with the decimal type in the
<productname>Informix</productname> compatibility mode described in <xref
- linkend="ecpg-informix-compat">.
+ linkend="ecpg-informix-compat"/>.
</para>
<para>
The following functions can be used to work with the decimal type and are
so using <literal>DESCRIPTOR</literal> and <literal>SQL DESCRIPTOR</literal>
produced named SQL Descriptor Areas. Now it is mandatory, omitting
the <literal>SQL</literal> keyword produces SQLDA Descriptor Areas,
- see <xref linkend="ecpg-sqlda-descriptors">.
+ see <xref linkend="ecpg-sqlda-descriptors"/>.
</para>
<para>
</programlisting>
Note that the <literal>SQL</literal> keyword is omitted. The paragraphs about
the use cases of the <literal>INTO</literal> and <literal>USING</literal>
- keywords in <xref linkend="ecpg-named-descriptors"> also apply here with an addition.
+ keywords in <xref linkend="ecpg-named-descriptors"/> also apply here with an addition.
In a <command>DESCRIBE</command> statement the <literal>DESCRIPTOR</literal>
keyword can be completely omitted if the <literal>INTO</literal> keyword is used:
<programlisting>
<listitem>
<para>
Points to the data. The format of the data is described
- in <xref linkend="ecpg-variables-type-mapping">.
+ in <xref linkend="ecpg-variables-type-mapping"/>.
</para>
</listitem>
</varlistentry>
<para>
The whole program is shown
- in <xref linkend="ecpg-sqlda-example-example">.
+ in <xref linkend="ecpg-sqlda-example-example"/>.
</para>
<example id="ecpg-sqlda-example-example">
<literal>SQLSTATE</literal> error codes; therefore a high degree
of consistency can be achieved by using this error code scheme
throughout all applications. For further information see
- <xref linkend="errcodes-appendix">.
+ <xref linkend="errcodes-appendix"/>.
</para>
<para>
<literal>SQLSTATE</literal> is also listed. There is, however, no
one-to-one or one-to-many mapping between the two schemes (indeed
it is many-to-many), so you should consult the global
- <literal>SQLSTATE</literal> listing in <xref linkend="errcodes-appendix">
+ <literal>SQLSTATE</literal> listing in <xref linkend="errcodes-appendix"/>
in each case.
</para>
<para>
The complete syntax of the <command>ecpg</command> command is
- detailed in <xref linkend="app-ecpg">.
+ detailed in <xref linkend="app-ecpg"/>.
</para>
<para>
<para>
<function>ECPGtransactionStatus(const char *<replaceable>connection_name</replaceable>)</function>
returns the current transaction status of the given connection identified by <replaceable>connection_name</replaceable>.
- See <xref linkend="libpq-status"> and libpq's <function>PQtransactionStatus()</function> for details about the returned status codes.
+ See <xref linkend="libpq-status"/> and libpq's <function>PQtransactionStatus()</function> for details about the returned status codes.
</para>
</listitem>
<para>
For more details about the <function>ECPGget_PGconn()</function>, see
- <xref linkend="ecpg-library">. For information about the large
- object function interface, see <xref linkend="largeobjects">.
+ <xref linkend="ecpg-library"/>. For information about the large
+ object function interface, see <xref linkend="largeobjects"/>.
</para>
<para>
</para>
<para>
- <xref linkend="ecpg-lo-example"> shows an example program that
+ <xref linkend="ecpg-lo-example"/> shows an example program that
illustrates how to create, write, and read a large object in an
ECPG application.
</para>
A safe way to use the embedded SQL code in a C++ application is
hiding the ECPG calls in a C module, which the C++ application code
calls into to access the database, and linking that together with
- the rest of the C++ code. See <xref linkend="ecpg-cpp-and-c">
+ the rest of the C++ code. See <xref linkend="ecpg-cpp-and-c"/>
about that.
</para>
<para>
This section describes all SQL commands that are specific to
embedded SQL. Also refer to the SQL commands listed
- in <xref linkend="sql-commands">, which can also be used in
+ in <xref linkend="sql-commands"/>, which can also be used in
embedded SQL, unless stated otherwise.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-deallocate-descriptor"></member>
- <member><xref linkend="ecpg-sql-get-descriptor"></member>
- <member><xref linkend="ecpg-sql-set-descriptor"></member>
+ <member><xref linkend="ecpg-sql-deallocate-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-get-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-set-descriptor"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-disconnect"></member>
- <member><xref linkend="ecpg-sql-set-connection"></member>
+ <member><xref linkend="ecpg-sql-disconnect"/></member>
+ <member><xref linkend="ecpg-sql-set-connection"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-allocate-descriptor"></member>
- <member><xref linkend="ecpg-sql-get-descriptor"></member>
- <member><xref linkend="ecpg-sql-set-descriptor"></member>
+ <member><xref linkend="ecpg-sql-allocate-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-get-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-set-descriptor"/></member>
</simplelist>
</refsect1>
</refentry>
<term><replaceable class="parameter">query</replaceable></term>
<listitem>
<para>
- A <xref linkend="sql-select"> or
- <xref linkend="sql-values"> command which will provide the
+ A <xref linkend="sql-select"/> or
+ <xref linkend="sql-values"/> command which will provide the
rows to be returned by the cursor.
</para>
</listitem>
<para>
For the meaning of the cursor options,
- see <xref linkend="sql-declare">.
+ see <xref linkend="sql-declare"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-open"></member>
- <member><xref linkend="sql-close"></member>
- <member><xref linkend="sql-declare"></member>
+ <member><xref linkend="ecpg-sql-open"/></member>
+ <member><xref linkend="sql-close"/></member>
+ <member><xref linkend="sql-declare"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-allocate-descriptor"></member>
- <member><xref linkend="ecpg-sql-get-descriptor"></member>
+ <member><xref linkend="ecpg-sql-allocate-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-get-descriptor"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-connect"></member>
- <member><xref linkend="ecpg-sql-set-connection"></member>
+ <member><xref linkend="ecpg-sql-connect"/></member>
+ <member><xref linkend="ecpg-sql-set-connection"/></member>
</simplelist>
</refsect1>
</refentry>
<listitem>
<para>
A token identifying which item of information about a column
- to retrieve. See <xref linkend="ecpg-named-descriptors"> for
+ to retrieve. See <xref linkend="ecpg-named-descriptors"/> for
a list of supported items.
</para>
</listitem>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-allocate-descriptor"></member>
- <member><xref linkend="ecpg-sql-set-descriptor"></member>
+ <member><xref linkend="ecpg-sql-allocate-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-set-descriptor"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-declare"></member>
- <member><xref linkend="sql-close"></member>
+ <member><xref linkend="ecpg-sql-declare"/></member>
+ <member><xref linkend="sql-close"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<command>PREPARE</command> prepares a statement dynamically
specified as a string for execution. This is different from the
- direct SQL statement <xref linkend="sql-prepare">, which can also
- be used in embedded programs. The <xref linkend="sql-execute">
+ direct SQL statement <xref linkend="sql-prepare"/>, which can also
+ be used in embedded programs. The <xref linkend="sql-execute"/>
command is used to execute either kind of prepared statement.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-execute"></member>
+ <member><xref linkend="sql-execute"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-connect"></member>
- <member><xref linkend="ecpg-sql-disconnect"></member>
+ <member><xref linkend="ecpg-sql-connect"/></member>
+ <member><xref linkend="ecpg-sql-disconnect"/></member>
</simplelist>
</refsect1>
</refentry>
<listitem>
<para>
A token identifying which item of information to set in the
- descriptor. See <xref linkend="ecpg-named-descriptors"> for a
+ descriptor. See <xref linkend="ecpg-named-descriptors"/> for a
list of supported items.
</para>
</listitem>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="ecpg-sql-allocate-descriptor"></member>
- <member><xref linkend="ecpg-sql-get-descriptor"></member>
+ <member><xref linkend="ecpg-sql-allocate-descriptor"/></member>
+ <member><xref linkend="ecpg-sql-get-descriptor"/></member>
</simplelist>
</refsect1>
</refentry>
<title>Parameters</title>
<para>
- See <xref linkend="ecpg-whenever"> for a description of the
+ See <xref linkend="ecpg-whenever"/> for a description of the
parameters.
</para>
</refsect1>
<title>Informix-compatible SQLDA Descriptor Areas</title>
<para>
Informix-compatible mode supports a different structure than the one described in
- <xref linkend="ecpg-sqlda-descriptors">. See below:
+ <xref linkend="ecpg-sqlda-descriptors"/>. See below:
<programlisting>
struct sqlvar_compat
{
that it sets to the current date.
</para>
<para>
- Internally this function uses the <xref linkend="pgtypesdatetoday">
+ Internally this function uses the <xref linkend="pgtypesdatetoday"/>
function.
</para>
</listitem>
The function always returns 0 at the moment.
</para>
<para>
- Internally the function uses the <xref linkend="pgtypesdatejulmdy">
+ Internally the function uses the <xref linkend="pgtypesdatejulmdy"/>
function.
</para>
</listitem>
</para>
<para>
Internally this function is implemented to use the <xref
- linkend="pgtypesdatedefmtasc"> function. See the reference there for a
+ linkend="pgtypesdatedefmtasc"/> function. See the reference there for a
table of example input.
</para>
</listitem>
On success, 0 is returned and a negative value if an error occurred.
</para>
<para>
- Internally this function uses the <xref linkend="pgtypesdatefmtasc">
+ Internally this function uses the <xref linkend="pgtypesdatefmtasc"/>
function, see the reference there for examples.
</para>
</listitem>
</para>
<para>
Internally the function is implemented to use the function <xref
- linkend="pgtypesdatemdyjul">.
+ linkend="pgtypesdatemdyjul"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
Internally the function is implemented to use the function <xref
- linkend="pgtypesdatedayofweek">.
+ linkend="pgtypesdatedayofweek"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
Internally this function uses the <xref
- linkend="pgtypestimestampfromasc"> function. See the reference there
+ linkend="pgtypestimestampfromasc"/> function. See the reference there
for a table with example inputs.
</para>
</listitem>
</para>
<para>
This function is implemented by means of the <xref
- linkend="pgtypestimestampdefmtasc"> function. See the documentation
+ linkend="pgtypestimestampdefmtasc"/> function. See the documentation
there for a list of format specifiers that can be used.
</para>
<para>
</para>
<para>
Internally, this function uses the <xref
- linkend="pgtypestimestampfmtasc"> function. See the reference there for
+ linkend="pgtypestimestampfmtasc"/> function. See the reference there for
information on what format mask specifiers can be used.
</para>
</listitem>
The function receives the type of the variable to test (<literal>t</literal>)
as well a pointer to this variable (<literal>ptr</literal>). Note that the
latter needs to be cast to a char*. See the function <xref
- linkend="rsetnull"> for a list of possible variable types.
+ linkend="rsetnull"/> for a list of possible variable types.
</para>
<para>
Here is an example of how to use this function:
</para>
<para>
- <xref linkend="errcodes-table"> lists all the error codes defined in
+ <xref linkend="errcodes-table"/> lists all the error codes defined in
<productname>PostgreSQL</productname> &version;. (Some are not actually
used at present, but are defined by the SQL standard.)
The error classes are also shown. For each error class there is a
<title><productname>PostgreSQL</productname> Error Codes</title>
<tgroup cols="2">
- <colspec colnum="1" colname="errorcode">
- <colspec colnum="2" colname="condname">
- <spanspec namest="errorcode" nameend="condname" spanname="span12">
+ <colspec colnum="1" colname="errorcode"/>
+ <colspec colnum="2" colname="condname"/>
+ <spanspec namest="errorcode" nameend="condname" spanname="span12"/>
<thead>
<row>
</indexterm>
<para>
- To supplement the trigger mechanism discussed in <xref linkend="triggers">,
+ To supplement the trigger mechanism discussed in <xref linkend="triggers"/>,
<productname>PostgreSQL</productname> also provides event triggers. Unlike regular
triggers, which are attached to a single table and capture only DML events,
event triggers are global to a particular database and are capable of
operations that took place, use the set-returning function
<literal>pg_event_trigger_ddl_commands()</literal> from the
<literal>ddl_command_end</literal> event trigger code (see
- <xref linkend="functions-event-triggers">). Note that the trigger fires
+ <xref linkend="functions-event-triggers"/>). Note that the trigger fires
after the actions have taken place (but before the transaction commits),
and thus the system catalogs can be read as already changed.
</para>
database objects. To list the objects that have been dropped, use the
set-returning function <literal>pg_event_trigger_dropped_objects()</literal> from the
<literal>sql_drop</literal> event trigger code (see
- <xref linkend="functions-event-triggers">). Note that
+ <xref linkend="functions-event-triggers"/>). Note that
the trigger is executed after the objects have been deleted from the
system catalogs, so it's not possible to look them up anymore.
</para>
<para>
For a complete list of commands supported by the event trigger mechanism,
- see <xref linkend="event-trigger-matrix">.
+ see <xref linkend="event-trigger-matrix"/>.
</para>
<para>
- Event triggers are created using the command <xref linkend="sql-createeventtrigger">.
+ Event triggers are created using the command <xref linkend="sql-createeventtrigger"/>.
In order to create an event trigger, you must first create a function with
the special return type <literal>event_trigger</literal>. This function
need not (and may not) return a value; the return type serves merely as
<title>Event Trigger Firing Matrix</title>
<para>
- <xref linkend="event-trigger-by-command-tag"> lists all commands
+ <xref linkend="event-trigger-by-command-tag"/> lists all commands
for which event triggers are supported.
</para>
Describes the event for which the function is called, one of
<literal>"ddl_command_start"</literal>, <literal>"ddl_command_end"</literal>,
<literal>"sql_drop"</literal>, <literal>"table_rewrite"</literal>.
- See <xref linkend="event-trigger-definition"> for the meaning of these
+ See <xref linkend="event-trigger-definition"/> for the meaning of these
events.
</para>
</listitem>
The event trigger definition associated the function with
the <literal>ddl_command_start</literal> event. The effect is that all DDL
commands (with the exceptions mentioned
- in <xref linkend="event-trigger-definition">) are prevented from running.
+ in <xref linkend="event-trigger-definition"/>) are prevented from running.
</para>
<para>
</para>
<para>
- After you have compiled the source code (see <xref linkend="dfunc">),
+ After you have compiled the source code (see <xref linkend="dfunc"/>),
declare the function and the triggers:
<programlisting>
CREATE FUNCTION noddl() RETURNS event_trigger
<itemizedlist spacing="compact" mark="bullet">
<listitem>
<para>
- functions (starting in <xref linkend="xfunc">)
+ functions (starting in <xref linkend="xfunc"/>)
</para>
</listitem>
<listitem>
<para>
- aggregates (starting in <xref linkend="xaggr">)
+ aggregates (starting in <xref linkend="xaggr"/>)
</para>
</listitem>
<listitem>
<para>
- data types (starting in <xref linkend="xtypes">)
+ data types (starting in <xref linkend="xtypes"/>)
</para>
</listitem>
<listitem>
<para>
- operators (starting in <xref linkend="xoper">)
+ operators (starting in <xref linkend="xoper"/>)
</para>
</listitem>
<listitem>
<para>
- operator classes for indexes (starting in <xref linkend="xindex">)
+ operator classes for indexes (starting in <xref linkend="xindex"/>)
</para>
</listitem>
<listitem>
<para>
- packages of related objects (starting in <xref linkend="extend-extensions">)
+ packages of related objects (starting in <xref linkend="extend-extensions"/>)
</para>
</listitem>
</itemizedlist>
types through functions provided by the user and only understands
the behavior of such types to the extent that the user describes
them.
- The built-in base types are described in <xref linkend="datatype">.
+ The built-in base types are described in <xref linkend="datatype"/>.
</para>
<para>
Enumerated (enum) types can be considered as a subcategory of base
types. The main difference is that they can be created using
just <acronym>SQL</acronym> commands, without any low-level programming.
- Refer to <xref linkend="datatype-enum"> for more information.
+ Refer to <xref linkend="datatype-enum"/> for more information.
</para>
</sect2>
type is automatically created for each base type, composite type, range
type, and domain type. But there are no arrays of arrays. So far as
the type system is concerned, multi-dimensional arrays are the same as
- one-dimensional arrays. Refer to <xref linkend="arrays"> for more
+ one-dimensional arrays. Refer to <xref linkend="arrays"/> for more
information.
</para>
<para>
Composite types, or row types, are created whenever the user
creates a table. It is also possible to use <xref
- linkend="sql-createtype"> to
+ linkend="sql-createtype"/> to
define a <quote>stand-alone</quote> composite type with no associated
table. A composite type is simply a list of types with
associated field names. A value of a composite type is a row or
- record of field values. Refer to <xref linkend="rowtypes">
+ record of field values. Refer to <xref linkend="rowtypes"/>
for more information.
</para>
<para>
A range type can hold two values of the same type, which are the lower
and upper bounds of the range. Range types are user-created, although
- a few built-in ones exist. Refer to <xref linkend="rangetypes">
+ a few built-in ones exist. Refer to <xref linkend="rangetypes"/>
for more information.
</para>
</sect2>
is interchangeable with its underlying type. However, a domain can have
constraints that restrict its valid values to a subset of what the
underlying type would allow. Domains are created using
- the <acronym>SQL</acronym> command <xref linkend="sql-createdomain">.
- Refer to <xref linkend="domains"> for more information.
+ the <acronym>SQL</acronym> command <xref linkend="sql-createdomain"/>.
+ Refer to <xref linkend="domains"/> for more information.
</para>
</sect2>
container types, but they can be used to declare the argument and
result types of functions. This provides a mechanism within the
type system to identify special classes of functions. <xref
- linkend="datatype-pseudotypes-table"> lists the existing
+ linkend="datatype-pseudotypes-table"/> lists the existing
pseudo-types.
</para>
</sect2>
<para>
A variadic function (one taking a variable number of arguments, as in
- <xref linkend="xfunc-sql-variadic-functions">) can be
+ <xref linkend="xfunc-sql-variadic-functions"/>) can be
polymorphic: this is accomplished by declaring its last parameter as
<literal>VARIADIC</literal> <type>anyarray</type>. For purposes of argument
matching and determining the actual result type, such a function behaves
of the extension itself. If the extension includes C code, there
will typically also be a shared library file into which the C code
has been built. Once you have these files, a simple
- <xref linkend="sql-createextension"> command loads the objects into
+ <xref linkend="sql-createextension"/> command loads the objects into
your database.
</para>
<acronym>SQL</acronym> script to load a bunch of <quote>loose</quote> objects
into your database, is that <productname>PostgreSQL</productname> will then
understand that the objects of the extension go together. You can
- drop all the objects with a single <xref linkend="sql-dropextension">
+ drop all the objects with a single <xref linkend="sql-dropextension"/>
command (no need to maintain a separate <quote>uninstall</quote> script).
Even more useful, <application>pg_dump</application> knows that it should not
dump the individual member objects of the extension — it will
by <application>pg_dump</application>. Such a change is usually only sensible if
you concurrently make the same change in the extension's script file.
(But there are special provisions for tables containing configuration
- data; see <xref linkend="extend-extensions-config-tables">.)
+ data; see <xref linkend="extend-extensions-config-tables"/>.)
In production situations, it's generally better to create an extension
update script to perform changes to extension member objects.
</para>
<para>
The kinds of SQL objects that can be members of an extension are shown in
- the description of <xref linkend="sql-alterextension">. Notably, objects
+ the description of <xref linkend="sql-alterextension"/>. Notably, objects
that are database-cluster-wide, such as databases, roles, and tablespaces,
cannot be extension members since an extension is only known within one
database. (Although an extension script is not prohibited from creating
</indexterm>
<para>
- The <xref linkend="sql-createextension"> command relies on a control
+ The <xref linkend="sql-createextension"/> command relies on a control
file for each extension, which must be named the same as the extension
with a suffix of <literal>.control</literal>, and must be placed in the
installation's <literal>SHAREDIR/extension</literal> directory. There
when initially creating an extension, but not during extension updates
(since that might override user-added comments). Alternatively,
the extension's comment can be set by writing
- a <xref linkend="sql-comment"> command in the script file.
+ a <xref linkend="sql-comment"/> command in the script file.
</para>
</listitem>
</varlistentry>
its contained objects into a different schema after initial creation
of the extension. The default is <literal>false</literal>, i.e. the
extension is not relocatable.
- See <xref linkend="extend-extensions-relocation"> for more information.
+ See <xref linkend="extend-extensions-relocation"/> for more information.
</para>
</listitem>
</varlistentry>
and not any other.
The <varname>schema</varname> parameter is consulted only when
initially creating an extension, not during extension updates.
- See <xref linkend="extend-extensions-relocation"> for more information.
+ See <xref linkend="extend-extensions-relocation"/> for more information.
</para>
</listitem>
</varlistentry>
comments) by the extension mechanism. This provision is commonly used
to throw an error if the script file is fed to <application>psql</application>
rather than being loaded via <command>CREATE EXTENSION</command> (see example
- script in <xref linkend="extend-extensions-example">).
+ script in <xref linkend="extend-extensions-example"/>).
Without that, users might accidentally load the
extension's contents as <quote>loose</quote> objects rather than as an
extension, a state of affairs that's a bit tedious to recover from.
<para>
In all cases, the script file will be executed with
- <xref linkend="guc-search-path"> initially set to point to the target
+ <xref linkend="guc-search-path"/> initially set to point to the target
schema; that is, <command>CREATE EXTENSION</command> does the equivalent of
this:
<programlisting>
</programlisting>
This makefile relies on <acronym>PGXS</acronym>, which is described
- in <xref linkend="extend-pgxs">. The command <literal>make install</literal>
+ in <xref linkend="extend-pgxs"/>. The command <literal>make install</literal>
will install the control and script files into the correct
directory as reported by <application>pg_config</application>.
</para>
<para>
Once the files are installed, use the
- <xref linkend="sql-createextension"> command to load the objects into
+ <xref linkend="sql-createextension"/> command to load the objects into
any particular database.
</para>
</sect2>
</itemizedlist>
All other language interfaces are external projects and are distributed
- separately. <xref linkend="language-interface-table"> includes a list of
+ separately. <xref linkend="language-interface-table"/> includes a list of
some of these projects. Note that some of these packages might not be
released under the same license as <productname>PostgreSQL</productname>. For more
information on each language interface, including licensing terms, refer to
<para>
In addition, there are a number of procedural languages that are developed
and maintained outside the core <productname>PostgreSQL</productname>
- distribution. <xref linkend="pl-language-table"> lists some of these
+ distribution. <xref linkend="pl-language-table"/> lists some of these
packages. Note that some of these projects might not be released under the same
license as <productname>PostgreSQL</productname>. For more information on each
procedural language, including licensing information, refer to its website
just like features that are built in. The
<filename>contrib/</filename> directory shipped with the source code
contains several extensions, which are described in
- <xref linkend="contrib">. Other extensions are developed
+ <xref linkend="contrib"/>. Other extensions are developed
independently, like <application><ulink
url="http://postgis.net/">PostGIS</ulink></application>. Even
<productname>PostgreSQL</productname> replication solutions can be developed
The foreign data wrappers included in the standard distribution are good
references when trying to write your own. Look into the
<filename>contrib</filename> subdirectory of the source tree.
- The <xref linkend="sql-createforeigndatawrapper"> reference page also has
+ The <xref linkend="sql-createforeigndatawrapper"/> reference page also has
some useful details.
</para>
a validator function. Both functions must be written in a compiled
language such as C, using the version-1 interface.
For details on C language calling conventions and dynamic loading,
- see <xref linkend="xfunc-c">.
+ see <xref linkend="xfunc-c"/>.
</para>
<para>
returning the special pseudo-type <type>fdw_handler</type>. The
callback functions are plain C functions and are not visible or
callable at the SQL level. The callback functions are described in
- <xref linkend="fdw-callbacks">.
+ <xref linkend="fdw-callbacks"/>.
</para>
<para>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
<para>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
<para>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
<para>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
</sect2>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
</sect2>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
<para>
</para>
<para>
- See <xref linkend="fdw-planning"> for additional information.
+ See <xref linkend="fdw-planning"/> for additional information.
</para>
<para>
<para>
If an FDW wishes to support <firstterm>late row locking</firstterm> (as described
- in <xref linkend="fdw-row-locking">), it must provide the following
+ in <xref linkend="fdw-row-locking"/>), it must provide the following
callback functions:
</para>
</para>
<para>
- See <xref linkend="fdw-row-locking"> for more information.
+ See <xref linkend="fdw-row-locking"/> for more information.
</para>
<para>
</para>
<para>
- See <xref linkend="fdw-row-locking"> for more information.
+ See <xref linkend="fdw-row-locking"/> for more information.
</para>
<para>
BlockNumber *totalpages);
</programlisting>
- This function is called when <xref linkend="sql-analyze"> is executed on
+ This function is called when <xref linkend="sql-analyze"/> is executed on
a foreign table. If the FDW can collect statistics for this
foreign table, it should return <literal>true</literal>, and provide a pointer
to a function that will collect sample rows from the table in
</programlisting>
Obtain a list of foreign table creation commands. This function is
- called when executing <xref linkend="sql-importforeignschema">, and is
+ called when executing <xref linkend="sql-importforeignschema"/>, and is
passed the parse tree for that statement, as well as the OID of the
foreign server to use. It should return a list of C strings, each of
- which must contain a <xref linkend="sql-createforeigntable"> command.
+ which must contain a <xref linkend="sql-createforeigntable"/> command.
These strings will be parsed and executed by the core server.
</para>
<para>
<function>PlanForeignModify</function> and the other callbacks described in
- <xref linkend="fdw-callbacks-update"> are designed around the assumption
+ <xref linkend="fdw-callbacks-update"/> are designed around the assumption
that the foreign relation will be scanned in the usual way and then
individual row updates will be driven by a local <literal>ModifyTable</literal>
plan node. This approach is necessary for the general case where an
compete against the <literal>ModifyTable</literal> approach. This approach
could also be used to implement remote <literal>SELECT FOR UPDATE</literal>,
rather than using the row locking callbacks described in
- <xref linkend="fdw-callbacks-row-locking">. Keep in mind that a path
+ <xref linkend="fdw-callbacks-row-locking"/>. Keep in mind that a path
inserted into <literal>UPPERREL_FINAL</literal> is responsible for
implementing <emphasis>all</emphasis> behavior of the query.
</para>
By default, <productname>PostgreSQL</productname> ignores locking considerations
when interfacing to FDWs, but an FDW can perform early locking without
any explicit support from the core code. The API functions described
- in <xref linkend="fdw-callbacks-row-locking">, which were added
+ in <xref linkend="fdw-callbacks-row-locking"/>, which were added
in <productname>PostgreSQL</productname> 9.5, allow an FDW to use late locking if
it wishes.
</para>
again perform early locking by fetching tuples with the equivalent
of <command>SELECT FOR UPDATE/SHARE</command>. To perform late locking
instead, provide the callback functions defined
- in <xref linkend="fdw-callbacks-row-locking">.
+ in <xref linkend="fdw-callbacks-row-locking"/>.
In <function>GetForeignRowMarkType</function>, select rowmark option
<literal>ROW_MARK_EXCLUSIVE</literal>, <literal>ROW_MARK_NOKEYEXCLUSIVE</literal>,
<literal>ROW_MARK_SHARE</literal>, or <literal>ROW_MARK_KEYSHARE</literal> depending
files in the server's file system, or to execute programs on the server
and read their output. The data file or program output must be in a format
that can be read by <command>COPY FROM</command>;
- see <xref linkend="sql-copy"> for details.
+ see <xref linkend="sql-copy"/> for details.
Access to data files is currently read-only.
</para>
<productname>PostgreSQL</productname> provides a large number of
functions and operators for the built-in data types. Users can also
define their own functions and operators, as described in
- <xref linkend="server-programming">. The
+ <xref linkend="server-programming"/>. The
<application>psql</application> commands <command>\df</command> and
<command>\do</command> can be used to list all
available functions and operators, respectively.
The operators <literal>AND</literal> and <literal>OR</literal> are
commutative, that is, you can switch the left and right operand
without affecting the result. But see <xref
- linkend="syntax-express-eval"> for more information about the
+ linkend="syntax-express-eval"/> for more information about the
order of evaluation of subexpressions.
</para>
</sect1>
<para>
The usual comparison operators are available, as shown in <xref
- linkend="functions-comparison-op-table">.
+ linkend="functions-comparison-op-table"/>.
</para>
<table id="functions-comparison-op-table">
<para>
There are also some comparison predicates, as shown in <xref
- linkend="functions-comparison-pred-table">. These behave much like
+ linkend="functions-comparison-pred-table"/>. These behave much like
operators, but have special syntax mandated by the SQL standard.
</para>
returns true if <replaceable>expression</replaceable> evaluates to
the null value. It is highly recommended that these applications
be modified to comply with the SQL standard. However, if that
- cannot be done the <xref linkend="guc-transform-null-equals">
+ cannot be done the <xref linkend="guc-transform-null-equals"/>
configuration variable is available. If it is enabled,
<productname>PostgreSQL</productname> will convert <literal>x =
NULL</literal> clauses to <literal>x IS NULL</literal>.
<para>
Some comparison-related functions are also available, as shown in <xref
- linkend="functions-comparison-func-table">.
+ linkend="functions-comparison-func-table"/>.
</para>
<table id="functions-comparison-func-table">
</para>
<para>
- <xref linkend="functions-math-op-table"> shows the available mathematical operators.
+ <xref linkend="functions-math-op-table"/> shows the available mathematical operators.
</para>
<table id="functions-math-op-table">
the others are available for all numeric data types. The bitwise
operators are also available for the bit
string types <type>bit</type> and <type>bit varying</type>, as
- shown in <xref linkend="functions-bit-string-op-table">.
+ shown in <xref linkend="functions-bit-string-op-table"/>.
</para>
<para>
- <xref linkend="functions-math-func-table"> shows the available
+ <xref linkend="functions-math-func-table"/> shows the available
mathematical functions. In the table, <literal>dp</literal>
indicates <type>double precision</type>. Many of these functions
are provided in multiple forms with different argument types.
</table>
<para>
- <xref linkend="functions-math-random-table"> shows functions for
+ <xref linkend="functions-math-random-table"/> shows functions for
generating random numbers.
</para>
The characteristics of the values returned by
<literal><function>random()</function></literal> depend
on the system implementation. It is not suitable for cryptographic
- applications; see <xref linkend="pgcrypto"> module for an alternative.
+ applications; see <xref linkend="pgcrypto"/> module for an alternative.
</para>
<para>
- Finally, <xref linkend="functions-math-trig-table"> shows the
+ Finally, <xref linkend="functions-math-trig-table"/> shows the
available trigonometric functions. All trigonometric functions
take arguments and return values of type <type>double
precision</type>. Each of the trigonometric functions comes in
<acronym>SQL</acronym> defines some string functions that use
key words, rather than commas, to separate
arguments. Details are in
- <xref linkend="functions-string-sql">.
+ <xref linkend="functions-string-sql"/>.
<productname>PostgreSQL</productname> also provides versions of these functions
that use the regular function invocation syntax
- (see <xref linkend="functions-string-other">).
+ (see <xref linkend="functions-string-other"/>).
</para>
<note>
caused surprising behaviors. However, the string concatenation operator
(<literal>||</literal>) still accepts non-string input, so long as at least one
input is of a string type, as shown in <xref
- linkend="functions-string-sql">. For other cases, insert an explicit
+ linkend="functions-string-sql"/>. For other cases, insert an explicit
coercion to <type>text</type> if you need to duplicate the previous behavior.
</para>
</note>
<entry><type>text</type></entry>
<entry>
Extract substring matching POSIX regular expression. See
- <xref linkend="functions-matching"> for more information on pattern
+ <xref linkend="functions-matching"/> for more information on pattern
matching.
</entry>
<entry><literal>substring('Thomas' from '...$')</literal></entry>
<entry><type>text</type></entry>
<entry>
Extract substring matching <acronym>SQL</acronym> regular expression.
- See <xref linkend="functions-matching"> for more information on
+ See <xref linkend="functions-matching"/> for more information on
pattern matching.
</entry>
<entry><literal>substring('Thomas' from '%#"o_a#"_' for '#')</literal></entry>
<para>
Additional string manipulation functions are available and are
- listed in <xref linkend="functions-string-other">. Some of them are used internally to implement the
- <acronym>SQL</acronym>-standard string functions listed in <xref linkend="functions-string-sql">.
+ listed in <xref linkend="functions-string-other"/>. Some of them are used internally to implement the
+ <acronym>SQL</acronym>-standard string functions listed in <xref linkend="functions-string-sql"/>.
</para>
<table id="functions-string-other">
<parameter>string</parameter> must be valid in this encoding.
Conversions can be defined by <command>CREATE CONVERSION</command>.
Also there are some predefined conversions. See <xref
- linkend="conversion-names"> for available conversions.
+ linkend="conversion-names"/> for available conversions.
</entry>
<entry><literal>convert('text_in_utf8', 'UTF8', 'LATIN1')</literal></entry>
<entry><literal>text_in_utf8</literal> represented in Latin-1
<entry>
Format arguments according to a format string.
This function is similar to the C function <function>sprintf</function>.
- See <xref linkend="functions-string-format">.
+ See <xref linkend="functions-string-format"/>.
</entry>
<entry><literal>format('Hello %s, %1$s', 'World')</literal></entry>
<entry><literal>Hello World, World</literal></entry>
Quotes are added only if necessary (i.e., if the string contains
non-identifier characters or would be case-folded).
Embedded quotes are properly doubled.
- See also <xref linkend="plpgsql-quote-literal-example">.
+ See also <xref linkend="plpgsql-quote-literal-example"/>.
</entry>
<entry><literal>quote_ident('Foo bar')</literal></entry>
<entry><literal>"Foo bar"</literal></entry>
Note that <function>quote_literal</function> returns null on null
input; if the argument might be null,
<function>quote_nullable</function> is often more suitable.
- See also <xref linkend="plpgsql-quote-literal-example">.
+ See also <xref linkend="plpgsql-quote-literal-example"/>.
</entry>
<entry><literal>quote_literal(E'O\'Reilly')</literal></entry>
<entry><literal>'O''Reilly'</literal></entry>
in an <acronym>SQL</acronym> statement string; or, if the argument
is null, return <literal>NULL</literal>.
Embedded single-quotes and backslashes are properly doubled.
- See also <xref linkend="plpgsql-quote-literal-example">.
+ See also <xref linkend="plpgsql-quote-literal-example"/>.
</entry>
<entry><literal>quote_nullable(NULL)</literal></entry>
<entry><literal>NULL</literal></entry>
<entry>
Return captured substring(s) resulting from the first match of a POSIX
regular expression to the <parameter>string</parameter>. See
- <xref linkend="functions-posix-regexp"> for more information.
+ <xref linkend="functions-posix-regexp"/> for more information.
</entry>
<entry><literal>regexp_match('foobarbequebaz', '(bar)(beque)')</literal></entry>
<entry><literal>{bar,beque}</literal></entry>
<entry>
Return captured substring(s) resulting from matching a POSIX regular
expression to the <parameter>string</parameter>. See
- <xref linkend="functions-posix-regexp"> for more information.
+ <xref linkend="functions-posix-regexp"/> for more information.
</entry>
<entry><literal>regexp_matches('foobarbequebaz', 'ba.', 'g')</literal></entry>
<entry><literal>{bar}</literal><para><literal>{baz}</literal></para> (2 rows)</entry>
<entry><type>text</type></entry>
<entry>
Replace substring(s) matching a POSIX regular expression. See
- <xref linkend="functions-posix-regexp"> for more information.
+ <xref linkend="functions-posix-regexp"/> for more information.
</entry>
<entry><literal>regexp_replace('Thomas', '.[mN]a.', 'M')</literal></entry>
<entry><literal>ThM</literal></entry>
<entry><type>text[]</type></entry>
<entry>
Split <parameter>string</parameter> using a POSIX regular expression as
- the delimiter. See <xref linkend="functions-posix-regexp"> for more
+ the delimiter. See <xref linkend="functions-posix-regexp"/> for more
information.
</entry>
<entry><literal>regexp_split_to_array('hello world', E'\\s+')</literal></entry>
<entry><type>setof text</type></entry>
<entry>
Split <parameter>string</parameter> using a POSIX regular expression as
- the delimiter. See <xref linkend="functions-posix-regexp"> for more
+ the delimiter. See <xref linkend="functions-posix-regexp"/> for more
information.
</entry>
<entry><literal>regexp_split_to_table('hello world', E'\\s+')</literal></entry>
<function>format</function> functions are variadic, so it is possible to
pass the values to be concatenated or formatted as an array marked with
the <literal>VARIADIC</literal> keyword (see <xref
- linkend="xfunc-sql-variadic-functions">). The array's elements are
+ linkend="xfunc-sql-variadic-functions"/>). The array's elements are
treated as if they were separate ordinary arguments to the function.
If the variadic array argument is NULL, <function>concat</function>
and <function>concat_ws</function> return NULL, but
<para>
See also the aggregate function <function>string_agg</function> in
- <xref linkend="functions-aggregate">.
+ <xref linkend="functions-aggregate"/>.
</para>
<table id="conversion-names">
<para>
The <literal>%I</literal> and <literal>%L</literal> format specifiers are particularly
useful for safely constructing dynamic SQL statements. See
- <xref linkend="plpgsql-quote-literal-example">.
+ <xref linkend="plpgsql-quote-literal-example"/>.
</para>
</sect2>
<acronym>SQL</acronym> defines some string functions that use
key words, rather than commas, to separate
arguments. Details are in
- <xref linkend="functions-binarystring-sql">.
+ <xref linkend="functions-binarystring-sql"/>.
<productname>PostgreSQL</productname> also provides versions of these functions
that use the regular function invocation syntax
- (see <xref linkend="functions-binarystring-other">).
+ (see <xref linkend="functions-binarystring-other"/>).
</para>
<note>
<para>
Additional binary string manipulation functions are available and
- are listed in <xref linkend="functions-binarystring-other">. Some
+ are listed in <xref linkend="functions-binarystring-other"/>. Some
of them are used internally to implement the
<acronym>SQL</acronym>-standard string functions listed in <xref
- linkend="functions-binarystring-sql">.
+ linkend="functions-binarystring-sql"/>.
</para>
<table id="functions-binarystring-other">
<para>
See also the aggregate function <function>string_agg</function> in
- <xref linkend="functions-aggregate"> and the large object functions
- in <xref linkend="lo-funcs">.
+ <xref linkend="functions-aggregate"/> and the large object functions
+ in <xref linkend="lo-funcs"/>.
</para>
</sect1>
manipulating bit strings, that is values of the types
<type>bit</type> and <type>bit varying</type>. Aside from the
usual comparison operators, the operators
- shown in <xref linkend="functions-bit-string-op-table"> can be used.
+ shown in <xref linkend="functions-bit-string-op-table"/> can be used.
Bit string operands of <literal>&</literal>, <literal>|</literal>,
and <literal>#</literal> must be of equal length. When bit
shifting, the original length of the string is preserved, as shown
<note>
<para>
- If you have <xref linkend="guc-standard-conforming-strings"> turned off,
+ If you have <xref linkend="guc-standard-conforming-strings"/> turned off,
any backslashes you write in literal string constants will need to be
- doubled. See <xref linkend="sql-syntax-strings"> for more information.
+ doubled. See <xref linkend="sql-syntax-strings"/> for more information.
</para>
</note>
</indexterm>
<para>
- <xref linkend="functions-posix-table"> lists the available
+ <xref linkend="functions-posix-table"/> lists the available
operators for pattern matching using POSIX regular expressions.
</para>
matching, while flag <literal>g</literal> specifies replacement of each matching
substring rather than only the first one. Supported flags (though
not <literal>g</literal>) are
- described in <xref linkend="posix-embedded-options-table">.
+ described in <xref linkend="posix-embedded-options-table"/>.
</para>
<para>
The <replaceable>flags</replaceable> parameter is an optional text string
containing zero or more single-letter flags that change the function's
behavior. Supported flags are described
- in <xref linkend="posix-embedded-options-table">.
+ in <xref linkend="posix-embedded-options-table"/>.
</para>
<para>
subexpressions of the <replaceable>pattern</replaceable>, just as described above
for <function>regexp_match</function>.
<function>regexp_matches</function> accepts all the flags shown
- in <xref linkend="posix-embedded-options-table">, plus
+ in <xref linkend="posix-embedded-options-table"/>, plus
the <literal>g</literal> flag which commands it to return all matches, not
just the first one.
</para>
The <replaceable>flags</replaceable> parameter is an optional text string containing
zero or more single-letter flags that change the function's behavior.
<function>regexp_split_to_table</function> supports the flags described in
- <xref linkend="posix-embedded-options-table">.
+ <xref linkend="posix-embedded-options-table"/>.
</para>
<para>
<productname>PostgreSQL</productname> always initially presumes that a regular
expression follows the ARE rules. However, the more limited ERE or
BRE rules can be chosen by prepending an <firstterm>embedded option</firstterm>
- to the RE pattern, as described in <xref linkend="posix-metasyntax">.
+ to the RE pattern, as described in <xref linkend="posix-metasyntax"/>.
This can be useful for compatibility with applications that expect
exactly the <acronym>POSIX</acronym> 1003.2 rules.
</para>
Without a quantifier, it matches a match for the atom.
With a quantifier, it can match some number of matches of the atom.
An <firstterm>atom</firstterm> can be any of the possibilities
- shown in <xref linkend="posix-atoms-table">.
+ shown in <xref linkend="posix-atoms-table"/>.
The possible quantifiers and their meanings are shown in
- <xref linkend="posix-quantifiers-table">.
+ <xref linkend="posix-quantifiers-table"/>.
</para>
<para>
specific conditions are met. A constraint can be used where an atom
could be used, except it cannot be followed by a quantifier.
The simple constraints are shown in
- <xref linkend="posix-constraints-table">;
+ <xref linkend="posix-constraints-table"/>;
some more constraints are described later.
</para>
<entry> <literal>[</literal><replaceable>chars</replaceable><literal>]</literal> </entry>
<entry> a <firstterm>bracket expression</firstterm>,
matching any one of the <replaceable>chars</replaceable> (see
- <xref linkend="posix-bracket-expressions"> for more detail) </entry>
+ <xref linkend="posix-bracket-expressions"/> for more detail) </entry>
</row>
<row>
<entry> <literal>\</literal><replaceable>c</replaceable> </entry>
<entry> where <replaceable>c</replaceable> is alphanumeric
(possibly followed by other characters)
- is an <firstterm>escape</firstterm>, see <xref linkend="posix-escape-sequences">
+ is an <firstterm>escape</firstterm>, see <xref linkend="posix-escape-sequences"/>
(AREs only; in EREs and BREs, this matches <replaceable>c</replaceable>) </entry>
</row>
<note>
<para>
- If you have <xref linkend="guc-standard-conforming-strings"> turned off,
+ If you have <xref linkend="guc-standard-conforming-strings"/> turned off,
any backslashes you write in literal string constants will need to be
- doubled. See <xref linkend="sql-syntax-strings"> for more information.
+ doubled. See <xref linkend="sql-syntax-strings"/> for more information.
</para>
</note>
same possibilities as their corresponding normal (<firstterm>greedy</firstterm>)
counterparts, but prefer the smallest number rather than the largest
number of matches.
- See <xref linkend="posix-matching-rules"> for more detail.
+ See <xref linkend="posix-matching-rules"/> for more detail.
</para>
<note>
<para>
Lookahead and lookbehind constraints cannot contain <firstterm>back
- references</firstterm> (see <xref linkend="posix-escape-sequences">),
+ references</firstterm> (see <xref linkend="posix-escape-sequences"/>),
and all parentheses within them are considered non-capturing.
</para>
</sect3>
<para>
<firstterm>Character-entry escapes</firstterm> exist to make it easier to specify
non-printing and other inconvenient characters in REs. They are
- shown in <xref linkend="posix-character-entry-escapes-table">.
+ shown in <xref linkend="posix-character-entry-escapes-table"/>.
</para>
<para>
<firstterm>Class-shorthand escapes</firstterm> provide shorthands for certain
commonly-used character classes. They are
- shown in <xref linkend="posix-class-shorthand-escapes-table">.
+ shown in <xref linkend="posix-class-shorthand-escapes-table"/>.
</para>
<para>
A <firstterm>constraint escape</firstterm> is a constraint,
matching the empty string if specific conditions are met,
written as an escape. They are
- shown in <xref linkend="posix-constraint-escapes-table">.
+ shown in <xref linkend="posix-constraint-escapes-table"/>.
</para>
<para>
A <firstterm>back reference</firstterm> (<literal>\</literal><replaceable>n</replaceable>) matches the
same string matched by the previous parenthesized subexpression specified
by the number <replaceable>n</replaceable>
- (see <xref linkend="posix-constraint-backref-table">). For example,
+ (see <xref linkend="posix-constraint-backref-table"/>). For example,
<literal>([bc])\1</literal> matches <literal>bb</literal> or <literal>cc</literal>
but not <literal>bc</literal> or <literal>cb</literal>.
The subexpression must entirely precede the back reference in the RE.
<row>
<entry> <literal>\A</literal> </entry>
<entry> matches only at the beginning of the string
- (see <xref linkend="posix-matching-rules"> for how this differs from
+ (see <xref linkend="posix-matching-rules"/> for how this differs from
<literal>^</literal>) </entry>
</row>
<row>
<entry> <literal>\Z</literal> </entry>
<entry> matches only at the end of the string
- (see <xref linkend="posix-matching-rules"> for how this differs from
+ (see <xref linkend="posix-matching-rules"/> for how this differs from
<literal>$</literal>) </entry>
</row>
</tbody>
a regex operator, or the <replaceable>flags</replaceable> parameter to a regex
function.
The available option letters are
- shown in <xref linkend="posix-embedded-options-table">.
+ shown in <xref linkend="posix-embedded-options-table"/>.
Note that these same option letters are used in the <replaceable>flags</replaceable>
parameters of regex functions.
</para>
<row>
<entry> <literal>i</literal> </entry>
<entry> case-insensitive matching (see
- <xref linkend="posix-matching-rules">) (overrides operator type) </entry>
+ <xref linkend="posix-matching-rules"/>) (overrides operator type) </entry>
</row>
<row>
<row>
<entry> <literal>n</literal> </entry>
<entry> newline-sensitive matching (see
- <xref linkend="posix-matching-rules">) </entry>
+ <xref linkend="posix-matching-rules"/>) </entry>
</row>
<row>
<entry> <literal>p</literal> </entry>
<entry> partial newline-sensitive matching (see
- <xref linkend="posix-matching-rules">) </entry>
+ <xref linkend="posix-matching-rules"/>) </entry>
</row>
<row>
<row>
<entry> <literal>w</literal> </entry>
<entry> inverse partial newline-sensitive (<quote>weird</quote>) matching
- (see <xref linkend="posix-matching-rules">) </entry>
+ (see <xref linkend="posix-matching-rules"/>) </entry>
</row>
<row>
provide a powerful set of tools for converting various data types
(date/time, integer, floating point, numeric) to formatted strings
and for converting from formatted strings to specific data types.
- <xref linkend="functions-formatting-table"> lists them.
+ <xref linkend="functions-formatting-table"/> lists them.
These functions all follow a common calling convention: the first
argument is the value to be formatted and the second argument is a
template that defines the output or input format.
<note>
<para>
There is also a single-argument <function>to_timestamp</function>
- function; see <xref linkend="functions-datetime-table">.
+ function; see <xref linkend="functions-datetime-table"/>.
</para>
</note>
</para>
<para>
- <xref linkend="functions-formatting-datetime-table"> shows the
+ <xref linkend="functions-formatting-datetime-table"/> shows the
template patterns available for formatting date and time values.
</para>
behavior. For example, <literal>FMMonth</literal>
is the <literal>Month</literal> pattern with the
<literal>FM</literal> modifier.
- <xref linkend="functions-formatting-datetimemod-table"> shows the
+ <xref linkend="functions-formatting-datetimemod-table"/> shows the
modifier patterns for date/time formatting.
</para>
<row>
<entry><literal>TM</literal> prefix</entry>
<entry>translation mode (print localized day and month names based on
- <xref linkend="guc-lc-time">)</entry>
+ <xref linkend="guc-lc-time"/>)</entry>
<entry><literal>TMMonth</literal></entry>
</row>
<row>
specifications like <literal>YYYY-MM-DD (IYYY-IDDD)</literal> can be
useful. But avoid writing something like <literal>IYYY-MM-DD</literal>;
that would yield surprising results near the start of the year.
- (See <xref linkend="functions-datetime-extract"> for more
+ (See <xref linkend="functions-datetime-extract"/> for more
information.)
</para>
</caution>
</para>
<para>
- <xref linkend="functions-formatting-numeric-table"> shows the
+ <xref linkend="functions-formatting-numeric-table"/> shows the
template patterns available for formatting numeric values.
</para>
The pattern characters <literal>S</literal>, <literal>L</literal>, <literal>D</literal>,
and <literal>G</literal> represent the sign, currency symbol, decimal point,
and thousands separator characters defined by the current locale
- (see <xref linkend="guc-lc-monetary">
- and <xref linkend="guc-lc-numeric">). The pattern characters period
+ (see <xref linkend="guc-lc-monetary"/>
+ and <xref linkend="guc-lc-numeric"/>). The pattern characters period
and comma represent those exact characters, with the meanings of
decimal point and thousands separator, regardless of locale.
</para>
behavior. For example, <literal>FM99.99</literal>
is the <literal>99.99</literal> pattern with the
<literal>FM</literal> modifier.
- <xref linkend="functions-formatting-numericmod-table"> shows the
+ <xref linkend="functions-formatting-numericmod-table"/> shows the
modifier patterns for numeric formatting.
</para>
</table>
<para>
- <xref linkend="functions-formatting-examples-table"> shows some
+ <xref linkend="functions-formatting-examples-table"/> shows some
examples of the use of the <function>to_char</function> function.
</para>
<title>Date/Time Functions and Operators</title>
<para>
- <xref linkend="functions-datetime-table"> shows the available
+ <xref linkend="functions-datetime-table"/> shows the available
functions for date/time value processing, with details appearing in
the following subsections. <xref
- linkend="operators-datetime-table"> illustrates the behaviors of
+ linkend="operators-datetime-table"/> illustrates the behaviors of
the basic arithmetic operators (<literal>+</literal>,
<literal>*</literal>, etc.). For formatting functions, refer to
- <xref linkend="functions-formatting">. You should be familiar with
+ <xref linkend="functions-formatting"/>. You should be familiar with
the background information on date/time data types from <xref
- linkend="datatype-datetime">.
+ linkend="datatype-datetime"/>.
</para>
<para>
</entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Current date and time (changes during statement execution);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>date</type></entry>
<entry>Current date;
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>time with time zone</type></entry>
<entry>Current time of day;
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Current date and time (start of current transaction);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>double precision</type></entry>
<entry>Get subfield (equivalent to <function>extract</function>);
- see <xref linkend="functions-datetime-extract">
+ see <xref linkend="functions-datetime-extract"/>
</entry>
<entry><literal>date_part('hour', timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>20</literal></entry>
<entry><literal><function>date_part(<type>text</type>, <type>interval</type>)</function></literal></entry>
<entry><type>double precision</type></entry>
<entry>Get subfield (equivalent to
- <function>extract</function>); see <xref linkend="functions-datetime-extract">
+ <function>extract</function>); see <xref linkend="functions-datetime-extract"/>
</entry>
<entry><literal>date_part('month', interval '2 years 3 months')</literal></entry>
<entry><literal>3</literal></entry>
<literal><function>date_trunc(<type>text</type>, <type>timestamp</type>)</function></literal>
</entry>
<entry><type>timestamp</type></entry>
- <entry>Truncate to specified precision; see also <xref linkend="functions-datetime-trunc">
+ <entry>Truncate to specified precision; see also <xref linkend="functions-datetime-trunc"/>
</entry>
<entry><literal>date_trunc('hour', timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>2001-02-16 20:00:00</literal></entry>
<row>
<entry><literal><function>date_trunc(<type>text</type>, <type>interval</type>)</function></literal></entry>
<entry><type>interval</type></entry>
- <entry>Truncate to specified precision; see also <xref linkend="functions-datetime-trunc">
+ <entry>Truncate to specified precision; see also <xref linkend="functions-datetime-trunc"/>
</entry>
<entry><literal>date_trunc('hour', interval '2 days 3 hours 40 minutes')</literal></entry>
<entry><literal>2 days 03:00:00</literal></entry>
<type>timestamp</type>)</literal>
</entry>
<entry><type>double precision</type></entry>
- <entry>Get subfield; see <xref linkend="functions-datetime-extract">
+ <entry>Get subfield; see <xref linkend="functions-datetime-extract"/>
</entry>
<entry><literal>extract(hour from timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>20</literal></entry>
<entry><literal><function>extract</function>(<parameter>field</parameter> from
<type>interval</type>)</literal></entry>
<entry><type>double precision</type></entry>
- <entry>Get subfield; see <xref linkend="functions-datetime-extract">
+ <entry>Get subfield; see <xref linkend="functions-datetime-extract"/>
</entry>
<entry><literal>extract(month from interval '2 years 3 months')</literal></entry>
<entry><literal>3</literal></entry>
</entry>
<entry><type>time</type></entry>
<entry>Current time of day;
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>timestamp</type></entry>
<entry>Current date and time (start of current transaction);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Current date and time (start of current transaction);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Current date and time (start of current statement);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
<entry><type>text</type></entry>
<entry>Current date and time
(like <function>clock_timestamp</function>, but as a <type>text</type> string);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
</entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Current date and time (start of current transaction);
- see <xref linkend="functions-datetime-current">
+ see <xref linkend="functions-datetime-current"/>
</entry>
<entry></entry>
<entry></entry>
<para>
The <function>extract</function> function is primarily intended
for computational processing. For formatting date/time values for
- display, see <xref linkend="functions-formatting">.
+ display, see <xref linkend="functions-formatting"/>.
</para>
<para>
<para>
The <literal>AT TIME ZONE</literal> construct allows conversions
of time stamps to different time zones. <xref
- linkend="functions-datetime-zoneconvert-table"> shows its
+ linkend="functions-datetime-zoneconvert-table"/> shows its
variants.
</para>
specified either as a text string (e.g., <literal>'PST'</literal>)
or as an interval (e.g., <literal>INTERVAL '-08:00'</literal>).
In the text case, a time zone name can be specified in any of the ways
- described in <xref linkend="datatype-timezones">.
+ described in <xref linkend="datatype-timezones"/>.
</para>
<para>
<title>Enum Support Functions</title>
<para>
- For enum types (described in <xref linkend="datatype-enum">),
+ For enum types (described in <xref linkend="datatype-enum"/>),
there are several functions that allow cleaner programming without
hard-coding particular values of an enum type.
- These are listed in <xref linkend="functions-enum-table">. The examples
+ These are listed in <xref linkend="functions-enum-table"/>. The examples
assume an enum type created as:
<programlisting>
<type>lseg</type>, <type>line</type>, <type>path</type>,
<type>polygon</type>, and <type>circle</type> have a large set of
native support functions and operators, shown in <xref
- linkend="functions-geometry-op-table">, <xref
- linkend="functions-geometry-func-table">, and <xref
- linkend="functions-geometry-conv-table">.
+ linkend="functions-geometry-op-table"/>, <xref
+ linkend="functions-geometry-func-table"/>, and <xref
+ linkend="functions-geometry-conv-table"/>.
</para>
<caution>
<title>Network Address Functions and Operators</title>
<para>
- <xref linkend="cidr-inet-operators-table"> shows the operators
+ <xref linkend="cidr-inet-operators-table"/> shows the operators
available for the <type>cidr</type> and <type>inet</type> types.
The operators <literal><<</literal>,
<literal><<=</literal>, <literal>>></literal>,
</table>
<para>
- <xref linkend="cidr-inet-functions-table"> shows the functions
+ <xref linkend="cidr-inet-functions-table"/> shows the functions
available for use with the <type>cidr</type> and <type>inet</type>
types. The <function>abbrev</function>, <function>host</function>,
and <function>text</function>
</para>
<para>
- <xref linkend="macaddr-functions-table"> shows the functions
+ <xref linkend="macaddr-functions-table"/> shows the functions
available for use with the <type>macaddr</type> type. The function
<literal><function>trunc(<type>macaddr</type>)</function></literal> returns a MAC
address with the last 3 bytes set to zero. This can be used to
</para>
<para>
- <xref linkend="macaddr8-functions-table"> shows the functions
+ <xref linkend="macaddr8-functions-table"/> shows the functions
available for use with the <type>macaddr8</type> type. The function
<literal><function>trunc(<type>macaddr8</type>)</function></literal> returns a MAC
address with the last 5 bytes set to zero. This can be used to
</indexterm>
<para>
- <xref linkend="textsearch-operators-table">,
- <xref linkend="textsearch-functions-table"> and
- <xref linkend="textsearch-functions-debug-table">
+ <xref linkend="textsearch-operators-table"/>,
+ <xref linkend="textsearch-functions-table"/> and
+ <xref linkend="textsearch-functions-debug-table"/>
summarize the functions and operators that are provided
- for full text searching. See <xref linkend="textsearch"> for a detailed
+ for full text searching. See <xref linkend="textsearch"/> for a detailed
explanation of <productname>PostgreSQL</productname>'s text search
facility.
</para>
<para>
All the text search functions that accept an optional <type>regconfig</type>
argument will use the configuration specified by
- <xref linkend="guc-default-text-search-config">
+ <xref linkend="guc-default-text-search-config"/>
when that argument is omitted.
</para>
</note>
<para>
The functions in
- <xref linkend="textsearch-functions-debug-table">
+ <xref linkend="textsearch-functions-debug-table"/>
are listed separately because they are not usually used in everyday text
searching operations. They are helpful for development and debugging
of new text search configurations.
<para>
The functions and function-like expressions described in this
section operate on values of type <type>xml</type>. Check <xref
- linkend="datatype-xml"> for information about the <type>xml</type>
+ linkend="datatype-xml"/> for information about the <type>xml</type>
type. The function-like expressions <function>xmlparse</function>
and <function>xmlserialize</function> for converting to and from
type <type>xml</type> are not repeated here. Use of most of these
and & will be converted to entities. Binary data (data type
<type>bytea</type>) will be represented in base64 or hex
encoding, depending on the setting of the configuration parameter
- <xref linkend="guc-xmlbinary">. The particular behavior for
+ <xref linkend="guc-xmlbinary"/>. The particular behavior for
individual data types is expected to evolve in order to align the
SQL and PostgreSQL data types with the XML Schema specification,
at which point a more precise description will appear.
input values to the aggregate function call,
much like <function>xmlconcat</function> does, except that concatenation
occurs across rows rather than across expressions in a single row.
- See <xref linkend="functions-aggregate"> for additional information
+ See <xref linkend="functions-aggregate"/> for additional information
about aggregate functions.
</para>
<para>
To determine the order of the concatenation, an <literal>ORDER BY</literal>
clause may be added to the aggregate call as described in
- <xref linkend="syntax-aggregates">. For example:
+ <xref linkend="syntax-aggregates"/>. For example:
<screen><![CDATA[
SELECT xmlagg(x ORDER BY y DESC) FROM test;
The expression <literal>IS DOCUMENT</literal> returns true if the
argument XML value is a proper XML document, false if it is not
(that is, it is a content fragment), or null if the argument is
- null. See <xref linkend="datatype-xml"> about the difference
+ null. See <xref linkend="datatype-xml"/> about the difference
between documents and content fragments.
</para>
</sect3>
<function>xml_is_well_formed_document</function> checks for a well-formed
document, while <function>xml_is_well_formed_content</function> checks
for well-formed content. <function>xml_is_well_formed</function> does
- the former if the <xref linkend="guc-xmloption"> configuration
+ the former if the <xref linkend="guc-xmloption"/> configuration
parameter is set to <literal>DOCUMENT</literal>, or the latter if it is set to
<literal>CONTENT</literal>. This means that
<function>xml_is_well_formed</function> is useful for seeing whether
<para>
As an example of using the output produced by these functions,
- <xref linkend="xslt-xml-html"> shows an XSLT stylesheet that
+ <xref linkend="xslt-xml-html"/> shows an XSLT stylesheet that
converts the output of
<function>table_to_xml_and_xmlschema</function> to an HTML
document containing a tabular rendition of the table data. In a
</indexterm>
<para>
- <xref linkend="functions-json-op-table"> shows the operators that
+ <xref linkend="functions-json-op-table"/> shows the operators that
are available for use with the two JSON data types (see <xref
- linkend="datatype-json">).
+ linkend="datatype-json"/>).
</para>
<table id="functions-json-op-table">
</note>
<para>
The standard comparison operators shown in <xref
- linkend="functions-comparison-op-table"> are available for
+ linkend="functions-comparison-op-table"/> are available for
<type>jsonb</type>, but not for <type>json</type>. They follow the
ordering rules for B-tree operations outlined at <xref
- linkend="json-indexing">.
+ linkend="json-indexing"/>.
</para>
<para>
Some further operators also exist only for <type>jsonb</type>, as shown
- in <xref linkend="functions-jsonb-op-table">.
+ in <xref linkend="functions-jsonb-op-table"/>.
Many of these operators can be indexed by
<type>jsonb</type> operator classes. For a full description of
<type>jsonb</type> containment and existence semantics, see <xref
- linkend="json-containment">. <xref linkend="json-indexing">
+ linkend="json-containment"/>. <xref linkend="json-indexing"/>
describes how these operators can be used to effectively index
<type>jsonb</type> data.
</para>
</note>
<para>
- <xref linkend="functions-json-creation-table"> shows the functions that are
+ <xref linkend="functions-json-creation-table"/> shows the functions that are
available for creating <type>json</type> and <type>jsonb</type> values.
(There are no equivalent functions for <type>jsonb</type>, of the <literal>row_to_json</literal>
and <literal>array_to_json</literal> functions. However, the <literal>to_jsonb</literal>
<note>
<para>
- The <xref linkend="hstore"> extension has a cast
+ The <xref linkend="hstore"/> extension has a cast
from <type>hstore</type> to <type>json</type>, so that
<type>hstore</type> values converted via the JSON creation functions
will be represented as JSON objects, not as primitive string values.
</note>
<para>
- <xref linkend="functions-json-processing-table"> shows the functions that
+ <xref linkend="functions-json-processing-table"/> shows the functions that
are available for processing <type>json</type> and <type>jsonb</type> values.
</para>
JSON strings to the appropriate single character. This is a non-issue
if the input is type <type>jsonb</type>, because the conversion was already
done; but for <type>json</type> input, this may result in throwing an error,
- as noted in <xref linkend="datatype-json">.
+ as noted in <xref linkend="datatype-json"/>.
</para>
</note>
</note>
<para>
- See also <xref linkend="functions-aggregate"> for the aggregate
+ See also <xref linkend="functions-aggregate"/> for the aggregate
function <function>json_agg</function> which aggregates record
values as JSON, and the aggregate function
<function>json_object_agg</function> which aggregates pairs of values
This section describes functions for operating on <firstterm>sequence
objects</firstterm>, also called sequence generators or just sequences.
Sequence objects are special single-row tables created with <xref
- linkend="sql-createsequence">.
+ linkend="sql-createsequence"/>.
Sequence objects are commonly used to generate unique identifiers
for rows of a table. The sequence functions, listed in <xref
- linkend="functions-sequence-table">, provide simple, multiuser-safe
+ linkend="functions-sequence-table"/>, provide simple, multiuser-safe
methods for obtaining successive sequence values from sequence
objects.
</para>
nextval('"myschema".foo') <lineannotation>same as above</lineannotation>
nextval('foo') <lineannotation>searches search path for <literal>foo</literal></lineannotation>
</programlisting>
- See <xref linkend="datatype-oid"> for more information about
+ See <xref linkend="datatype-oid"/> for more information about
<type>regclass</type>.
</para>
If a sequence object has been created with default parameters,
successive <function>nextval</function> calls will return successive
values beginning with 1. Other behaviors can be obtained by using
- special parameters in the <xref linkend="sql-createsequence"> command;
+ special parameters in the <xref linkend="sql-createsequence"/> command;
see its command reference page for more information.
</para>
<para>
The data types of all the <replaceable>result</replaceable>
expressions must be convertible to a single output type.
- See <xref linkend="typeconv-union-case"> for more details.
+ See <xref linkend="typeconv-union-case"/> for more details.
</para>
<para>
<note>
<para>
- As described in <xref linkend="syntax-express-eval">, there are various
+ As described in <xref linkend="syntax-express-eval"/>, there are various
situations in which subexpressions of an expression are evaluated at
different times, so that the principle that <quote><token>CASE</token>
evaluates only necessary subexpressions</quote> is not ironclad. For
largest or smallest value from a list of any number of expressions.
The expressions must all be convertible to a common data type, which
will be the type of the result
- (see <xref linkend="typeconv-union-case"> for details). NULL values
+ (see <xref linkend="typeconv-union-case"/> for details). NULL values
in the list are ignored. The result will be NULL only if all the
expressions evaluate to NULL.
</para>
<title>Array Functions and Operators</title>
<para>
- <xref linkend="array-operators-table"> shows the operators
+ <xref linkend="array-operators-table"/> shows the operators
available for array types.
</para>
</para>
<para>
- See <xref linkend="arrays"> for more details about array operator
- behavior. See <xref linkend="indexes-types"> for more details about
+ See <xref linkend="arrays"/> for more details about array operator
+ behavior. See <xref linkend="indexes-types"/> for more details about
which operators support indexed operations.
</para>
<para>
- <xref linkend="array-functions-table"> shows the functions
- available for use with array types. See <xref linkend="arrays">
+ <xref linkend="array-functions-table"/> shows the functions
+ available for use with array types. See <xref linkend="arrays"/>
for more information and examples of the use of these functions.
</para>
<entry><type>setof anyelement, anyelement [, ...]</type></entry>
<entry>expand multiple arrays (possibly of different types) to a set
of rows. This is only allowed in the FROM clause; see
- <xref linkend="queries-tablefunctions"></entry>
+ <xref linkend="queries-tablefunctions"/></entry>
<entry><literal>unnest(ARRAY[1,2],ARRAY['foo','bar','baz'])</literal></entry>
<entry><literallayout class="monospaced">1 foo
2 bar
</note>
<para>
- See also <xref linkend="functions-aggregate"> about the aggregate
+ See also <xref linkend="functions-aggregate"/> about the aggregate
function <function>array_agg</function> for use with arrays.
</para>
</sect1>
<title>Range Functions and Operators</title>
<para>
- See <xref linkend="rangetypes"> for an overview of range types.
+ See <xref linkend="rangetypes"/> for an overview of range types.
</para>
<para>
- <xref linkend="range-operators-table"> shows the operators
+ <xref linkend="range-operators-table"/> shows the operators
available for range types.
</para>
</para>
<para>
- <xref linkend="range-functions-table"> shows the functions
+ <xref linkend="range-functions-table"/> shows the functions
available for use with range types.
</para>
<para>
<firstterm>Aggregate functions</firstterm> compute a single result
from a set of input values. The built-in general-purpose aggregate
- functions are listed in <xref linkend="functions-aggregate-table">
+ functions are listed in <xref linkend="functions-aggregate-table"/>
and statistical aggregates in <xref
- linkend="functions-aggregate-statistics-table">.
+ linkend="functions-aggregate-statistics-table"/>.
The built-in within-group ordered-set aggregate functions
- are listed in <xref linkend="functions-orderedset-table">
+ are listed in <xref linkend="functions-orderedset-table"/>
while the built-in within-group hypothetical-set ones are in <xref
- linkend="functions-hypothetical-table">. Grouping operations,
+ linkend="functions-hypothetical-table"/>. Grouping operations,
which are closely related to aggregate functions, are listed in
- <xref linkend="functions-grouping-table">.
+ <xref linkend="functions-grouping-table"/>.
The special syntax considerations for aggregate
- functions are explained in <xref linkend="syntax-aggregates">.
- Consult <xref linkend="tutorial-agg"> for additional introductory
+ functions are explained in <xref linkend="syntax-aggregates"/>.
+ Consult <xref linkend="tutorial-agg"/> for additional introductory
information.
</para>
<type>xml</type>
</entry>
<entry>No</entry>
- <entry>concatenation of XML values (see also <xref linkend="functions-xml-xmlagg">)</entry>
+ <entry>concatenation of XML values (see also <xref linkend="functions-xml-xmlagg"/>)</entry>
</row>
</tbody>
</tgroup>
depending on the order of the input values. This ordering is
unspecified by default, but can be controlled by writing an
<literal>ORDER BY</literal> clause within the aggregate call, as shown in
- <xref linkend="syntax-aggregates">.
+ <xref linkend="syntax-aggregates"/>.
Alternatively, supplying the input values from a sorted subquery
will usually work. For example:
</para>
<para>
- <xref linkend="functions-aggregate-statistics-table"> shows
+ <xref linkend="functions-aggregate-statistics-table"/> shows
aggregate functions typically used in statistical analysis.
(These are separated out merely to avoid cluttering the listing
of more-commonly-used aggregates.) Where the description mentions
</table>
<para>
- <xref linkend="functions-orderedset-table"> shows some
+ <xref linkend="functions-orderedset-table"/> shows some
aggregate functions that use the <firstterm>ordered-set aggregate</firstterm>
syntax. These functions are sometimes referred to as <quote>inverse
distribution</quote> functions.
</table>
<para>
- All the aggregates listed in <xref linkend="functions-orderedset-table">
+ All the aggregates listed in <xref linkend="functions-orderedset-table"/>
ignore null values in their sorted input. For those that take
a <replaceable>fraction</replaceable> parameter, the fraction value must be
between 0 and 1; an error is thrown if not. However, a null fraction value
<para>
Each of the aggregates listed in
- <xref linkend="functions-hypothetical-table"> is associated with a
+ <xref linkend="functions-hypothetical-table"/> is associated with a
window function of the same name defined in
- <xref linkend="functions-window">. In each case, the aggregate result
+ <xref linkend="functions-window"/>. In each case, the aggregate result
is the value that the associated window function would have
returned for the <quote>hypothetical</quote> row constructed from
<replaceable>args</replaceable>, if such a row had been added to the sorted
<para>
Grouping operations are used in conjunction with grouping sets (see
- <xref linkend="queries-grouping-sets">) to distinguish result rows. The
+ <xref linkend="queries-grouping-sets"/>) to distinguish result rows. The
arguments to the <literal>GROUPING</literal> operation are not actually evaluated,
but they must match exactly expressions given in the <literal>GROUP BY</literal>
clause of the associated query level. Bits are assigned with the rightmost
<para>
<firstterm>Window functions</firstterm> provide the ability to perform
calculations across sets of rows that are related to the current query
- row. See <xref linkend="tutorial-window"> for an introduction to this
- feature, and <xref linkend="syntax-window-functions"> for syntax
+ row. See <xref linkend="tutorial-window"/> for an introduction to this
+ feature, and <xref linkend="syntax-window-functions"/> for syntax
details.
</para>
<para>
The built-in window functions are listed in
- <xref linkend="functions-window-table">. Note that these functions
+ <xref linkend="functions-window-table"/>. Note that these functions
<emphasis>must</emphasis> be invoked using window function syntax, i.e., an
<literal>OVER</literal> clause is required.
</para>
general-purpose or statistical
aggregate (i.e., not ordered-set or hypothetical-set aggregates)
can be used as a window function; see
- <xref linkend="functions-aggregate"> for a list of the built-in aggregates.
+ <xref linkend="functions-aggregate"/> for a list of the built-in aggregates.
Aggregate functions act as window functions only when an <literal>OVER</literal>
clause follows the call; otherwise they act as non-window aggregates
and return a single row for the entire set.
<para>
All of the functions listed in
- <xref linkend="functions-window-table"> depend on the sort ordering
+ <xref linkend="functions-window-table"/> depend on the sort ordering
specified by the <literal>ORDER BY</literal> clause of the associated window
definition. Rows that are not distinct when considering only the
<literal>ORDER BY</literal> columns are said to be <firstterm>peers</firstterm>.
sometimes also <function>nth_value</function>. You can redefine the frame by
adding a suitable frame specification (<literal>RANGE</literal> or
<literal>ROWS</literal>) to the <literal>OVER</literal> clause.
- See <xref linkend="syntax-window-functions"> for more information
+ See <xref linkend="syntax-window-functions"/> for more information
about frame specifications.
</para>
<para>
The left-hand side of this form of <token>IN</token> is a row constructor,
- as described in <xref linkend="sql-syntax-row-constructors">.
+ as described in <xref linkend="sql-syntax-row-constructors"/>.
The right-hand side is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand row. The left-hand expressions are
<para>
The left-hand side of this form of <token>NOT IN</token> is a row constructor,
- as described in <xref linkend="sql-syntax-row-constructors">.
+ as described in <xref linkend="sql-syntax-row-constructors"/>.
The right-hand side is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand row. The left-hand expressions are
<para>
The left-hand side of this form of <token>ANY</token> is a row constructor,
- as described in <xref linkend="sql-syntax-row-constructors">.
+ as described in <xref linkend="sql-syntax-row-constructors"/>.
The right-hand side is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand row. The left-hand expressions are
</para>
<para>
- See <xref linkend="row-wise-comparison"> for details about the meaning
+ See <xref linkend="row-wise-comparison"/> for details about the meaning
of a row constructor comparison.
</para>
</sect2>
<para>
The left-hand side of this form of <token>ALL</token> is a row constructor,
- as described in <xref linkend="sql-syntax-row-constructors">.
+ as described in <xref linkend="sql-syntax-row-constructors"/>.
The right-hand side is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand row. The left-hand expressions are
</para>
<para>
- See <xref linkend="row-wise-comparison"> for details about the meaning
+ See <xref linkend="row-wise-comparison"/> for details about the meaning
of a row constructor comparison.
</para>
</sect2>
<para>
The left-hand side is a row constructor,
- as described in <xref linkend="sql-syntax-row-constructors">.
+ as described in <xref linkend="sql-syntax-row-constructors"/>.
The right-hand side is a parenthesized subquery, which must return exactly
as many columns as there are expressions in the left-hand row. Furthermore,
the subquery cannot return more than one row. (If it returns zero rows,
</para>
<para>
- See <xref linkend="row-wise-comparison"> for details about the meaning
+ See <xref linkend="row-wise-comparison"/> for details about the meaning
of a row constructor comparison.
</para>
</sect2>
<para>
Each side is a row constructor,
- as described in <xref linkend="sql-syntax-row-constructors">.
+ as described in <xref linkend="sql-syntax-row-constructors"/>.
The two row values must have the same number of fields.
Each side is evaluated and they are compared row-wise. Row constructor
comparisons are allowed when the <replaceable>operator</replaceable> is
result depends on comparing two NULL values or a NULL and a non-NULL.
<productname>PostgreSQL</productname> does this only when comparing the
results of two row constructors (as in
- <xref linkend="row-wise-comparison">) or comparing a row constructor
- to the output of a subquery (as in <xref linkend="functions-subquery">).
+ <xref linkend="row-wise-comparison"/>) or comparing a row constructor
+ to the output of a subquery (as in <xref linkend="functions-subquery"/>).
In other contexts where two composite-type values are compared, two
NULL field values are considered equal, and a NULL is considered larger
than a non-NULL. This is necessary in order to have consistent sorting
class, or is the negator of the <literal>=</literal> member of a B-tree operator
class.) The default behavior of the above operators is the same as for
<literal>IS [ NOT ] DISTINCT FROM</literal> for row constructors (see
- <xref linkend="row-wise-comparison">).
+ <xref linkend="row-wise-comparison"/>).
</para>
<para>
<para>
This section describes functions that possibly return more than one row.
The most widely used functions in this class are series generating
- functions, as detailed in <xref linkend="functions-srf-series"> and
- <xref linkend="functions-srf-subscripts">. Other, more specialized
+ functions, as detailed in <xref linkend="functions-srf-series"/> and
+ <xref linkend="functions-srf-subscripts"/>. Other, more specialized
set-returning functions are described elsewhere in this manual.
- See <xref linkend="queries-tablefunctions"> for ways to combine multiple
+ See <xref linkend="queries-tablefunctions"/> for ways to combine multiple
set-returning functions.
</para>
<title>System Information Functions</title>
<para>
- <xref linkend="functions-info-session-table"> shows several
+ <xref linkend="functions-info-session-table"/> shows several
functions that extract session and system information.
</para>
<para>
In addition to the functions listed in this section, there are a number of
functions related to the statistics system that also provide system
- information. See <xref linkend="monitoring-stats-views"> for more
+ information. See <xref linkend="monitoring-stats-views"/> for more
information.
</para>
<row>
<entry><literal><function>version()</function></literal></entry>
<entry><type>text</type></entry>
- <entry><productname>PostgreSQL</productname> version information. See also <xref linkend="guc-server-version-num"> for a machine-readable version.</entry>
+ <entry><productname>PostgreSQL</productname> version information. See also <xref linkend="guc-server-version-num"/> for a machine-readable version.</entry>
</row>
</tbody>
</tgroup>
<para>
The <function>session_user</function> is normally the user who initiated
the current database connection; but superusers can change this setting
- with <xref linkend="sql-set-session-authorization">.
+ with <xref linkend="sql-set-session-authorization"/>.
The <function>current_user</function> is the user identifier
that is applicable for permission checking. Normally it is equal
to the session user, but it can be changed with
- <xref linkend="sql-set-role">.
+ <xref linkend="sql-set-role"/>.
It also changes during the execution of
functions with the attribute <literal>SECURITY DEFINER</literal>.
In Unix parlance, the session user is the <quote>real user</quote> and
<para>
<function>pg_current_logfile</function> returns, as <type>text</type>,
the path of the log file(s) currently in use by the logging collector.
- The path includes the <xref linkend="guc-log-directory"> directory
+ The path includes the <xref linkend="guc-log-directory"/> directory
and the log file name. Log collection must be enabled or the return value
is <literal>NULL</literal>. When multiple log files exist, each in a
different format, <function>pg_current_logfile</function> called
either <systemitem>csvlog</systemitem> or <systemitem>stderr</systemitem> as the value of the
optional parameter. The return value is <literal>NULL</literal> when the
log format requested is not a configured
- <xref linkend="guc-log-destination">. The
+ <xref linkend="guc-log-destination"/>. The
<function>pg_current_logfiles</function> reflects the contents of the
<filename>current_logfiles</filename> file.
</para>
fraction of the total available space for notifications currently
occupied by notifications that are waiting to be processed, as a
<type>double</type> in the range 0-1.
- See <xref linkend="sql-listen"> and <xref linkend="sql-notify">
+ See <xref linkend="sql-listen"/> and <xref linkend="sql-notify"/>
for more information.
</para>
running a <literal>SERIALIZABLE</literal> transaction blocks
a <literal>SERIALIZABLE READ ONLY DEFERRABLE</literal> transaction from
acquiring a snapshot until the latter determines that it is safe to avoid
- taking any predicate locks. See <xref linkend="xact-serializable"> for
+ taking any predicate locks. See <xref linkend="xact-serializable"/> for
more information about serializable and deferrable transactions. Frequent
calls to this function could have some impact on database performance,
because it needs access to the predicate lock manager's shared
<para>
<function>version</function> returns a string describing the
<productname>PostgreSQL</productname> server's version. You can also
- get this information from <xref linkend="guc-server-version"> or
- for a machine-readable version, <xref linkend="guc-server-version-num">.
+ get this information from <xref linkend="guc-server-version"/> or
+ for a machine-readable version, <xref linkend="guc-server-version-num"/>.
Software developers should use <literal>server_version_num</literal>
- (available since 8.2) or <xref linkend="libpq-pqserverversion"> instead
+ (available since 8.2) or <xref linkend="libpq-pqserverversion"/> instead
of parsing the text version.
</para>
</indexterm>
<para>
- <xref linkend="functions-info-access-table"> lists functions that
+ <xref linkend="functions-info-access-table"/> lists functions that
allow the user to query object access privileges programmatically.
- See <xref linkend="ddl-priv"> for more information about
+ See <xref linkend="ddl-priv"/> for more information about
privileges.
</para>
are analogous to <function>has_table_privilege</function>.
When specifying a function by a text string rather than by OID,
the allowed input is the same as for the <type>regprocedure</type> data type
- (see <xref linkend="datatype-oid">).
+ (see <xref linkend="datatype-oid"/>).
The desired access privilege type must evaluate to
<literal>EXECUTE</literal>.
An example is:
are analogous to <function>has_table_privilege</function>.
When specifying a type by a text string rather than by OID,
the allowed input is the same as for the <type>regtype</type> data type
- (see <xref linkend="datatype-oid">).
+ (see <xref linkend="datatype-oid"/>).
The desired access privilege type must evaluate to
<literal>USAGE</literal>.
</para>
</para>
<para>
- <xref linkend="functions-info-schema-table"> shows functions that
+ <xref linkend="functions-info-schema-table"/> shows functions that
determine whether a certain object is <firstterm>visible</firstterm> in the
current schema search path.
For example, a table is said to be visible if its
</indexterm>
<para>
- <xref linkend="functions-info-catalog-table"> lists functions that
+ <xref linkend="functions-info-catalog-table"/> lists functions that
extract information from the system catalogs.
</para>
second parameter, being just a column name, is treated as double-quoted and
has its case preserved. The function returns a value suitably formatted
for passing to sequence functions
- (see <xref linkend="functions-sequence">). A typical use is in reading the
+ (see <xref linkend="functions-sequence"/>). A typical use is in reading the
current value of a sequence for an identity or serial column, for example:
<programlisting>
SELECT currval(pg_get_serial_sequence('sometable', 'id'));
property. <literal>NULL</literal> is returned if the property name is not
known or does not apply to the particular object, or if the OID or column
number does not identify a valid object. Refer to
- <xref linkend="functions-info-index-column-props"> for column properties,
- <xref linkend="functions-info-index-props"> for index properties, and
- <xref linkend="functions-info-indexam-props"> for access method properties.
+ <xref linkend="functions-info-index-column-props"/> for column properties,
+ <xref linkend="functions-info-index-props"/> for index properties, and
+ <xref linkend="functions-info-indexam-props"/> for access method properties.
(Note that extension access methods can define additional property names
for their indexes.)
</para>
value that is passed to it. This can be helpful for troubleshooting or
dynamically constructing SQL queries. The function is declared as
returning <type>regtype</type>, which is an OID alias type (see
- <xref linkend="datatype-oid">); this means that it is the same as an
+ <xref linkend="datatype-oid"/>); this means that it is the same as an
OID for comparison purposes but displays as a type name. For example:
<programlisting>
SELECT pg_typeof(33);
</indexterm>
<para>
- <xref linkend="functions-info-object-table"> lists functions related to
+ <xref linkend="functions-info-object-table"/> lists functions related to
database object identification and addressing.
</para>
</indexterm>
<para>
- The functions shown in <xref linkend="functions-info-comment-table">
- extract comments previously stored with the <xref linkend="sql-comment">
+ The functions shown in <xref linkend="functions-info-comment-table"/>
+ extract comments previously stored with the <xref linkend="sql-comment"/>
command. A null value is returned if no
comment could be found for the specified parameters.
</para>
</indexterm>
<para>
- The functions shown in <xref linkend="functions-txid-snapshot">
+ The functions shown in <xref linkend="functions-txid-snapshot"/>
provide server transaction information in an exportable form. The main
use of these functions is to determine which transactions were committed
between two snapshots.
The data type used by these functions, <type>txid_snapshot</type>,
stores information about transaction ID
visibility at a particular moment in time. Its components are
- described in <xref linkend="functions-txid-snapshot-parts">.
+ described in <xref linkend="functions-txid-snapshot-parts"/>.
</para>
<table id="functions-txid-snapshot-parts">
</para>
<para>
- The functions shown in <xref linkend="functions-commit-timestamp">
+ The functions shown in <xref linkend="functions-commit-timestamp"/>
provide information about transactions that have been already committed.
These functions mainly provide information about when the transactions
were committed. They only provide useful data when
- <xref linkend="guc-track-commit-timestamp"> configuration option is enabled
+ <xref linkend="guc-track-commit-timestamp"/> configuration option is enabled
and only for transactions that were committed after it was enabled.
</para>
</table>
<para>
- The functions shown in <xref linkend="functions-controldata">
+ The functions shown in <xref linkend="functions-controldata"/>
print information initialized during <command>initdb</command>, such
as the catalog version. They also show information about write-ahead
logging and checkpoint processing. This information is cluster-wide,
and not specific to any one database. They provide most of the same
information, from the same source, as
- <xref linkend="app-pgcontroldata">, although in a form better suited
+ <xref linkend="app-pgcontroldata"/>, although in a form better suited
to <acronym>SQL</acronym> functions.
</para>
<para>
<function>pg_control_checkpoint</function> returns a record, shown in
- <xref linkend="functions-pg-control-checkpoint">
+ <xref linkend="functions-pg-control-checkpoint"/>
</para>
<table id="functions-pg-control-checkpoint">
<para>
<function>pg_control_system</function> returns a record, shown in
- <xref linkend="functions-pg-control-system">
+ <xref linkend="functions-pg-control-system"/>
</para>
<table id="functions-pg-control-system">
<para>
<function>pg_control_init</function> returns a record, shown in
- <xref linkend="functions-pg-control-init">
+ <xref linkend="functions-pg-control-init"/>
</para>
<table id="functions-pg-control-init">
<para>
<function>pg_control_recovery</function> returns a record, shown in
- <xref linkend="functions-pg-control-recovery">
+ <xref linkend="functions-pg-control-recovery"/>
</para>
<table id="functions-pg-control-recovery">
<title>Configuration Settings Functions</title>
<para>
- <xref linkend="functions-admin-set-table"> shows the functions
+ <xref linkend="functions-admin-set-table"/> shows the functions
available to query and alter run-time configuration parameters.
</para>
<para>
The functions shown in <xref
- linkend="functions-admin-signal-table"> send control signals to
+ linkend="functions-admin-signal-table"/> send control signals to
other server processes. Use of these functions is restricted to
superusers by default but access may be granted to others using
<command>GRANT</command>, with noted exceptions.
<para>
The functions shown in <xref
- linkend="functions-admin-backup-table"> assist in making on-line backups.
+ linkend="functions-admin-backup-table"/> assist in making on-line backups.
These functions cannot be executed during recovery (except
<function>pg_is_in_backup</function>, <function>pg_backup_start_time</function>
and <function>pg_wal_lsn_diff</function>).
<function>pg_create_restore_point</function> creates a named write-ahead log
record that can be used as recovery target, and returns the corresponding
write-ahead log location. The given name can then be used with
- <xref linkend="recovery-target-name"> to specify the point up to which
+ <xref linkend="recovery-target-name"/> to specify the point up to which
recovery will proceed. Avoid creating multiple restore points with the
same name, since recovery will stop at the first one whose name matches
the recovery target.
<function>pg_wal_lsn_diff</function> calculates the difference in bytes
between two write-ahead log locations. It can be used with
<structname>pg_stat_replication</structname> or some functions shown in
- <xref linkend="functions-admin-backup-table"> to get the replication lag.
+ <xref linkend="functions-admin-backup-table"/> to get the replication lag.
</para>
<para>
For details about proper usage of these functions, see
- <xref linkend="continuous-archiving">.
+ <xref linkend="continuous-archiving"/>.
</para>
</sect2>
<para>
The functions shown in <xref
- linkend="functions-recovery-info-table"> provide information
+ linkend="functions-recovery-info-table"/> provide information
about the current status of the standby.
These functions may be executed both during recovery and in normal running.
</para>
<para>
The functions shown in <xref
- linkend="functions-recovery-control-table"> control the progress of recovery.
+ linkend="functions-recovery-control-table"/> control the progress of recovery.
These functions may be executed only during recovery.
</para>
<para>
Snapshots are exported with the <function>pg_export_snapshot</function> function,
- shown in <xref linkend="functions-snapshot-synchronization-table">, and
- imported with the <xref linkend="sql-set-transaction"> command.
+ shown in <xref linkend="functions-snapshot-synchronization-table"/>, and
+ imported with the <xref linkend="sql-set-transaction"/> command.
</para>
<table id="functions-snapshot-synchronization-table">
COMMITTED</literal> transactions, since in <literal>REPEATABLE READ</literal> and
higher isolation levels, transactions use the same snapshot throughout
their lifetime. Once a transaction has exported any snapshots, it cannot
- be prepared with <xref linkend="sql-prepare-transaction">.
+ be prepared with <xref linkend="sql-prepare-transaction"/>.
</para>
<para>
- See <xref linkend="sql-set-transaction"> for details of how to use an
+ See <xref linkend="sql-set-transaction"/> for details of how to use an
exported snapshot.
</para>
</sect2>
<para>
The functions shown
- in <xref linkend="functions-replication-table"> are for
+ in <xref linkend="functions-replication-table"/> are for
controlling and interacting with replication features.
- See <xref linkend="streaming-replication">,
- <xref linkend="streaming-replication-slots">, and
- <xref linkend="replication-origins">
+ See <xref linkend="streaming-replication"/>,
+ <xref linkend="streaming-replication-slots"/>, and
+ <xref linkend="replication-origins"/>
for information about the underlying features. Use of these
functions is restricted to superusers.
</para>
<para>
Many of these functions have equivalent commands in the replication
- protocol; see <xref linkend="protocol-replication">.
+ protocol; see <xref linkend="protocol-replication"/>.
</para>
<para>
The functions described in
- <xref linkend="functions-admin-backup">,
- <xref linkend="functions-recovery-control">, and
- <xref linkend="functions-snapshot-synchronization">
+ <xref linkend="functions-admin-backup"/>,
+ <xref linkend="functions-recovery-control"/>, and
+ <xref linkend="functions-snapshot-synchronization"/>
are also relevant for replication.
</para>
the <acronym>LSN</acronym> is reserved on first connection from a streaming
replication client. Streaming changes from a physical slot is only
possible with the streaming-replication protocol —
- see <xref linkend="protocol-replication">. The optional third
+ see <xref linkend="protocol-replication"/>. The optional third
parameter, <parameter>temporary</parameter>, when set to true, specifies that
the slot should not be permanently stored to disk and is only meant
for use by current session. Temporary slots are also
<title>Database Object Management Functions</title>
<para>
- The functions shown in <xref linkend="functions-admin-dbsize"> calculate
+ The functions shown in <xref linkend="functions-admin-dbsize"/> calculate
the disk space usage of database objects.
</para>
<listitem>
<para>
<literal>'fsm'</literal> returns the size of the Free Space Map
- (see <xref linkend="storage-fsm">) associated with the relation.
+ (see <xref linkend="storage-fsm"/>) associated with the relation.
</para>
</listitem>
<listitem>
<para>
<literal>'vm'</literal> returns the size of the Visibility Map
- (see <xref linkend="storage-vm">) associated with the relation.
+ (see <xref linkend="storage-vm"/>) associated with the relation.
</para>
</listitem>
<listitem>
</para>
<para>
- The functions shown in <xref linkend="functions-admin-dblocation"> assist
+ The functions shown in <xref linkend="functions-admin-dblocation"/> assist
in identifying the specific disk files associated with database objects.
</para>
<function>pg_relation_filenode</function> accepts the OID or name of a table,
index, sequence, or toast table, and returns the <quote>filenode</quote> number
currently assigned to it. The filenode is the base component of the file
- name(s) used for the relation (see <xref linkend="storage-file-layout">
+ name(s) used for the relation (see <xref linkend="storage-file-layout"/>
for more information). For most tables the result is the same as
<structname>pg_class</structname>.<structfield>relfilenode</structfield>, but for certain
system catalogs <structfield>relfilenode</structfield> is zero and this function must
</para>
<para>
- <xref linkend="functions-admin-collation"> lists functions used to manage
+ <xref linkend="functions-admin-collation"/> lists functions used to manage
collations.
</para>
operating system. If this is different from the value
in <literal>pg_collation.collversion</literal>, then objects depending on
the collation might need to be rebuilt. See also
- <xref linkend="sql-altercollation">.
+ <xref linkend="sql-altercollation"/>.
</para>
<para>
catalog <literal>pg_collation</literal> based on all the
locales it finds in the operating system. This is
what <command>initdb</command> uses;
- see <xref linkend="collation-managing"> for more details. If additional
+ see <xref linkend="collation-managing"/> for more details. If additional
locales are installed into the operating system later on, this function
can be run again to add collations for the new locales. Locales that
match existing entries in <literal>pg_collation</literal> will be skipped.
</indexterm>
<para>
- <xref linkend="functions-admin-index-table"> shows the functions
+ <xref linkend="functions-admin-index-table"/> shows the functions
available for index maintenance tasks.
These functions cannot be executed during recovery.
Use of these functions is restricted to superusers and the owner
Note that if the argument is a GIN index built with
the <literal>fastupdate</literal> option disabled, no cleanup happens and the
return value is 0, because the index doesn't have a pending list.
- Please see <xref linkend="gin-fast-update"> and <xref linkend="gin-tips">
+ Please see <xref linkend="gin-fast-update"/> and <xref linkend="gin-tips"/>
for details of the pending list and <literal>fastupdate</literal> option.
</para>
<para>
The functions shown in <xref
- linkend="functions-admin-genfile-table"> provide native access to
+ linkend="functions-admin-genfile-table"/> provide native access to
files on the machine hosting the server. Only files within the
database cluster directory and the <varname>log_directory</varname> can be
accessed. Use a relative path for files in the cluster directory,
<title>Advisory Lock Functions</title>
<para>
- The functions shown in <xref linkend="functions-advisory-locks-table">
+ The functions shown in <xref linkend="functions-advisory-locks-table"/>
manage advisory locks. For details about proper use of these functions,
- see <xref linkend="advisory-locks">.
+ see <xref linkend="advisory-locks"/>.
</para>
<table id="functions-advisory-locks-table">
</para>
<para>
For more information about creating triggers, see
- <xref linkend="sql-createtrigger">.
+ <xref linkend="sql-createtrigger"/>.
</para>
</sect1>
<para>
For more information about event triggers,
- see <xref linkend="event-triggers">.
+ see <xref linkend="event-triggers"/>.
</para>
<sect2 id="pg-event-trigger-ddl-command-end-functions">
<para>
The functions shown in
- <xref linkend="functions-event-trigger-table-rewrite">
+ <xref linkend="functions-event-trigger-table-rewrite"/>
provide information about a table for which a
<literal>table_rewrite</literal> event has just been called.
If called in any other context, an error is raised.
choices made during both the initial population selection and subsequent
<quote>mutation</quote> of the best candidates. To avoid surprising changes
of the selected plan, each run of the GEQO algorithm restarts its
- random number generator with the current <xref linkend="guc-geqo-seed">
+ random number generator with the current <xref linkend="guc-geqo-seed"/>
parameter setting. As long as <varname>geqo_seed</varname> and the other
GEQO parameters are kept fixed, the same plan will be generated for a
given query (and other planner inputs such as statistics). To experiment
<listitem>
<para>
- <xref linkend="elma04">
+ <xref linkend="elma04"/>
</para>
</listitem>
<listitem>
<para>
- <xref linkend="fong">
+ <xref linkend="fong"/>
</para>
</listitem>
</itemizedlist>
<para>
The core <productname>PostgreSQL</productname> distribution
includes the <acronym>GIN</acronym> operator classes shown in
- <xref linkend="gin-builtin-opclasses-table">.
- (Some of the optional modules described in <xref linkend="contrib">
+ <xref linkend="gin-builtin-opclasses-table"/>.
+ (Some of the optional modules described in <xref linkend="contrib"/>
provide additional <acronym>GIN</acronym> operator classes.)
</para>
Of the two operator classes for type <type>jsonb</type>, <literal>jsonb_ops</literal>
is the default. <literal>jsonb_path_ops</literal> supports fewer operators but
offers better performance for those operators.
- See <xref linkend="json-indexing"> for details.
+ See <xref linkend="json-indexing"/> for details.
</para>
</sect1>
<literal>query</literal> is the value on the right-hand side of an
indexable operator whose left-hand side is the indexed column.
<literal>n</literal> is the strategy number of the operator within the
- operator class (see <xref linkend="xindex-strategies">).
+ operator class (see <xref linkend="xindex-strategies"/>).
Often, <function>extractQuery</function> will need
to consult <literal>n</literal> to determine the data type of
<literal>query</literal> and the method it should use to extract key values.
provide the <function>comparePartial</function> method, and its
<function>extractQuery</function> method must set the <literal>pmatch</literal>
parameter when a partial-match query is encountered. See
- <xref linkend="gin-partial-match"> for details.
+ <xref linkend="gin-partial-match"/> for details.
</para>
<para>
When the table is vacuumed or autoanalyzed, or when
<function>gin_clean_pending_list</function> function is called, or if the
pending list becomes larger than
- <xref linkend="guc-gin-pending-list-limit">, the entries are moved to the
+ <xref linkend="guc-gin-pending-list-limit"/>, the entries are moved to the
main <acronym>GIN</acronym> data structure using the same bulk insert
techniques used during initial index creation. This greatly improves
<acronym>GIN</acronym> index update speed, even counting the additional
If consistent response time is more important than update speed,
use of pending entries can be disabled by turning off the
<literal>fastupdate</literal> storage parameter for a
- <acronym>GIN</acronym> index. See <xref linkend="sql-createindex">
+ <acronym>GIN</acronym> index. See <xref linkend="sql-createindex"/>
for details.
</para>
</sect2>
<para>
As of <productname>PostgreSQL</productname> 8.4, this advice is less
necessary since delayed indexing is used (see <xref
- linkend="gin-fast-update"> for details). But for very large updates
+ linkend="gin-fast-update"/> for details). But for very large updates
it may still be best to drop and recreate the index.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><xref linkend="guc-maintenance-work-mem"></term>
+ <term><xref linkend="guc-maintenance-work-mem"/></term>
<listitem>
<para>
Build time for a <acronym>GIN</acronym> index is very sensitive to
</varlistentry>
<varlistentry>
- <term><xref linkend="guc-gin-pending-list-limit"></term>
+ <term><xref linkend="guc-gin-pending-list-limit"/></term>
<listitem>
<para>
During a series of insertions into an existing <acronym>GIN</acronym>
</varlistentry>
<varlistentry>
- <term><xref linkend="guc-gin-fuzzy-search-limit"></term>
+ <term><xref linkend="guc-gin-fuzzy-search-limit"/></term>
<listitem>
<para>
The primary goal of developing <acronym>GIN</acronym> indexes was
<para>
The core <productname>PostgreSQL</productname> distribution
includes the <acronym>GIN</acronym> operator classes previously shown in
- <xref linkend="gin-builtin-opclasses-table">.
+ <xref linkend="gin-builtin-opclasses-table"/>.
The following <filename>contrib</filename> modules also contain
<acronym>GIN</acronym> operator classes:
<para>
The core <productname>PostgreSQL</productname> distribution
includes the <acronym>GiST</acronym> operator classes shown in
- <xref linkend="gist-builtin-opclasses-table">.
- (Some of the optional modules described in <xref linkend="contrib">
+ <xref linkend="gist-builtin-opclasses-table"/>.
+ (Some of the optional modules described in <xref linkend="contrib"/>
provide additional <acronym>GiST</acronym> operator classes.)
</para>
<para>
By default, a GiST index build switches to the buffering method when the
- index size reaches <xref linkend="guc-effective-cache-size">. It can
+ index size reaches <xref linkend="guc-effective-cache-size"/>. It can
be manually turned on or off by the <literal>buffering</literal> parameter
to the CREATE INDEX command. The default behavior is good for most cases,
but turning buffering off might speed up the build somewhat if the input
Shared hardware functionality is common in network storage devices.
Using a network file system is also possible, though care must be
taken that the file system has full <acronym>POSIX</acronym> behavior (see <xref
- linkend="creating-cluster-nfs">). One significant limitation of this
+ linkend="creating-cluster-nfs"/>). One significant limitation of this
method is that if the shared disk array fails or becomes corrupt, the
primary and standby servers are both nonfunctional. Another issue is
that the standby server should never access the shared storage while
</para>
<para>
A standby server can be implemented using file-based log shipping
- (<xref linkend="warm-standby">) or streaming replication (see
- <xref linkend="streaming-replication">), or a combination of both. For
- information on hot standby, see <xref linkend="hot-standby">.
+ (<xref linkend="warm-standby"/>) or streaming replication (see
+ <xref linkend="streaming-replication"/>), or a combination of both. For
+ information on hot standby, see <xref linkend="hot-standby"/>.
</para>
</listitem>
</varlistentry>
individual tables to be replicated. Logical replication doesn't require
a particular server to be designated as a master or a replica but allows
data to flow in multiple directions. For more information on logical
- replication, see <xref linkend="logical-replication">. Through the
- logical decoding interface (<xref linkend="logicaldecoding">),
+ replication, see <xref linkend="logical-replication"/>. Through the
+ logical decoding interface (<xref linkend="logicaldecoding"/>),
third-party extensions can also provide similar functionality.
</para>
</listitem>
standby servers via master-standby replication, not by the replication
middleware. Care must also be taken that all
transactions either commit or abort on all servers, perhaps
- using two-phase commit (<xref linkend="sql-prepare-transaction">
- and <xref linkend="sql-commit-prepared">).
+ using two-phase commit (<xref linkend="sql-prepare-transaction"/>
+ and <xref linkend="sql-commit-prepared"/>).
<productname>Pgpool-II</productname> and <productname>Continuent Tungsten</productname>
are examples of this type of replication.
</para>
<para>
<productname>PostgreSQL</productname> does not offer this type of replication,
though <productname>PostgreSQL</productname> two-phase commit (<xref
- linkend="sql-prepare-transaction"> and <xref
- linkend="sql-commit-prepared">)
+ linkend="sql-prepare-transaction"/> and <xref
+ linkend="sql-commit-prepared"/>)
can be used to implement this in application code or middleware.
</para>
</listitem>
</variablelist>
<para>
- <xref linkend="high-availability-matrix"> summarizes
+ <xref linkend="high-availability-matrix"/> summarizes
the capabilities of the various solutions listed above.
</para>
varies according to the transaction rate of the primary server.
Record-based log shipping is more granular and streams WAL changes
incrementally over a network connection (see <xref
- linkend="streaming-replication">).
+ linkend="streaming-replication"/>).
</para>
<para>
<varname>archive_timeout</varname> parameter, which can be set as low
as a few seconds. However such a low setting will
substantially increase the bandwidth required for file shipping.
- Streaming replication (see <xref linkend="streaming-replication">)
+ Streaming replication (see <xref linkend="streaming-replication"/>)
allows a much smaller window of data loss.
</para>
rollforward will take considerably longer, so that technique only
offers a solution for disaster recovery, not high availability.
A standby server can also be used for read-only queries, in which case
- it is called a Hot Standby server. See <xref linkend="hot-standby"> for
+ it is called a Hot Standby server. See <xref linkend="hot-standby"/> for
more information.
</para>
associated with tablespaces will be passed across unmodified, so both
primary and standby servers must have the same mount paths for
tablespaces if that feature is used. Keep in mind that if
- <xref linkend="sql-createtablespace">
+ <xref linkend="sql-createtablespace"/>
is executed on the primary, any new mount point needed for it must
be created on the primary and all standby servers before the command
is executed. Hardware need not be exactly the same, but experience shows
<para>
In standby mode, the server continuously applies WAL received from the
master server. The standby server can read WAL from a WAL archive
- (see <xref linkend="restore-command">) or directly from the master
+ (see <xref linkend="restore-command"/>) or directly from the master
over a TCP connection (streaming replication). The standby server will
also attempt to restore any WAL found in the standby cluster's
<filename>pg_wal</filename> directory. That typically happens after a server
<para>
Set up continuous archiving on the primary to an archive directory
accessible from the standby, as described
- in <xref linkend="continuous-archiving">. The archive location should be
+ in <xref linkend="continuous-archiving"/>. The archive location should be
accessible from the standby even when the master is down, i.e. it should
reside on the standby server itself or another trusted server, not on
the master server.
</para>
<para>
- Take a base backup as described in <xref linkend="backup-base-backup">
+ Take a base backup as described in <xref linkend="backup-base-backup"/>
to bootstrap the standby server.
</para>
</sect2>
<para>
To set up the standby server, restore the base backup taken from primary
- server (see <xref linkend="backup-pitr-recovery">). Create a recovery
+ server (see <xref linkend="backup-pitr-recovery"/>). Create a recovery
command file <filename>recovery.conf</filename> in the standby's cluster data
directory, and turn on <varname>standby_mode</varname>. Set
<varname>restore_command</varname> to a simple command to copy files from
Do not use pg_standby or similar tools with the built-in standby mode
described here. <varname>restore_command</varname> should return immediately
if the file does not exist; the server will retry the command again if
- necessary. See <xref linkend="log-shipping-alternative">
+ necessary. See <xref linkend="log-shipping-alternative"/>
for using tools like pg_standby.
</para>
</note>
<para>
If you're using a WAL archive, its size can be minimized using the <xref
- linkend="archive-cleanup-command"> parameter to remove files that are no
+ linkend="archive-cleanup-command"/> parameter to remove files that are no
longer required by the standby server.
The <application>pg_archivecleanup</application> utility is designed specifically to
be used with <varname>archive_cleanup_command</varname> in typical single-standby
- configurations, see <xref linkend="pgarchivecleanup">.
+ configurations, see <xref linkend="pgarchivecleanup"/>.
Note however, that if you're using the archive for backup purposes, you
need to retain files needed to recover from at least the latest base
backup, even if they're no longer needed by the standby.
<para>
Streaming replication is asynchronous by default
- (see <xref linkend="synchronous-replication">), in which case there is
+ (see <xref linkend="synchronous-replication"/>), in which case there is
a small delay between committing a transaction in the primary and the
changes becoming visible in the standby. This delay is however much
smaller than with file-based log shipping, typically under one second
<para>
To use streaming replication, set up a file-based log-shipping standby
- server as described in <xref linkend="warm-standby">. The step that
+ server as described in <xref linkend="warm-standby"/>. The step that
turns a file-based log-shipping standby into streaming replication
standby is setting <varname>primary_conninfo</varname> setting in the
<filename>recovery.conf</filename> file to point to the primary server. Set
- <xref linkend="guc-listen-addresses"> and authentication options
+ <xref linkend="guc-listen-addresses"/> and authentication options
(see <filename>pg_hba.conf</filename>) on the primary so that the standby server
can connect to the <literal>replication</literal> pseudo-database on the primary
- server (see <xref linkend="streaming-replication-authentication">).
+ server (see <xref linkend="streaming-replication-authentication"/>).
</para>
<para>
On systems that support the keepalive socket option, setting
- <xref linkend="guc-tcp-keepalives-idle">,
- <xref linkend="guc-tcp-keepalives-interval"> and
- <xref linkend="guc-tcp-keepalives-count"> helps the primary promptly
+ <xref linkend="guc-tcp-keepalives-idle"/>,
+ <xref linkend="guc-tcp-keepalives-interval"/> and
+ <xref linkend="guc-tcp-keepalives-count"/> helps the primary promptly
notice a broken connection.
</para>
<para>
Set the maximum number of concurrent connections from the standby servers
- (see <xref linkend="guc-max-wal-senders"> for details).
+ (see <xref linkend="guc-max-wal-senders"/> for details).
</para>
<para>
standby. These locations can be retrieved using
<function>pg_current_wal_lsn</function> on the primary and
<function>pg_last_wal_receive_lsn</function> on the standby,
- respectively (see <xref linkend="functions-admin-backup-table"> and
- <xref linkend="functions-recovery-info-table"> for details).
+ respectively (see <xref linkend="functions-admin-backup-table"/> and
+ <xref linkend="functions-recovery-info-table"/> for details).
The last WAL receive location in the standby is also displayed in the
process status of the WAL receiver process, displayed using the
- <command>ps</command> command (see <xref linkend="monitoring-ps"> for details).
+ <command>ps</command> command (see <xref linkend="monitoring-ps"/> for details).
</para>
<para>
You can retrieve a list of WAL sender processes via the
- <xref linkend="pg-stat-replication-view"> view. Large differences between
+ <xref linkend="pg-stat-replication-view"/> view. Large differences between
<function>pg_current_wal_lsn</function> and the view's <literal>sent_lsn</literal> field
might indicate that the master server is under heavy load, while
differences between <literal>sent_lsn</literal> and
</para>
<para>
On a hot standby, the status of the WAL receiver process can be retrieved
- via the <xref linkend="pg-stat-wal-receiver-view"> view. A large
+ via the <xref linkend="pg-stat-wal-receiver-view"/> view. A large
difference between <function>pg_last_wal_replay_lsn</function> and the
view's <literal>received_lsn</literal> indicates that WAL is being
received faster than it can be replayed.
</para>
<para>
In lieu of using replication slots, it is possible to prevent the removal
- of old WAL segments using <xref linkend="guc-wal-keep-segments">, or by
+ of old WAL segments using <xref linkend="guc-wal-keep-segments"/>, or by
storing the segments in an archive using
- <xref linkend="guc-archive-command">.
+ <xref linkend="guc-archive-command"/>.
However, these methods often result in retaining more WAL segments than
required, whereas replication slots retain only the number of segments
known to be needed. An advantage of these methods is that they bound
to do this using replication slots.
</para>
<para>
- Similarly, <xref linkend="guc-hot-standby-feedback">
- and <xref linkend="guc-vacuum-defer-cleanup-age"> provide protection against
+ Similarly, <xref linkend="guc-hot-standby-feedback"/>
+ and <xref linkend="guc-vacuum-defer-cleanup-age"/> provide protection against
relevant rows being removed by vacuum, but the former provides no
protection during any time period when the standby is not connected,
and the latter often needs to be set to a high value to provide adequate
</para>
<para>
Slots can be created and dropped either via the streaming replication
- protocol (see <xref linkend="protocol-replication">) or via SQL
- functions (see <xref linkend="functions-replication">).
+ protocol (see <xref linkend="protocol-replication"/>) or via SQL
+ functions (see <xref linkend="functions-replication"/>).
</para>
</sect3>
<sect3 id="streaming-replication-slots-config">
<para>
Cascading replication is currently asynchronous. Synchronous replication
- (see <xref linkend="synchronous-replication">) settings have no effect on
+ (see <xref linkend="synchronous-replication"/>) settings have no effect on
cascading replication at present.
</para>
<para>
To use cascading replication, set up the cascading standby so that it can
accept replication connections (that is, set
- <xref linkend="guc-max-wal-senders"> and <xref linkend="guc-hot-standby">,
+ <xref linkend="guc-max-wal-senders"/> and <xref linkend="guc-hot-standby"/>,
and configure
<link linkend="auth-pg-hba-conf">host-based authentication</link>).
You will also need to set <varname>primary_conninfo</varname> in the downstream
<para>
Once streaming replication has been configured, configuring synchronous
replication requires only one additional configuration step:
- <xref linkend="guc-synchronous-standby-names"> must be set to
+ <xref linkend="guc-synchronous-standby-names"/> must be set to
a non-empty value. <varname>synchronous_commit</varname> must also be set to
<literal>on</literal>, but since this is the default value, typically no change is
- required. (See <xref linkend="runtime-config-wal-settings"> and
- <xref linkend="runtime-config-replication-master">.)
+ required. (See <xref linkend="runtime-config-wal-settings"/> and
+ <xref linkend="runtime-config-replication-master"/>.)
This configuration will cause each commit to wait for
confirmation that the standby has written the commit record to durable
storage.
and might stay down. To return to normal operation, a standby server
must be recreated,
either on the former primary system when it comes up, or on a third,
- possibly new, system. The <xref linkend="app-pgrewind"> utility can be
+ possibly new, system. The <xref linkend="app-pgrewind"/> utility can be
used to speed up this process on large clusters.
Once complete, the primary and standby can be
considered to have switched roles. Some people choose to use a third
This was the only option available in versions 8.4 and below. In this
setup, set <varname>standby_mode</varname> off, because you are implementing
the polling required for standby operation yourself. See the
- <xref linkend="pgstandby"> module for a reference
+ <xref linkend="pgstandby"/> module for a reference
implementation of this.
</para>
<para>
A working example of a waiting <varname>restore_command</varname> is provided
- in the <xref linkend="pgstandby"> module. It
+ in the <xref linkend="pgstandby"/> module. It
should be used as a reference on how to correctly implement the logic
described above. It can also be extended as needed to support specific
configurations and environments.
<para>
Set up continuous archiving from the primary to a WAL archive
directory on the standby server. Ensure that
- <xref linkend="guc-archive-mode">,
- <xref linkend="guc-archive-command"> and
- <xref linkend="guc-archive-timeout">
+ <xref linkend="guc-archive-mode"/>,
+ <xref linkend="guc-archive-command"/> and
+ <xref linkend="guc-archive-timeout"/>
are set appropriately on the primary
- (see <xref linkend="backup-archiving-wal">).
+ (see <xref linkend="backup-archiving-wal"/>).
</para>
</listitem>
<listitem>
<para>
Make a base backup of the primary server (see <xref
- linkend="backup-base-backup">), and load this data onto the standby.
+ linkend="backup-base-backup"/>), and load this data onto the standby.
</para>
</listitem>
<listitem>
Begin recovery on the standby server from the local WAL
archive, using a <filename>recovery.conf</filename> that specifies a
<varname>restore_command</varname> that waits as described
- previously (see <xref linkend="backup-pitr-recovery">).
+ previously (see <xref linkend="backup-pitr-recovery"/>).
</para>
</listitem>
</orderedlist>
<para>
An external program can call the <function>pg_walfile_name_offset()</function>
- function (see <xref linkend="functions-admin">)
+ function (see <xref linkend="functions-admin"/>)
to find out the file name and the exact byte offset within it of
the current end of WAL. It can then access the WAL file directly
and copy the data from the last known end of WAL through the current end
<para>
Starting with <productname>PostgreSQL</productname> version 9.0, you can use
- streaming replication (see <xref linkend="streaming-replication">) to
+ streaming replication (see <xref linkend="streaming-replication"/>) to
achieve the same benefits with less effort.
</para>
</sect2>
<title>User's Overview</title>
<para>
- When the <xref linkend="guc-hot-standby"> parameter is set to true on a
+ When the <xref linkend="guc-hot-standby"/> parameter is set to true on a
standby server, it will begin accepting connections once the recovery has
brought the system to a consistent state. All such connections are
strictly read-only; not even temporary tables may be written.
made by that transaction will be visible to any new snapshots taken on
the standby. Snapshots may be taken at the start of each query or at the
start of each transaction, depending on the current transaction isolation
- level. For more details, see <xref linkend="transaction-iso">.
+ level. For more details, see <xref linkend="transaction-iso"/>.
</para>
<para>
<para>
Users will be able to tell whether their session is read-only by
issuing <command>SHOW transaction_read_only</command>. In addition, a set of
- functions (<xref linkend="functions-recovery-info-table">) allow users to
+ functions (<xref linkend="functions-recovery-info-table"/>) allow users to
access information about the standby server. These allow you to write
programs that are aware of the current state of the database. These
can be used to monitor the progress of recovery, or to allow you to
When a conflicting query is short, it's typically desirable to allow it to
complete by delaying WAL application for a little bit; but a long delay in
WAL application is usually not desirable. So the cancel mechanism has
- parameters, <xref linkend="guc-max-standby-archive-delay"> and <xref
- linkend="guc-max-standby-streaming-delay">, that define the maximum
+ parameters, <xref linkend="guc-max-standby-archive-delay"/> and <xref
+ linkend="guc-max-standby-streaming-delay"/>, that define the maximum
allowed delay in WAL application. Conflicting queries will be canceled
once it has taken longer than the relevant delay setting to apply any
newly-received WAL data. There are two parameters so that different delay
</para>
<para>
- Another option is to increase <xref linkend="guc-vacuum-defer-cleanup-age">
+ Another option is to increase <xref linkend="guc-vacuum-defer-cleanup-age"/>
on the primary server, so that dead rows will not be cleaned up as quickly
as they normally would be. This will allow more time for queries to
execute before they are canceled on the standby, without having to set
<para>
It is important that the administrator select appropriate settings for
- <xref linkend="guc-max-standby-archive-delay"> and <xref
- linkend="guc-max-standby-streaming-delay">. The best choices vary
+ <xref linkend="guc-max-standby-archive-delay"/> and <xref
+ linkend="guc-max-standby-streaming-delay"/>. The best choices vary
depending on business priorities. For example if the server is primarily
tasked as a High Availability server, then you will want low delay
settings, perhaps even zero, though that is a very aggressive setting. If
<para>
Various parameters have been mentioned above in
- <xref linkend="hot-standby-conflict"> and
- <xref linkend="hot-standby-admin">.
+ <xref linkend="hot-standby-conflict"/> and
+ <xref linkend="hot-standby-admin"/>.
</para>
<para>
- On the primary, parameters <xref linkend="guc-wal-level"> and
- <xref linkend="guc-vacuum-defer-cleanup-age"> can be used.
- <xref linkend="guc-max-standby-archive-delay"> and
- <xref linkend="guc-max-standby-streaming-delay"> have no effect if set on
+ On the primary, parameters <xref linkend="guc-wal-level"/> and
+ <xref linkend="guc-vacuum-defer-cleanup-age"/> can be used.
+ <xref linkend="guc-max-standby-archive-delay"/> and
+ <xref linkend="guc-max-standby-streaming-delay"/> have no effect if set on
the primary.
</para>
<para>
- On the standby, parameters <xref linkend="guc-hot-standby">,
- <xref linkend="guc-max-standby-archive-delay"> and
- <xref linkend="guc-max-standby-streaming-delay"> can be used.
- <xref linkend="guc-vacuum-defer-cleanup-age"> has no effect
+ On the standby, parameters <xref linkend="guc-hot-standby"/>,
+ <xref linkend="guc-max-standby-archive-delay"/> and
+ <xref linkend="guc-max-standby-streaming-delay"/> can be used.
+ <xref linkend="guc-vacuum-defer-cleanup-age"/> has no effect
as long as the server remains in standby mode, though it will
become relevant if the standby becomes primary.
</para>
<listitem>
<para>
The Serializable transaction isolation level is not yet available in hot
- standby. (See <xref linkend="xact-serializable"> and
- <xref linkend="serializable-consistency"> for details.)
+ standby. (See <xref linkend="xact-serializable"/> and
+ <xref linkend="serializable-consistency"/> for details.)
An attempt to set a transaction to the serializable isolation level in
hot standby mode will generate an error.
</para>
Office (<acronym>ARO</acronym>), the National Science Foundation
(<acronym>NSF</acronym>), and ESL, Inc. The implementation of
<productname>POSTGRES</productname> began in 1986. The initial
- concepts for the system were presented in <xref linkend="ston86">,
+ concepts for the system were presented in <xref linkend="ston86"/>,
and the definition of the initial data model appeared in <xref
- linkend="rowe87">. The design of the rule system at that time was
- described in <xref linkend="ston87a">. The rationale and
+ linkend="rowe87"/>. The design of the rule system at that time was
+ described in <xref linkend="ston87a"/>. The rationale and
architecture of the storage manager were detailed in <xref
- linkend="ston87b">.
+ linkend="ston87b"/>.
</para>
<para>
releases since then. The first <quote>demoware</quote> system
became operational in 1987 and was shown at the 1988
<acronym>ACM-SIGMOD</acronym> Conference. Version 1, described in
- <xref linkend="ston90a">, was released to a few external users in
+ <xref linkend="ston90a"/>, was released to a few external users in
June 1989. In response to a critique of the first rule system
- (<xref linkend="ston89">), the rule system was redesigned (<xref
- linkend="ston90b">), and Version 2 was released in June 1990 with
+ (<xref linkend="ston89"/>), the rule system was redesigned (<xref
+ linkend="ston90b"/>), and Version 2 was released in June 1990 with
the new rule system. Version 3 appeared in 1991 and added support
for multiple storage managers, an improved query executor, and a
rewritten rule system. For the most part, subsequent releases
<para>
Details about what has happened in <productname>PostgreSQL</productname> since
- then can be found in <xref linkend="release">.
+ then can be found in <xref linkend="release"/>.
</para>
</sect2>
</sect1>
constant, then any single-quote characters and (depending on the setting of
the <varname>standard_conforming_strings</varname> configuration parameter)
backslash characters need to be escaped correctly. See
- <xref linkend="sql-syntax-strings"> for more on the handling of string
+ <xref linkend="sql-syntax-strings"/> for more on the handling of string
constants.
</para>
</note>
<para>
The operators provided by the <literal>hstore</literal> module are
- shown in <xref linkend="hstore-op-table">, the functions
- in <xref linkend="hstore-func-table">.
+ shown in <xref linkend="hstore-op-table"/>, the functions
+ in <xref linkend="hstore-func-table"/>.
</para>
<table id="hstore-op-table">
extensions for PL/Python are
called <literal>hstore_plpythonu</literal>, <literal>hstore_plpython2u</literal>,
and <literal>hstore_plpython3u</literal>
- (see <xref linkend="plpython-python23"> for the PL/Python naming
+ (see <xref linkend="plpython-python23"/> for the PL/Python naming
convention). If you use them, <type>hstore</type> values are mapped to
Python dictionaries.
</para>
pages so that they can use the regular storage manager and buffer manager
to access the index contents. (All the existing index access methods
furthermore use the standard page layout described in <xref
- linkend="storage-page-layout">, and most use the same format for index
+ linkend="storage-page-layout"/>, and most use the same format for index
tuple headers; but these decisions are not forced on an access method.)
</para>
<firstterm>tuple identifiers</firstterm>, or <acronym>TIDs</acronym>, of row versions
(tuples) in the index's parent table. A TID consists of a
block number and an item number within that block (see <xref
- linkend="storage-page-layout">). This is sufficient
+ linkend="storage-page-layout"/>). This is sufficient
information to fetch a particular row version from the table.
Indexes are not directly aware that under MVCC, there might be multiple
extant versions of the same logical row; to an index, each tuple is
system catalog. The <structname>pg_am</structname> entry
specifies a name and a <firstterm>handler function</firstterm> for the access
method. These entries can be created and deleted using the
- <xref linkend="sql-create-access-method"> and
- <xref linkend="sql-drop-access-method"> SQL commands.
+ <xref linkend="sql-create-access-method"/> and
+ <xref linkend="sql-drop-access-method"/> SQL commands.
</para>
<para>
functions for the access method, which do all of the real work to access
indexes. These support functions are plain C functions and are not
visible or callable at the SQL level. The support functions are described
- in <xref linkend="index-functions">.
+ in <xref linkend="index-functions"/>.
</para>
<para>
These entries allow the planner
to determine what kinds of query qualifications can be used with
indexes of this access method. Operator families and classes are described
- in <xref linkend="xindex">, which is prerequisite material for reading
+ in <xref linkend="xindex"/>, which is prerequisite material for reading
this chapter.
</para>
<para>
Some of the flag fields of <structname>IndexAmRoutine</structname> have nonobvious
implications. The requirements of <structfield>amcanunique</structfield>
- are discussed in <xref linkend="index-unique-checks">.
+ are discussed in <xref linkend="index-unique-checks"/>.
The <structfield>amcanmulticol</structfield> flag asserts that the
access method supports multicolumn indexes, while
<structfield>amoptionalkey</structfield> asserts that it allows scans
<structfield>amcanunique</structfield> flag is true) then
<literal>checkUnique</literal> indicates the type of uniqueness check to
perform. This varies depending on whether the unique constraint is
- deferrable; see <xref linkend="index-unique-checks"> for details.
+ deferrable; see <xref linkend="index-unique-checks"/> for details.
Normally the access method only needs the <literal>heapRelation</literal>
parameter when performing uniqueness checking (since then it will have to
look into the heap to verify tuple liveness).
double *indexCorrelation);
</programlisting>
Estimate the costs of an index scan. This function is described fully
- in <xref linkend="index-cost-estimation">, below.
+ in <xref linkend="index-cost-estimation"/>, below.
</para>
<para>
The purpose of an index, of course, is to support scans for tuples matching
an indexable <literal>WHERE</literal> condition, often called a
<firstterm>qualifier</firstterm> or <firstterm>scan key</firstterm>. The semantics of
- index scanning are described more fully in <xref linkend="index-scanning">,
+ index scanning are described more fully in <xref linkend="index-scanning"/>,
below. An index access method can support <quote>plain</quote> index scans,
<quote>bitmap</quote> index scans, or both. The scan-related functions that an
index access method must or may provide are:
<function>amgetbitmap</function> and
<function>amgettuple</function> cannot be used in the same index scan; there
are other restrictions too when using <function>amgetbitmap</function>, as explained
- in <xref linkend="index-scanning">.
+ in <xref linkend="index-scanning"/>.
</para>
<para>
index tuples.
Finally, <function>amgetbitmap</function>
does not guarantee any locking of the returned tuples, with implications
- spelled out in <xref linkend="index-locking">.
+ spelled out in <xref linkend="index-locking"/>.
</para>
<para>
A new heap entry is made before making its index entries. (Therefore
a concurrent index scan is likely to fail to see the heap entry.
This is okay because the index reader would be uninterested in an
- uncommitted row anyway. But see <xref linkend="index-unique-checks">.)
+ uncommitted row anyway. But see <xref linkend="index-unique-checks"/>.)
</para>
</listitem>
<listitem>
than a sequential table scan. But you might have to run the
<command>ANALYZE</command> command regularly to update
statistics to allow the query planner to make educated decisions.
- See <xref linkend="performance-tips"> for information about
+ See <xref linkend="performance-tips"/> for information about
how to find out whether an index is used and when and why the
planner might choose <emphasis>not</emphasis> to use an index.
</para>
It is possible to allow writes to occur in parallel with index
creation, but there are several caveats to be aware of —
for more information see <xref linkend="sql-createindex-concurrently"
- endterm="sql-createindex-concurrently-title">.
+ endterm="sql-createindex-concurrently-title"/>.
</para>
<para>
<literal>col LIKE '%bar'</literal>. However, if your database does not
use the C locale you will need to create the index with a special
operator class to support indexing of pattern-matching queries; see
- <xref linkend="indexes-opclass"> below. It is also possible to use
+ <xref linkend="indexes-opclass"/> below. It is also possible to use
B-tree indexes for <literal>ILIKE</literal> and
<literal>~*</literal>, but only if the pattern starts with
non-alphabetic characters, i.e., characters that are not affected by
<member><literal>&&</literal></member>
</simplelist>
- (See <xref linkend="functions-geometry"> for the meaning of
+ (See <xref linkend="functions-geometry"/> for the meaning of
these operators.)
The GiST operator classes included in the standard distribution are
- documented in <xref linkend="gist-builtin-opclasses-table">.
+ documented in <xref linkend="gist-builtin-opclasses-table"/>.
Many other GiST operator
classes are available in the <literal>contrib</literal> collection or as separate
- projects. For more information see <xref linkend="gist">.
+ projects. For more information see <xref linkend="gist"/>.
</para>
<para>
</programlisting>
which finds the ten places closest to a given target point. The ability
to do this is again dependent on the particular operator class being used.
- In <xref linkend="gist-builtin-opclasses-table">, operators that can be
+ In <xref linkend="gist-builtin-opclasses-table"/>, operators that can be
used in this way are listed in the column <quote>Ordering Operators</quote>.
</para>
<member><literal>>^</literal></member>
</simplelist>
- (See <xref linkend="functions-geometry"> for the meaning of
+ (See <xref linkend="functions-geometry"/> for the meaning of
these operators.)
The SP-GiST operator classes included in the standard distribution are
- documented in <xref linkend="spgist-builtin-opclasses-table">.
- For more information see <xref linkend="spgist">.
+ documented in <xref linkend="spgist-builtin-opclasses-table"/>.
+ For more information see <xref linkend="spgist"/>.
</para>
<para>
<member><literal>&&</literal></member>
</simplelist>
- (See <xref linkend="functions-array"> for the meaning of
+ (See <xref linkend="functions-array"/> for the meaning of
these operators.)
The GIN operator classes included in the standard distribution are
- documented in <xref linkend="gin-builtin-opclasses-table">.
+ documented in <xref linkend="gin-builtin-opclasses-table"/>.
Many other GIN operator
classes are available in the <literal>contrib</literal> collection or as separate
- projects. For more information see <xref linkend="gin">.
+ projects. For more information see <xref linkend="gin"/>.
</para>
<para>
</simplelist>
The BRIN operator classes included in the standard distribution are
- documented in <xref linkend="brin-builtin-opclasses-table">.
- For more information see <xref linkend="brin">.
+ documented in <xref linkend="brin-builtin-opclasses-table"/>.
+ For more information see <xref linkend="brin"/>.
</para>
</sect1>
an index on a single column is sufficient and saves space and time.
Indexes with more than three columns are unlikely to be helpful
unless the usage of the table is extremely stylized. See also
- <xref linkend="indexes-bitmap-scans"> and
- <xref linkend="indexes-index-only-scans"> for some discussion of the
+ <xref linkend="indexes-bitmap-scans"/> and
+ <xref linkend="indexes-index-only-scans"/> for some discussion of the
merits of different index configurations.
</para>
</sect1>
process the queries that use both columns. You could also create a
multicolumn index on <literal>(x, y)</literal>. This index would typically be
more efficient than index combination for queries involving both
- columns, but as discussed in <xref linkend="indexes-multicolumn">, it
+ columns, but as discussed in <xref linkend="indexes-multicolumn"/>, it
would be almost useless for queries involving only <literal>y</literal>, so it
should not be the only index. A combination of the multicolumn index
and a separate index on <literal>y</literal> would serve reasonably well. For
index at all. This reduces the size of the index, which will speed
up those queries that do use the index. It will also speed up many table
update operations because the index does not need to be
- updated in all cases. <xref linkend="indexes-partial-ex1"> shows a
+ updated in all cases. <xref linkend="indexes-partial-ex1"/> shows a
possible application of this idea.
</para>
Another possible use for a partial index is to exclude values from the
index that the
typical query workload is not interested in; this is shown in <xref
- linkend="indexes-partial-ex2">. This results in the same
+ linkend="indexes-partial-ex2"/>. This results in the same
advantages as listed above, but it prevents the
<quote>uninteresting</quote> values from being accessed via that
index, even if an index scan might be profitable in that
</example>
<para>
- <xref linkend="indexes-partial-ex2"> also illustrates that the
+ <xref linkend="indexes-partial-ex2"/> also illustrates that the
indexed column and the column used in the predicate do not need to
match. <productname>PostgreSQL</productname> supports partial
indexes with arbitrary predicates, so long as only columns of the
A third possible use for partial indexes does not require the
index to be used in queries at all. The idea here is to create
a unique index over a subset of a table, as in <xref
- linkend="indexes-partial-ex3">. This enforces uniqueness
+ linkend="indexes-partial-ex3"/>. This enforces uniqueness
among the rows that satisfy the index predicate, without constraining
those that do not.
</para>
<para>
More information about partial indexes can be found in <xref
- linkend="ston89b">, <xref linkend="olson93">, and <xref
- linkend="seshadri95">.
+ linkend="ston89b"/>, <xref linkend="olson93"/>, and <xref
+ linkend="seshadri95"/>.
</para>
</sect1>
the index, the table rows they reference might be anywhere in the heap.
The heap-access portion of an index scan thus involves a lot of random
access into the heap, which can be slow, particularly on traditional
- rotating media. (As described in <xref linkend="indexes-bitmap-scans">,
+ rotating media. (As described in <xref linkend="indexes-bitmap-scans"/>,
bitmap scans try to alleviate this cost by doing the heap accesses in
sorted order, but that only goes so far.)
</para>
is physically possible. But there is an additional requirement for any
table scan in <productname>PostgreSQL</productname>: it must verify that each
retrieved row be <quote>visible</quote> to the query's MVCC snapshot, as
- discussed in <xref linkend="mvcc">. Visibility information is not stored
+ discussed in <xref linkend="mvcc"/>. Visibility information is not stored
in index entries, only in heap entries; so at first glance it would seem
that every row retrieval would require a heap access anyway. And this is
indeed the case, if the table row has been modified recently. However,
<para>
Partial indexes also have interesting interactions with index-only scans.
- Consider the partial index shown in <xref linkend="indexes-partial-ex3">:
+ Consider the partial index shown in <xref linkend="indexes-partial-ex3"/>:
<programlisting>
CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target)
WHERE success;
maintenance or tuning, it is still important to check
which indexes are actually used by the real-life query workload.
Examining index usage for an individual query is done with the
- <xref linkend="sql-explain">
+ <xref linkend="sql-explain"/>
command; its application for this purpose is
- illustrated in <xref linkend="using-explain">.
+ illustrated in <xref linkend="using-explain"/>.
It is also possible to gather overall statistics about index usage
- in a running server, as described in <xref linkend="monitoring-stats">.
+ in a running server, as described in <xref linkend="monitoring-stats"/>.
</para>
<para>
<itemizedlist>
<listitem>
<para>
- Always run <xref linkend="sql-analyze">
+ Always run <xref linkend="sql-analyze"/>
first. This command
collects statistics about the distribution of the values in the
table. This information is required to estimate the number of rows
almost certain to be inaccurate. Examining an application's
index usage without having run <command>ANALYZE</command> is
therefore a lost cause.
- See <xref linkend="vacuum-for-statistics">
- and <xref linkend="autovacuum"> for more information.
+ See <xref linkend="vacuum-for-statistics"/>
+ and <xref linkend="autovacuum"/> for more information.
</para>
</listitem>
<para>
When indexes are not used, it can be useful for testing to force
their use. There are run-time parameters that can turn off
- various plan types (see <xref linkend="runtime-config-query-enable">).
+ various plan types (see <xref linkend="runtime-config-query-enable"/>).
For instance, turning off sequential scans
(<varname>enable_seqscan</varname>) and nested-loop joins
(<varname>enable_nestloop</varname>), which are the most basic plans,
per-row costs of each plan node times the selectivity estimate of
the plan node. The costs estimated for the plan nodes can be adjusted
via run-time parameters (described in <xref
- linkend="runtime-config-query-constants">).
+ linkend="runtime-config-query-constants"/>).
An inaccurate selectivity estimate is due to
insufficient statistics. It might be possible to improve this by
tuning the statistics-gathering parameters (see
- <xref linkend="sql-altertable">).
+ <xref linkend="sql-altertable"/>).
</para>
<para>
</table>
<para>
- See also under <xref linkend="infoschema-columns">, a similarly
+ See also under <xref linkend="infoschema-columns"/>, a similarly
structured view, for further information on some of the columns.
</para>
</sect1>
<entry><literal>sql_identifier</literal></entry>
<entry>
The <quote>specific name</quote> of the function. See <xref
- linkend="infoschema-routines"> for more information.
+ linkend="infoschema-routines"/> for more information.
</entry>
</row>
</tbody>
identifies which character set the available collations are
applicable to. In PostgreSQL, there is only one character set per
database (see explanation
- in <xref linkend="infoschema-character-sets">), so this view does
+ in <xref linkend="infoschema-character-sets"/>), so this view does
not provide much useful information.
</para>
that use data types owned by a currently enabled role. Note that in
<productname>PostgreSQL</productname>, built-in data types behave
like user-defined types, so they are included here as well. See
- also <xref linkend="infoschema-columns"> for details.
+ also <xref linkend="infoschema-columns"/> for details.
</para>
<table>
<entry><type>sql_identifier</type></entry>
<entry>
The <quote>specific name</quote> of the function. See <xref
- linkend="infoschema-routines"> for more information.
+ linkend="infoschema-routines"/> for more information.
</entry>
</row>
<entry><type>sql_identifier</type></entry>
<entry>
The <quote>specific name</quote> of the function. See <xref
- linkend="infoschema-routines"> for more information.
+ linkend="infoschema-routines"/> for more information.
</entry>
</row>
<entry><type>sql_identifier</type></entry>
<entry>
The <quote>specific name</quote> of the function. See <xref
- linkend="infoschema-routines"> for more information.
+ linkend="infoschema-routines"/> for more information.
</entry>
</row>
The table <literal>sql_features</literal> contains information
about which formal features defined in the SQL standard are
supported by <productname>PostgreSQL</productname>. This is the
- same information that is presented in <xref linkend="features">.
+ same information that is presented in <xref linkend="features"/>.
There you can also find some additional background information.
</para>
The table <literal>sql_packages</literal> contains information
about which feature packages defined in the SQL standard are
supported by <productname>PostgreSQL</productname>. Refer to <xref
- linkend="features"> for background information on feature packages.
+ linkend="features"/> for background information on feature packages.
</para>
<table>
<entry><literal>sql_identifier</literal></entry>
<entry>
The <quote>specific name</quote> of the function. See <xref
- linkend="infoschema-routines"> for more information.
+ linkend="infoschema-routines"/> for more information.
</entry>
</row>
<literal>USAGE</literal> privileges granted on user-defined types to a
currently enabled role or by a currently enabled role. There is one row for
each combination of type, grantor, and grantee. This view shows only
- composite types (see under <xref linkend="infoschema-user-defined-types">
+ composite types (see under <xref linkend="infoschema-user-defined-types"/>
for why); see
- <xref linkend="infoschema-usage-privileges"> for domain privileges.
+ <xref linkend="infoschema-usage-privileges"/> for domain privileges.
</para>
<table>
differentiate between these. Other user-defined types such as base
types and enums, which are <productname>PostgreSQL</productname>
extensions, are not shown here. For domains,
- see <xref linkend="infoschema-domains"> instead.
+ see <xref linkend="infoschema-domains"/> instead.
</para>
<table>
<entry><literal>sql_identifier</literal></entry>
<entry>
The <quote>specific name</quote> of the function. See <xref
- linkend="infoschema-routines"> for more information.
+ linkend="infoschema-routines"/> for more information.
</entry>
</row>
</tbody>
<para>
Building using <productname>MinGW</productname> or
<productname>Cygwin</productname> uses the normal build system, see
- <xref linkend="installation"> and the specific notes in
- <xref linkend="installation-notes-mingw"> and <xref linkend="installation-notes-cygwin">.
+ <xref linkend="installation"/> and the specific notes in
+ <xref linkend="installation-notes-mingw"/> and <xref linkend="installation-notes-cygwin"/>.
To produce native 64 bit binaries in these environments, use the tools from
<productname>MinGW-w64</productname>. These tools can also be used to
cross-compile for 32 bit and 64 bit <productname>Windows</productname>
</screen>
For more information about the regression tests, see
- <xref linkend="regress">.
+ <xref linkend="regress"/>.
</para>
<para>
In general, a modern Unix-compatible platform should be able to run
<productname>PostgreSQL</productname>.
The platforms that had received specific testing at the
- time of release are listed in <xref linkend="supported-platforms">
+ time of release are listed in <xref linkend="supported-platforms"/>
below. In the <filename>doc</filename> subdirectory of the distribution
there are several platform-specific <acronym>FAQ</acronym> documents you
might wish to consult if you are having trouble.
required version is <productname>Python</productname> 2.4.
<productname>Python 3</productname> is supported if it's
version 3.1 or later; but see
- <xref linkend="plpython-python23">
+ <xref linkend="plpython-python23"/>
when using Python 3.
</para>
<para>
To build the <productname>PostgreSQL</productname> documentation,
there is a separate set of requirements; see
- <xref linkend="docguide-toolsets">.
+ <xref linkend="docguide-toolsets"/>.
</para>
</listitem>
</itemizedlist>
<para>
You can also get the source directly from the version control repository, see
- <xref linkend="sourcerepo">.
+ <xref linkend="sourcerepo"/>.
</para>
</sect1>
<para>
Build with <acronym>LDAP</acronym><indexterm><primary>LDAP</primary></indexterm>
support for authentication and connection parameter lookup (see
- <phrase id="install-ldap-links"><xref linkend="libpq-ldap"> and
- <xref linkend="auth-ldap"></phrase> for more information). On Unix,
+ <phrase id="install-ldap-links"><xref linkend="libpq-ldap"/> and
+ <xref linkend="auth-ldap"/></phrase> for more information). On Unix,
this requires the <productname>OpenLDAP</productname> package to be
installed. On Windows, the default <productname>WinLDAP</productname>
library is used. <filename>configure</filename> will check for the required
for <application>systemd</application><indexterm><primary>systemd</primary></indexterm>
service notifications. This improves integration if the server binary
is started under <application>systemd</application> but has no impact
- otherwise<phrase condition="standalone-ignore">; see <xref linkend="server-start"> for more
+ otherwise<phrase condition="standalone-ignore">; see <xref linkend="server-start"/> for more
information</phrase>. <application>libsystemd</application> and the
associated header files need to be installed to be able to use this
option.
<term><option>--with-uuid=<replaceable>LIBRARY</replaceable></option></term>
<listitem>
<para>
- Build the <xref linkend="uuid-ossp"> module
+ Build the <xref linkend="uuid-ossp"/> module
(which provides functions to generate UUIDs), using the specified
UUID library.<indexterm><primary>UUID</primary></indexterm>
<replaceable>LIBRARY</replaceable> must be one of:
<listitem>
<para>
Use libxslt when building the
- <xref linkend="xml2">
+ <xref linkend="xml2"/>
module. <application>xml2</application> relies on this library
to perform XSL transformations of XML.
</para>
has no support for strong random numbers on the platform.
A source of random numbers is needed for some authentication
protocols, as well as some routines in the
- <xref linkend="pgcrypto">
+ <xref linkend="pgcrypto"/>
module. <option>--disable-strong-random</option> disables functionality that
requires cryptographically strong random numbers, and substitutes
a weak pseudo-random-number-generator for the generation of
code coverage testing instrumentation. When run, they
generate files in the build directory with code coverage
metrics.
- <phrase condition="standalone-ignore">See <xref linkend="regress-coverage">
+ <phrase condition="standalone-ignore">See <xref linkend="regress-coverage"/>
for more information.</phrase> This option is for use only with GCC
and when doing development work.
</para>
</indexterm>
Compiles <productname>PostgreSQL</productname> with support for the
dynamic tracing tool DTrace.
- <phrase condition="standalone-ignore">See <xref linkend="dynamic-trace">
+ <phrase condition="standalone-ignore">See <xref linkend="dynamic-trace"/>
for more information.</phrase>
</para>
<para>
Enable tests using the Perl TAP tools. This requires a Perl
installation and the Perl module <literal>IPC::Run</literal>.
- <phrase condition="standalone-ignore">See <xref linkend="regress-tap"> for more information.</phrase>
+ <phrase condition="standalone-ignore">See <xref linkend="regress-tap"/> for more information.</phrase>
</para>
</listitem>
</varlistentry>
whether Python 2 or 3 is specified here (or otherwise
implicitly chosen) determines which variant of the PL/Python
language becomes available. See
- <xref linkend="plpython-python23">
+ <xref linkend="plpython-python23"/>
for more information.
</para>
</listitem>
<userinput>make check</userinput>
</screen>
(This won't work as root; do it as an unprivileged user.)
- See <xref linkend="regress"> for
+ See <xref linkend="regress"/> for
detailed information about interpreting the test results. You can
repeat this test at any later time by issuing the same command.
</para>
<note>
<para>
If you are upgrading an existing system be sure to read
- <xref linkend="upgrading">,
+ <xref linkend="upgrading"/>,
which has instructions about upgrading a
cluster.
</para>
<userinput>make install</userinput>
</screen>
This will install files into the directories that were specified
- in <xref linkend="configure">. Make sure that you have appropriate
+ in <xref linkend="configure"/>. Make sure that you have appropriate
permissions to write into that area. Normally you need to do this
step as root. Alternatively, you can create the target
directories in advance and arrange for appropriate permissions to
setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
</programlisting>
Replace <literal>/usr/local/pgsql/lib</literal> with whatever you set
- <option><literal>--libdir</literal></option> to in <xref linkend="configure">.
+ <option><literal>--libdir</literal></option> to in <xref linkend="configure"/>.
You should put these commands into a shell start-up file such as
<filename>/etc/profile</filename> or <filename>~/.bash_profile</filename>. Some
good information about the caveats associated with this method can
If you installed into <filename>/usr/local/pgsql</filename> or some other
location that is not searched for programs by default, you should
add <filename>/usr/local/pgsql/bin</filename> (or whatever you set
- <option><literal>--bindir</literal></option> to in <xref linkend="configure">)
+ <option><literal>--bindir</literal></option> to in <xref linkend="configure"/>)
into your <envar>PATH</envar>. Strictly speaking, this is not
necessary, but it will make the use of <productname>PostgreSQL</productname>
much more convenient.
Other Unix-like systems may also work but are not currently
being tested. In most cases, all CPU architectures supported by
a given operating system will work. Look in
- <xref linkend="installation-platform-notes"> below to see if
+ <xref linkend="installation-platform-notes"/> below to see if
there is information
specific to your operating system, particularly if using an older system.
</para>
This section documents additional platform-specific issues
regarding the installation and setup of PostgreSQL. Be sure to
read the installation instructions, and in
- particular <xref linkend="install-requirements"> as well. Also,
- check <xref linkend="regress"> regarding the
+ particular <xref linkend="install-requirements"/> as well. Also,
+ check <xref linkend="regress"/> regarding the
interpretation of regression test results.
</para>
<para>
PostgreSQL can be built using Cygwin, a Linux-like environment for
Windows, but that method is inferior to the native Windows build
- <phrase condition="standalone-ignore">(see <xref linkend="install-windows">)</phrase> and
+ <phrase condition="standalone-ignore">(see <xref linkend="install-windows"/>)</phrase> and
running a server under Cygwin is no longer recommended.
</para>
Microsoft's <productname>Visual C++</productname> compiler suite.
The MinGW build variant uses the normal build system described in
this chapter; the Visual C++ build works completely differently
- and is described in <xref linkend="install-windows">.
+ and is described in <xref linkend="install-windows"/>.
It is a fully native build and uses no additional software like
MinGW. A ready-made installer is available on the main
PostgreSQL web site.
<title>Using DTrace for Tracing PostgreSQL</title>
<para>
- Yes, using DTrace is possible. See <xref linkend="dynamic-trace"> for
+ Yes, using DTrace is possible. See <xref linkend="dynamic-trace"/> for
further information.
</para>
<para>
The functions provided by the <filename>intarray</filename> module
- are shown in <xref linkend="intarray-func-table">, the operators
- in <xref linkend="intarray-op-table">.
+ are shown in <xref linkend="intarray-func-table"/>, the operators
+ in <xref linkend="intarray-op-table"/>.
</para>
<table id="intarray-func-table">
<itemizedlist>
<listitem>
<para>
- <xref linkend="tutorial"> is an informal introduction for new users.
+ <xref linkend="tutorial"/> is an informal introduction for new users.
</para>
</listitem>
<listitem>
<para>
- <xref linkend="sql"> documents the <acronym>SQL</acronym> query
+ <xref linkend="sql"/> documents the <acronym>SQL</acronym> query
language environment, including data types and functions, as well
as user-level performance tuning. Every
<productname>PostgreSQL</productname> user should read this.
<listitem>
<para>
- <xref linkend="admin"> describes the installation and
+ <xref linkend="admin"/> describes the installation and
administration of the server. Everyone who runs a
<productname>PostgreSQL</productname> server, be it for private
use or for others, should read this part.
<listitem>
<para>
- <xref linkend="client-interfaces"> describes the programming
+ <xref linkend="client-interfaces"/> describes the programming
interfaces for <productname>PostgreSQL</productname> client
programs.
</para>
<listitem>
<para>
- <xref linkend="server-programming"> contains information for
+ <xref linkend="server-programming"/> contains information for
advanced users about the extensibility capabilities of the
server. Topics include user-defined data types and
functions.
<listitem>
<para>
- <xref linkend="reference"> contains reference information about
+ <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.
<listitem>
<para>
- <xref linkend="internals"> contains assorted information that might be of
+ <xref linkend="internals"/> contains assorted information that might be of
use to <productname>PostgreSQL</productname> developers.
</para>
</listitem>
<title>Data Types</title>
<para>
- <xref linkend="isn-datatypes"> shows the data types provided by
+ <xref linkend="isn-datatypes"/> shows the data types provided by
the <filename>isn</filename> module.
</para>
<para>
The <filename>isn</filename> module provides the standard comparison operators,
plus B-tree and hash indexing support for all these data types. In
- addition there are several specialized functions; shown in <xref linkend="isn-functions">.
+ addition there are several specialized functions; shown in <xref linkend="isn-functions"/>.
In this table,
<type>isn</type> means any one of the module's data types.
</para>
the JSON data types have the advantage of enforcing that each
stored value is valid according to the JSON rules. There are also
assorted JSON-specific functions and operators available for data stored
- in these data types; see <xref linkend="functions-json">.
+ in these data types; see <xref linkend="functions-json"/>.
</para>
<para>
<note>
<para>
Many of the JSON processing functions described
- in <xref linkend="functions-json"> will convert Unicode escapes to
+ in <xref linkend="functions-json"/> will convert Unicode escapes to
regular characters, and will therefore throw the same types of errors
just described even if their input is of type <type>json</type>
not <type>jsonb</type>. The fact that the <type>json</type> input function does
When converting textual JSON input into <type>jsonb</type>, the primitive
types described by <acronym>RFC</acronym> 7159 are effectively mapped onto
native <productname>PostgreSQL</productname> types, as shown
- in <xref linkend="json-type-mapping-table">.
+ in <xref linkend="json-type-mapping-table"/>.
Therefore, there are some minor additional constraints on what
constitutes valid <type>jsonb</type> data that do not apply to
the <type>json</type> type, nor to JSON in the abstract, corresponding
<para>
The various containment and existence operators, along with all other
JSON operators and functions are documented
- in <xref linkend="functions-json">.
+ in <xref linkend="functions-json"/>.
</para>
</sect2>
and <literal>?|</literal> operators and path/value-exists operator
<literal>@></literal>.
(For details of the semantics that these operators
- implement, see <xref linkend="functions-jsonb-op-table">.)
+ implement, see <xref linkend="functions-jsonb-op-table"/>.)
An example of creating an index with this operator class is:
<programlisting>
CREATE INDEX idxgin ON api USING GIN (jdoc);
operator <literal>?</literal> to the indexed
expression <literal>jdoc -> 'tags'</literal>.
(More information on expression indexes can be found in <xref
- linkend="indexes-expressional">.)
+ linkend="indexes-expressional"/>.)
</para>
<para>
Another approach to querying is to exploit containment, for example:
</indexterm>
<para>
- <xref linkend="keywords-table"> lists all tokens that are key words
+ <xref linkend="keywords-table"/> lists all tokens that are key words
in the SQL standard and in <productname>PostgreSQL</productname>
&version;. Background information can be found in <xref
- linkend="sql-syntax-identifiers">.
+ linkend="sql-syntax-identifiers"/>.
(For space reasons, only the latest two versions of the SQL standard, and
SQL-92 for historical comparison, are included. The differences between
those and the other intermediate standard versions are small.)
</para>
<para>
- In <xref linkend="keywords-table"> in the column for
+ In <xref linkend="keywords-table"/> in the column for
<productname>PostgreSQL</productname> we classify as
<quote>non-reserved</quote> those key words that are explicitly
known to the parser but are allowed as column or table names.
<para>
It is important to understand before studying <xref
- linkend="keywords-table"> that the fact that a key word is not
+ linkend="keywords-table"/> that the fact that a key word is not
reserved in <productname>PostgreSQL</productname> does not mean that
the feature related to the word is not implemented. Conversely, the
presence of a key word does not indicate the existence of a feature.
those written for C++, Perl, Python, Tcl and <application>ECPG</application>.
So some aspects of <application>libpq</application>'s behavior will be
important to you if you use one of those packages. In particular,
- <xref linkend="libpq-envars">,
- <xref linkend="libpq-pgpass"> and
- <xref linkend="libpq-ssl">
+ <xref linkend="libpq-envars"/>,
+ <xref linkend="libpq-pgpass"/> and
+ <xref linkend="libpq-ssl"/>
describe behavior that is visible to the user of any application
that uses <application>libpq</application>.
</para>
<para>
- Some short programs are included at the end of this chapter (<xref linkend="libpq-example">) to show how
+ Some short programs are included at the end of this chapter (<xref linkend="libpq-example"/>) to show how
to write programs that use <application>libpq</application>. There are also several
complete examples of <application>libpq</application> applications in the
directory <filename>src/test/examples</filename> in the source code distribution.
<para>
The currently recognized parameter key words are listed in
- <xref linkend="libpq-paramkeywords">.
+ <xref linkend="libpq-paramkeywords"/>.
</para>
<para>
<parameter>dbname</parameter> is expanded this way, any subsequent
<parameter>dbname</parameter> value is processed as plain database name. More
details on the possible connection string formats appear in
- <xref linkend="libpq-connstring">.
+ <xref linkend="libpq-connstring"/>.
</para>
<para>
<para>
If any parameter is <symbol>NULL</symbol> or an empty string, the corresponding
- environment variable (see <xref linkend="libpq-envars">) is checked.
+ environment variable (see <xref linkend="libpq-envars"/>) is checked.
If the environment variable is not set either, then the indicated
built-in defaults are used.
</para>
The passed string can be empty to use all default parameters, or it can
contain one or more parameter settings separated by whitespace,
or it can contain a <acronym>URI</acronym>.
- See <xref linkend="libpq-connstring"> for details.
+ See <xref linkend="libpq-connstring"/> for details.
</para>
<para>
The <literal>hostaddr</literal> and <literal>host</literal> parameters are used appropriately to ensure that
name and reverse name queries are not made. See the documentation of
- these parameters in <xref linkend="libpq-paramkeywords"> for details.
+ these parameters in <xref linkend="libpq-paramkeywords"/> for details.
</para>
</listitem>
<para>
The recognized parameter key words are listed in <xref
- linkend="libpq-paramkeywords">.
+ linkend="libpq-paramkeywords"/>.
</para>
</sect3>
<para>
Any connection parameters not corresponding to key words listed in <xref
- linkend="libpq-paramkeywords"> are ignored and a warning message about them
+ linkend="libpq-paramkeywords"/> are ignored and a warning message about them
is sent to <filename>stderr</filename>.
</para>
<para>
The host component is interpreted as described for the parameter <xref
- linkend="libpq-connect-host">. In particular, a Unix-domain socket
+ linkend="libpq-connect-host"/>. In particular, a Unix-domain socket
connection is chosen if the host part is either empty or starts with a
slash, otherwise a TCP/IP connection is initiated. Note, however, that the
slash is a reserved character in the hierarchical part of the URI. So, to
<para>
A comma-separated list of host names is also accepted, in which case
each host name in the list is tried in order. See
- <xref linkend="libpq-multiple-hosts"> for details.
+ <xref linkend="libpq-multiple-hosts"/> for details.
</para>
</listitem>
</varlistentry>
is not the name of the server at network address <literal>hostaddr</literal>.
Also, note that <literal>host</literal> rather than <literal>hostaddr</literal>
is used to identify the connection in a password file (see
- <xref linkend="libpq-pgpass">).
+ <xref linkend="libpq-pgpass"/>).
</para>
<para>
A comma-separated list of <literal>hostaddrs</literal> is also accepted, in
which case each host in the list is tried in order. See
- <xref linkend="libpq-multiple-hosts"> for details.
+ <xref linkend="libpq-multiple-hosts"/> for details.
</para>
<para>
Without either a host name or host address,
<para>
The database name. Defaults to be the same as the user name.
In certain contexts, the value is checked for extended
- formats; see <xref linkend="libpq-connstring"> for more details on
+ formats; see <xref linkend="libpq-connstring"/> for more details on
those.
</para>
</listitem>
<listitem>
<para>
Specifies the name of the file used to store passwords
- (see <xref linkend="libpq-pgpass">).
+ (see <xref linkend="libpq-pgpass"/>).
Defaults to <filename>~/.pgpass</filename>, or
<filename>%APPDATA%\postgresql\pgpass.conf</filename> on Microsoft Windows.
(No error is reported if this file does not exist.)
separate command-line arguments, unless escaped with a backslash
(<literal>\</literal>); write <literal>\\</literal> to represent a literal
backslash. For a detailed discussion of the available
- options, consult <xref linkend="runtime-config">.
+ options, consult <xref linkend="runtime-config"/>.
</para>
</listitem>
</varlistentry>
<term><literal>application_name</literal></term>
<listitem>
<para>
- Specifies a value for the <xref linkend="guc-application-name">
+ Specifies a value for the <xref linkend="guc-application-name"/>
configuration parameter.
</para>
</listitem>
<listitem>
<para>
Specifies a fallback value for the <xref
- linkend="guc-application-name"> configuration parameter.
+ linkend="guc-application-name"/> configuration parameter.
This value will be used if no value has been given for
<literal>application_name</literal> via a connection parameter or the
<envar>PGAPPNAME</envar> environment variable. Specifying
</varlistentry>
</variablelist>
- See <xref linkend="libpq-ssl"> for a detailed description of how
+ See <xref linkend="libpq-ssl"/> for a detailed description of how
these options work.
</para>
to ensure that you are connected to a server run by a trusted user.)
This option is only supported on platforms for which the
<literal>peer</literal> authentication method is implemented; see
- <xref linkend="auth-peer">.
+ <xref linkend="auth-peer"/>.
</para>
</listitem>
</varlistentry>
Kerberos service name to use when authenticating with GSSAPI.
This must match the service name specified in the server
configuration for Kerberos authentication to succeed. (See also
- <xref linkend="gssapi-auth">.)
+ <xref linkend="gssapi-auth"/>.)
</para>
</listitem>
</varlistentry>
Service name to use for additional parameters. It specifies a service
name in <filename>pg_service.conf</filename> that holds additional connection parameters.
This allows applications to specify only a service name so connection parameters
- can be centrally maintained. See <xref linkend="libpq-pgservice">.
+ can be centrally maintained. See <xref linkend="libpq-pgservice"/>.
</para>
</listitem>
</varlistentry>
<function>PQexec</function> call are processed in a single transaction, unless
there are explicit <command>BEGIN</command>/<command>COMMIT</command>
commands included in the query string to divide it into multiple
- transactions. (See <xref linkend="protocol-flow-multi-statement">
+ transactions. (See <xref linkend="protocol-flow-multi-statement"/>
for more details about how the server handles multi-query strings.)
Note however that the returned
<structname>PGresult</structname> structure describes only the result
<function>PQprepare</function> creates a prepared statement for later
execution with <function>PQexecPrepared</function>. This feature allows
commands to be executed repeatedly without being parsed and
- planned each time; see <xref linkend="sql-prepare"> for details.
+ planned each time; see <xref linkend="sql-prepare"/> for details.
<function>PQprepare</function> is supported only in protocol 3.0 and later
connections; it will fail when using protocol 2.0.
</para>
</variablelist>
Prepared statements for use with <function>PQexecPrepared</function> can also
- be created by executing SQL <xref linkend="sql-prepare">
+ be created by executing SQL <xref linkend="sql-prepare"/>
statements. Also, although there is no <application>libpq</application>
function for deleting a prepared statement, the SQL <xref
- linkend="sql-deallocate"> statement
+ linkend="sql-deallocate"/> statement
can be used for that purpose.
</para>
The <structname>PGresult</structname> contains a single result tuple
from the current command. This status occurs only when
single-row mode has been selected for the query
- (see <xref linkend="libpq-single-row-mode">).
+ (see <xref linkend="libpq-single-row-mode"/>).
</para>
</listitem>
</varlistentry>
never be returned directly by <function>PQexec</function> or other
query execution functions; results of this kind are instead passed
to the notice processor (see <xref
- linkend="libpq-notice-processing">).
+ linkend="libpq-notice-processing"/>).
</para>
</listitem>
</varlistentry>
front-end applications to perform specific operations (such
as error handling) in response to a particular database error.
For a list of the possible SQLSTATE codes, see <xref
- linkend="errcodes-appendix">. This field is not localizable,
+ linkend="errcodes-appendix"/>. This field is not localizable,
and is always present.
</para>
</listitem>
<para>
The fields for schema name, table name, column name, data type name,
and constraint name are supplied only for a limited number of error
- types; see <xref linkend="errcodes-appendix">. Do not assume that
+ types; see <xref linkend="errcodes-appendix"/>. Do not assume that
the presence of any of these fields guarantees the presence of
another field. Core error sources observe the interrelationships
noted above, but user-defined functions may use these fields in other
<type>bytea</type> literal in an <acronym>SQL</acronym> statement.
<function>PQescapeByteaConn</function> escapes bytes using
either hex encoding or backslash escaping. See <xref
- linkend="datatype-binary"> for more information.
+ linkend="datatype-binary"/> for more information.
</para>
<para>
Another frequently-desired feature that can be obtained with
<function>PQsendQuery</function> and <function>PQgetResult</function>
is retrieving large query results a row at a time. This is discussed
- in <xref linkend="libpq-single-row-mode">.
+ in <xref linkend="libpq-single-row-mode"/>.
</para>
<para>
<function>PQgetResult</function> if <function>PQisBusy</function>
returns false (0). It can also call <function>PQnotifies</function>
to detect <command>NOTIFY</command> messages (see <xref
- linkend="libpq-notify">).
+ linkend="libpq-notify"/>).
</para>
<para>
A client that uses
<function>PQsendQuery</function>/<function>PQgetResult</function>
can also attempt to cancel a command that is still being processed
- by the server; see <xref linkend="libpq-cancel">. But regardless of
+ by the server; see <xref linkend="libpq-cancel"/>. But regardless of
the return value of <function>PQcancel</function>, the application
must continue with the normal result-reading sequence using
<function>PQgetResult</function>. A successful cancellation will
(or a sibling function). This mode selection is effective only for the
currently executing query. Then call <function>PQgetResult</function>
repeatedly, until it returns null, as documented in <xref
- linkend="libpq-async">. If the query returns any rows, they are returned
+ linkend="libpq-async"/>. If the query returns any rows, they are returned
as individual <structname>PGresult</structname> objects, which look like
normal query results except for having status code
<literal>PGRES_SINGLE_TUPLE</literal> instead of
</para>
<para>
- <xref linkend="libpq-example-2"> gives a sample program that illustrates
+ <xref linkend="libpq-example-2"/> gives a sample program that illustrates
the use of asynchronous notification.
</para>
0 indicates the overall copy format is textual (rows separated by
newlines, columns separated by separator characters, etc). 1
indicates the overall copy format is binary. See <xref
- linkend="sql-copy"> for more information.
+ linkend="sql-copy"/> for more information.
</para>
</listitem>
</varlistentry>
into buffer loads of any convenient size. Buffer-load boundaries
have no semantic significance when sending. The contents of the
data stream must match the data format expected by the
- <command>COPY</command> command; see <xref linkend="sql-copy"> for details.
+ <command>COPY</command> command; see <xref linkend="sql-copy"/> for details.
</para>
</listitem>
</varlistentry>
version 10, and will not work correctly with older server versions. If
<parameter>algorithm</parameter> is <symbol>NULL</symbol>, this function will query
the server for the current value of the
- <xref linkend="guc-password-encryption"> setting. That can block, and
+ <xref linkend="guc-password-encryption"/> setting. That can block, and
will fail if the current transaction is aborted, or if the connection
is busy executing another query. If you wish to use the default
algorithm for the server but want to avoid blocking, query
<listitem>
<para>
Fires a <literal>PGEVT_RESULTCREATE</literal> event (see <xref
- linkend="libpq-events">) for each event procedure registered in the
+ linkend="libpq-events"/>) for each event procedure registered in the
<structname>PGresult</structname> object. Returns non-zero for success,
zero if any event procedure fails.
<primary><envar>PGHOST</envar></primary>
</indexterm>
<envar>PGHOST</envar> behaves the same as the <xref
- linkend="libpq-connect-host"> connection parameter.
+ linkend="libpq-connect-host"/> connection parameter.
</para>
</listitem>
<primary><envar>PGHOSTADDR</envar></primary>
</indexterm>
<envar>PGHOSTADDR</envar> behaves the same as the <xref
- linkend="libpq-connect-hostaddr"> connection parameter.
+ linkend="libpq-connect-hostaddr"/> connection parameter.
This can be set instead of or in addition to <envar>PGHOST</envar>
to avoid DNS lookup overhead.
</para>
<primary><envar>PGPORT</envar></primary>
</indexterm>
<envar>PGPORT</envar> behaves the same as the <xref
- linkend="libpq-connect-port"> connection parameter.
+ linkend="libpq-connect-port"/> connection parameter.
</para>
</listitem>
<primary><envar>PGDATABASE</envar></primary>
</indexterm>
<envar>PGDATABASE</envar> behaves the same as the <xref
- linkend="libpq-connect-dbname"> connection parameter.
+ linkend="libpq-connect-dbname"/> connection parameter.
</para>
</listitem>
<primary><envar>PGUSER</envar></primary>
</indexterm>
<envar>PGUSER</envar> behaves the same as the <xref
- linkend="libpq-connect-user"> connection parameter.
+ linkend="libpq-connect-user"/> connection parameter.
</para>
</listitem>
<primary><envar>PGPASSWORD</envar></primary>
</indexterm>
<envar>PGPASSWORD</envar> behaves the same as the <xref
- linkend="libpq-connect-password"> connection parameter.
+ linkend="libpq-connect-password"/> connection parameter.
Use of this environment variable
is not recommended for security reasons, as some operating systems
allow non-root users to see process environment variables via
<application>ps</application>; instead consider using a password file
- (see <xref linkend="libpq-pgpass">).
+ (see <xref linkend="libpq-pgpass"/>).
</para>
</listitem>
<primary><envar>PGPASSFILE</envar></primary>
</indexterm>
<envar>PGPASSFILE</envar> behaves the same as the <xref
- linkend="libpq-connect-passfile"> connection parameter.
+ linkend="libpq-connect-passfile"/> connection parameter.
</para>
</listitem>
<primary><envar>PGSERVICE</envar></primary>
</indexterm>
<envar>PGSERVICE</envar> behaves the same as the <xref
- linkend="libpq-connect-service"> connection parameter.
+ linkend="libpq-connect-service"/> connection parameter.
</para>
</listitem>
<envar>PGSERVICEFILE</envar> specifies the name of the per-user
connection service file. If not set, it defaults
to <filename>~/.pg_service.conf</filename>
- (see <xref linkend="libpq-pgservice">).
+ (see <xref linkend="libpq-pgservice"/>).
</para>
</listitem>
<primary><envar>PGOPTIONS</envar></primary>
</indexterm>
<envar>PGOPTIONS</envar> behaves the same as the <xref
- linkend="libpq-connect-options"> connection parameter.
+ linkend="libpq-connect-options"/> connection parameter.
</para>
</listitem>
<primary><envar>PGAPPNAME</envar></primary>
</indexterm>
<envar>PGAPPNAME</envar> behaves the same as the <xref
- linkend="libpq-connect-application-name"> connection parameter.
+ linkend="libpq-connect-application-name"/> connection parameter.
</para>
</listitem>
<primary><envar>PGSSLMODE</envar></primary>
</indexterm>
<envar>PGSSLMODE</envar> behaves the same as the <xref
- linkend="libpq-connect-sslmode"> connection parameter.
+ linkend="libpq-connect-sslmode"/> connection parameter.
</para>
</listitem>
<primary><envar>PGREQUIRESSL</envar></primary>
</indexterm>
<envar>PGREQUIRESSL</envar> behaves the same as the <xref
- linkend="libpq-connect-requiressl"> connection parameter.
+ linkend="libpq-connect-requiressl"/> connection parameter.
This environment variable is deprecated in favor of the
<envar>PGSSLMODE</envar> variable; setting both variables suppresses the
effect of this one.
<primary><envar>PGSSLCOMPRESSION</envar></primary>
</indexterm>
<envar>PGSSLCOMPRESSION</envar> behaves the same as the <xref
- linkend="libpq-connect-sslcompression"> connection parameter.
+ linkend="libpq-connect-sslcompression"/> connection parameter.
</para>
</listitem>
<primary><envar>PGSSLCERT</envar></primary>
</indexterm>
<envar>PGSSLCERT</envar> behaves the same as the <xref
- linkend="libpq-connect-sslcert"> connection parameter.
+ linkend="libpq-connect-sslcert"/> connection parameter.
</para>
</listitem>
<primary><envar>PGSSLKEY</envar></primary>
</indexterm>
<envar>PGSSLKEY</envar> behaves the same as the <xref
- linkend="libpq-connect-sslkey"> connection parameter.
+ linkend="libpq-connect-sslkey"/> connection parameter.
</para>
</listitem>
<primary><envar>PGSSLROOTCERT</envar></primary>
</indexterm>
<envar>PGSSLROOTCERT</envar> behaves the same as the <xref
- linkend="libpq-connect-sslrootcert"> connection parameter.
+ linkend="libpq-connect-sslrootcert"/> connection parameter.
</para>
</listitem>
<primary><envar>PGSSLCRL</envar></primary>
</indexterm>
<envar>PGSSLCRL</envar> behaves the same as the <xref
- linkend="libpq-connect-sslcrl"> connection parameter.
+ linkend="libpq-connect-sslcrl"/> connection parameter.
</para>
</listitem>
<primary><envar>PGREQUIREPEER</envar></primary>
</indexterm>
<envar>PGREQUIREPEER</envar> behaves the same as the <xref
- linkend="libpq-connect-requirepeer"> connection parameter.
+ linkend="libpq-connect-requirepeer"/> connection parameter.
</para>
</listitem>
<primary><envar>PGKRBSRVNAME</envar></primary>
</indexterm>
<envar>PGKRBSRVNAME</envar> behaves the same as the <xref
- linkend="libpq-connect-krbsrvname"> connection parameter.
+ linkend="libpq-connect-krbsrvname"/> connection parameter.
</para>
</listitem>
<primary><envar>PGGSSLIB</envar></primary>
</indexterm>
<envar>PGGSSLIB</envar> behaves the same as the <xref
- linkend="libpq-connect-gsslib"> connection parameter.
+ linkend="libpq-connect-gsslib"/> connection parameter.
</para>
</listitem>
<primary><envar>PGCONNECT_TIMEOUT</envar></primary>
</indexterm>
<envar>PGCONNECT_TIMEOUT</envar> behaves the same as the <xref
- linkend="libpq-connect-connect-timeout"> connection parameter.
+ linkend="libpq-connect-connect-timeout"/> connection parameter.
</para>
</listitem>
<primary><envar>PGCLIENTENCODING</envar></primary>
</indexterm>
<envar>PGCLIENTENCODING</envar> behaves the same as the <xref
- linkend="libpq-connect-client-encoding"> connection parameter.
+ linkend="libpq-connect-client-encoding"/> connection parameter.
</para>
</listitem>
<primary><envar>PGTARGETSESSIONATTRS</envar></primary>
</indexterm>
<envar>PGTARGETSESSIONATTRS</envar> behaves the same as the <xref
- linkend="libpq-connect-target-session-attrs"> connection parameter.
+ linkend="libpq-connect-target-session-attrs"/> connection parameter.
</para>
</listitem>
</itemizedlist>
<para>
The following environment variables can be used to specify default
behavior for each <productname>PostgreSQL</productname> session. (See
- also the <xref linkend="sql-alterrole">
- and <xref linkend="sql-alterdatabase">
+ also the <xref linkend="sql-alterrole"/>
+ and <xref linkend="sql-alterdatabase"/>
commands for ways to set default behavior on a per-user or per-database
basis.)
</listitem>
</itemizedlist>
- Refer to the <acronym>SQL</acronym> command <xref linkend="sql-set">
+ Refer to the <acronym>SQL</acronym> command <xref linkend="sql-set"/>
for information on correct values for these
environment variables.
</para>
<filename>%APPDATA%</filename> refers to the Application Data subdirectory in
the user's profile).
Alternatively, a password file can be specified
- using the connection parameter <xref linkend="libpq-connect-passfile">
+ using the connection parameter <xref linkend="libpq-connect-passfile"/>
or the environment variable <envar>PGPASSFILE</envar>.
</para>
<para>
The file uses an <quote>INI file</quote> format where the section
name is the service name and the parameters are connection
- parameters; see <xref linkend="libpq-paramkeywords"> for a list. For
+ parameters; see <xref linkend="libpq-paramkeywords"/> for a list. For
example:
<programlisting>
# comment
<para>
LDAP connection parameter lookup uses the connection service file
<filename>pg_service.conf</filename> (see <xref
- linkend="libpq-pgservice">). A line in a
+ linkend="libpq-pgservice"/>). A line in a
<filename>pg_service.conf</filename> stanza that starts with
<literal>ldap://</literal> will be recognized as an LDAP URL and an
LDAP query will be performed. The result must be a list of
<para>
<productname>PostgreSQL</productname> has native support for using <acronym>SSL</acronym>
connections to encrypt client/server communications for increased
- security. See <xref linkend="ssl-tcp"> for details about the server-side
+ security. See <xref linkend="ssl-tcp"/> for details about the server-side
<acronym>SSL</acronym> functionality.
</para>
file, then its parent authority's certificate, and so on up to a certificate
authority, <quote>root</quote> or <quote>intermediate</quote>, that is trusted by
the server, i.e. signed by a certificate in the server's root CA file
- (<xref linkend="guc-ssl-ca-file">).
+ (<xref linkend="guc-ssl-ca-file"/>).
</para>
<para>
<para>
All <acronym>SSL</acronym> options carry overhead in the form of encryption and
key-exchange, so there is a trade-off that has to be made between performance
- and security. <xref linkend="libpq-ssl-sslmode-statements">
+ and security. <xref linkend="libpq-ssl-sslmode-statements"/>
illustrates the risks the different <literal>sslmode</literal> values
protect against, and what statement they make about security and overhead.
</para>
<title>SSL Client File Usage</title>
<para>
- <xref linkend="libpq-ssl-file-usage"> summarizes the files that are
+ <xref linkend="libpq-ssl-file-usage"/> summarizes the files that are
relevant to the SSL setup on the client.
</para>
<structname>PGresult</structname> objects are normally read-only after creation,
and so can be passed around freely between threads. However, if you use
any of the <structname>PGresult</structname>-modifying functions described in
- <xref linkend="libpq-misc"> or <xref linkend="libpq-events">, it's up
+ <xref linkend="libpq-misc"/> or <xref linkend="libpq-events"/>, it's up
to you to avoid concurrent operations on the same <structname>PGresult</structname>,
too.
</para>
<para>
If you already have, or suspect you have, orphaned large objects, see the
- <xref linkend="vacuumlo"> module to help
+ <xref linkend="vacuumlo"/> module to help
you clean them up. It's a good idea to run <application>vacuumlo</application>
occasionally as a back-stop to the <function>lo_manage</function> trigger.
</para>
<para>
As of <productname>PostgreSQL</productname> 9.0, large objects have an owner
and a set of access permissions, which can be managed using
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">.
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>.
<literal>SELECT</literal> privileges are required to read a large
object, and
<literal>UPDATE</literal> privileges are required to write or
Only the large object's owner (or a database superuser) can delete,
comment on, or change the owner of a large object.
To adjust this behavior for compatibility with prior releases, see the
- <xref linkend="guc-lo-compat-privileges"> run-time parameter.
+ <xref linkend="guc-lo-compat-privileges"/> run-time parameter.
</para>
</sect1>
checks were instead performed at the first actual read or write call
using the descriptor.)
These privilege checks can be disabled with the
- <xref linkend="guc-lo-compat-privileges"> run-time parameter.
+ <xref linkend="guc-lo-compat-privileges"/> run-time parameter.
</para>
<para>
<para>
Server-side functions tailored for manipulating large objects from SQL are
- listed in <xref linkend="lo-funcs-table">.
+ listed in <xref linkend="lo-funcs-table"/>.
</para>
<table id="lo-funcs-table">
<caution>
<para>
- It is possible to <xref linkend="sql-grant"> use of the
+ It is possible to <xref linkend="sql-grant"/> use of the
server-side <function>lo_import</function>
and <function>lo_export</function> functions to non-superusers, but
careful consideration of the security implications is required. A
<title>Example Program</title>
<para>
- <xref linkend="lo-example"> is a sample program which shows how the large object
+ <xref linkend="lo-example"/> is a sample program which shows how the large object
interface
in <application>libpq</application> can be used. Parts of the program are
commented out but are left in the source for the reader's
changes, based upon their replication identity (usually a primary key). We
use the term logical in contrast to physical replication, which uses exact
block addresses and byte-by-byte replication. PostgreSQL supports both
- mechanisms concurrently, see <xref linkend="high-availability">. Logical
+ mechanisms concurrently, see <xref linkend="high-availability"/>. Logical
replication allows fine-grained control over both data replication and
security.
</para>
fallback if no other solution is possible. If a replica identity other
than <quote>full</quote> is set on the publisher side, a replica identity
comprising the same or fewer columns must also be set on the subscriber
- side. See <xref linkend="sql-createtable-replica-identity"> for details on
+ side. See <xref linkend="sql-createtable-replica-identity"/> for details on
how to set the replica identity. If a table without a replica identity is
added to a publication that replicates <command>UPDATE</command>
or <command>DELETE</command> operations then
</para>
<para>
- A publication is created using the <xref linkend="sql-createpublication">
+ A publication is created using the <xref linkend="sql-createpublication"/>
command and may later be altered or dropped using corresponding commands.
</para>
<para>
The individual tables can be added and removed dynamically using
- <xref linkend="sql-alterpublication">. Both the <literal>ADD
+ <xref linkend="sql-alterpublication"/>. Both the <literal>ADD
TABLE</literal> and <literal>DROP TABLE</literal> operations are
transactional; so the table will start or stop replicating at the correct
snapshot once the transaction has committed.
<para>
Each subscription will receive changes via one replication slot (see
- <xref linkend="streaming-replication-slots">). Additional temporary
+ <xref linkend="streaming-replication-slots"/>). Additional temporary
replication slots may be required for the initial data synchronization
of pre-existing table data.
</para>
<para>
A logical replication subscription can be a standby for synchronous
- replication (see <xref linkend="synchronous-replication">). The standby
+ replication (see <xref linkend="synchronous-replication"/>). The standby
name is by default the subscription name. An alternative name can be
specified as <literal>application_name</literal> in the connection
information of the subscription.
</para>
<para>
- The subscription is added using <xref linkend="sql-createsubscription"> and
+ The subscription is added using <xref linkend="sql-createsubscription"/> and
can be stopped/resumed at any time using the
- <xref linkend="sql-altersubscription"> command and removed using
- <xref linkend="sql-dropsubscription">.
+ <xref linkend="sql-altersubscription"/> command and removed using
+ <xref linkend="sql-dropsubscription"/>.
</para>
<para>
<listitem>
<para>
- Large objects (see <xref linkend="largeobjects">) are not replicated.
+ Large objects (see <xref linkend="largeobjects"/>) are not replicated.
There is no workaround for that, other than storing data in normal
tables.
</para>
<para>
Logical replication is built with an architecture similar to physical
- streaming replication (see <xref linkend="streaming-replication">). It is
+ streaming replication (see <xref linkend="streaming-replication"/>). It is
implemented by <quote>walsender</quote> and <quote>apply</quote>
processes. The walsender process starts logical decoding (described
- in <xref linkend="logicaldecoding">) of the WAL and loads the standard
+ in <xref linkend="logicaldecoding"/>) of the WAL and loads the standard
logical decoding plugin (pgoutput). The plugin transforms the changes read
from WAL to the logical replication protocol
- (see <xref linkend="protocol-logical-replication">) and filters the data
+ (see <xref linkend="protocol-logical-replication"/>) and filters the data
according to the publication specification. The data is then continuously
transferred using the streaming replication protocol to the apply worker,
which maps the data to local tables and applies the individual changes as
<link linkend="streaming-replication">physical streaming replication</link>,
the monitoring on a publication node is similar to monitoring of a
physical replication master
- (see <xref linkend="streaming-replication-monitoring">).
+ (see <xref linkend="streaming-replication-monitoring"/>).
</para>
<para>
by <command>INSERT</command> and the new row version created
by <command>UPDATE</command>. Availability of old row versions for
<command>UPDATE</command> and <command>DELETE</command> depends on
- the configured replica identity (see <xref linkend="sql-createtable-replica-identity">).
+ the configured replica identity (see <xref linkend="sql-createtable-replica-identity"/>).
</para>
<para>
Changes can be consumed either using the streaming replication protocol
- (see <xref linkend="protocol-replication"> and
- <xref linkend="logicaldecoding-walsender">), or by calling functions
- via SQL (see <xref linkend="logicaldecoding-sql">). It is also possible
+ (see <xref linkend="protocol-replication"/> and
+ <xref linkend="logicaldecoding-walsender"/>), or by calling functions
+ via SQL (see <xref linkend="logicaldecoding-sql"/>). It is also possible
to write additional methods of consuming the output of a replication slot
without modifying core code
- (see <xref linkend="logicaldecoding-writer">).
+ (see <xref linkend="logicaldecoding-writer"/>).
</para>
<sect1 id="logicaldecoding-example">
<para>
Before you can use logical decoding, you must set
- <xref linkend="guc-wal-level"> to <literal>logical</literal> and
- <xref linkend="guc-max-replication-slots"> to at least 1. Then, you
+ <xref linkend="guc-wal-level"/> to <literal>logical</literal> and
+ <xref linkend="guc-max-replication-slots"/> to at least 1. Then, you
should connect to the target database (in the example
below, <literal>postgres</literal>) as a superuser.
</para>
<para>
The following example shows how logical decoding is controlled over the
streaming replication protocol, using the
- program <xref linkend="app-pgrecvlogical"> included in the PostgreSQL
+ program <xref linkend="app-pgrecvlogical"/> included in the PostgreSQL
distribution. This requires that client authentication is set up to allow
replication connections
- (see <xref linkend="streaming-replication-authentication">) and
+ (see <xref linkend="streaming-replication-authentication"/>) and
that <varname>max_wal_senders</varname> is set sufficiently high to allow
an additional connection.
</para>
<note>
<para><productname>PostgreSQL</productname> also has streaming replication slots
- (see <xref linkend="streaming-replication">), but they are used somewhat
+ (see <xref linkend="streaming-replication"/>), but they are used somewhat
differently there.
</para>
</note>
<title>Exported Snapshots</title>
<para>
When a new replication slot is created using the streaming replication
- interface (see <xref linkend="protocol-replication-create-slot">), a
+ interface (see <xref linkend="protocol-replication-create-slot"/>), a
snapshot is exported
- (see <xref linkend="functions-snapshot-synchronization">), which will show
+ (see <xref linkend="functions-snapshot-synchronization"/>), which will show
exactly the state of the database after which all changes will be
included in the change stream. This can be used to create a new replica by
using <link linkend="sql-set-transaction"><literal>SET TRANSACTION
are used to create, drop, and stream changes from a replication
slot, respectively. These commands are only available over a replication
connection; they cannot be used via SQL.
- See <xref linkend="protocol-replication"> for details on these commands.
+ See <xref linkend="protocol-replication"/> for details on these commands.
</para>
<para>
- The command <xref linkend="app-pgrecvlogical"> can be used to control
+ The command <xref linkend="app-pgrecvlogical"/> can be used to control
logical decoding over a streaming replication connection. (It uses
these commands internally.)
</para>
<title>Logical Decoding <acronym>SQL</acronym> Interface</title>
<para>
- See <xref linkend="functions-replication"> for detailed documentation on
+ See <xref linkend="functions-replication"/> for detailed documentation on
the SQL-level API for interacting with logical decoding.
</para>
<para>
- Synchronous replication (see <xref linkend="synchronous-replication">) is
+ Synchronous replication (see <xref linkend="synchronous-replication"/>) is
only supported on replication slots used over the streaming replication interface. The
function interface and additional, non-core interfaces do not support
synchronous replication.
<literal>output_type</literal> has to either be set to
<literal>OUTPUT_PLUGIN_TEXTUAL_OUTPUT</literal>
or <literal>OUTPUT_PLUGIN_BINARY_OUTPUT</literal>. See also
- <xref linkend="logicaldecoding-output-mode">.
+ <xref linkend="logicaldecoding-output-mode"/>.
</para>
<para>
<note>
<para>
Only changes in user defined tables that are not unlogged
- (see <xref linkend="sql-createtable-unlogged">) and not temporary
- (see <xref linkend="sql-createtable-temporary">) can be extracted using
+ (see <xref linkend="sql-createtable-unlogged"/>) and not temporary
+ (see <xref linkend="sql-createtable-temporary"/>) can be extracted using
logical decoding.
</para>
</note>
<filename>src/backend/replication/logical/logicalfuncs.c</filename>.
Essentially, three functions need to be provided: one to read WAL, one to
prepare writing output, and one to write the output
- (see <xref linkend="logicaldecoding-output-plugin-output">).
+ (see <xref linkend="logicaldecoding-output-plugin-output"/>).
</para>
</sect1>
replication</link> solutions with the same user interface as synchronous
replication for <link linkend="streaming-replication">streaming
replication</link>. To do this, the streaming replication interface
- (see <xref linkend="logicaldecoding-walsender">) must be used to stream out
+ (see <xref linkend="logicaldecoding-walsender"/>) must be used to stream out
data. Clients have to send <literal>Standby status update (F)</literal>
- (see <xref linkend="protocol-replication">) messages, just like streaming
+ (see <xref linkend="protocol-replication"/>) messages, just like streaming
replication clients do.
</para>
<literal><</literal>, <literal>></literal>, <literal><=</literal>, <literal>>=</literal>.
Comparison sorts in the order of a tree traversal, with the children
of a node sorted by label text. In addition, the specialized
- operators shown in <xref linkend="ltree-op-table"> are available.
+ operators shown in <xref linkend="ltree-op-table"/> are available.
</para>
<table id="ltree-op-table">
</para>
<para>
- The available functions are shown in <xref linkend="ltree-func-table">.
+ The available functions are shown in <xref linkend="ltree-func-table"/>.
</para>
<table id="ltree-func-table">
the <type>ltree</type> type for PL/Python. The extensions are
called <literal>ltree_plpythonu</literal>, <literal>ltree_plpython2u</literal>,
and <literal>ltree_plpython3u</literal>
- (see <xref linkend="plpython-python23"> for the PL/Python naming
+ (see <xref linkend="plpython-python23"/> for the PL/Python naming
convention). If you install these transforms and specify them when
creating a function, <type>ltree</type> values are mapped to Python lists.
(The reverse is currently not supported, however.)
after a catastrophe (disk failure, fire, mistakenly dropping a critical
table, etc.). The backup and recovery mechanisms available in
<productname>PostgreSQL</productname> are discussed at length in
- <xref linkend="backup">.
+ <xref linkend="backup"/>.
</para>
<para>
The other main category of maintenance task is periodic <quote>vacuuming</quote>
of the database. This activity is discussed in
- <xref linkend="routine-vacuuming">. Closely related to this is updating
+ <xref linkend="routine-vacuuming"/>. Closely related to this is updating
the statistics that will be used by the query planner, as discussed in
- <xref linkend="vacuum-for-statistics">.
+ <xref linkend="vacuum-for-statistics"/>.
</para>
<para>
Another task that might need periodic attention is log file management.
- This is discussed in <xref linkend="logfile-maintenance">.
+ This is discussed in <xref linkend="logfile-maintenance"/>.
</para>
<para>
<productname>PostgreSQL</productname> databases require periodic
maintenance known as <firstterm>vacuuming</firstterm>. For many installations, it
is sufficient to let vacuuming be performed by the <firstterm>autovacuum
- daemon</firstterm>, which is described in <xref linkend="autovacuum">. You might
+ daemon</firstterm>, which is described in <xref linkend="autovacuum"/>. You might
need to adjust the autovacuuming parameters described there to obtain best
results for your situation. Some database administrators will want to
supplement or replace the daemon's activities with manually-managed
<para>
<productname>PostgreSQL</productname>'s
- <xref linkend="sql-vacuum"> command has to
+ <xref linkend="sql-vacuum"/> command has to
process each table on a regular basis for several reasons:
<orderedlist>
traffic, which can cause poor performance for other active sessions.
There are configuration parameters that can be adjusted to reduce the
performance impact of background vacuuming — see
- <xref linkend="runtime-config-resource-vacuum-cost">.
+ <xref linkend="runtime-config-resource-vacuum-cost"/>.
</para>
</sect2>
<command>UPDATE</command> or <command>DELETE</command> of a row does not
immediately remove the old version of the row.
This approach is necessary to gain the benefits of multiversion
- concurrency control (<acronym>MVCC</acronym>, see <xref linkend="mvcc">): the row version
+ concurrency control (<acronym>MVCC</acronym>, see <xref linkend="mvcc"/>): the row version
must not be deleted while it is still potentially visible to other
transactions. But eventually, an outdated or deleted row version is no
longer of interest to any transaction. The space it occupies must then be
their busiest tables as often as once every few minutes.) If you have
multiple databases in a cluster, don't forget to
<command>VACUUM</command> each one; the program <xref
- linkend="app-vacuumdb"> might be helpful.
+ linkend="app-vacuumdb"/> might be helpful.
</para>
<tip>
massive update or delete activity. If you have such a table and
you need to reclaim the excess disk space it occupies, you will need
to use <command>VACUUM FULL</command>, or alternatively
- <xref linkend="sql-cluster">
+ <xref linkend="sql-cluster"/>
or one of the table-rewriting variants of
- <xref linkend="sql-altertable">.
+ <xref linkend="sql-altertable"/>.
These commands rewrite an entire new copy of the table and build
new indexes for it. All these options require exclusive lock. Note that
they also temporarily use extra disk space approximately equal to the size
<para>
If you have a table whose entire contents are deleted on a periodic
basis, consider doing it with
- <xref linkend="sql-truncate"> rather
+ <xref linkend="sql-truncate"/> rather
than using <command>DELETE</command> followed by
<command>VACUUM</command>. <command>TRUNCATE</command> removes the
entire content of the table immediately, without requiring a
The <productname>PostgreSQL</productname> query planner relies on
statistical information about the contents of tables in order to
generate good plans for queries. These statistics are gathered by
- the <xref linkend="sql-analyze"> command,
+ the <xref linkend="sql-analyze"/> command,
which can be invoked by itself or
as an optional step in <command>VACUUM</command>. It is important to have
reasonably accurate statistics, otherwise poor choices of plans might
clauses and have highly irregular data distributions might require a
finer-grain data histogram than other columns. See <command>ALTER TABLE
SET STATISTICS</command>, or change the database-wide default using the <xref
- linkend="guc-default-statistics-target"> configuration parameter.
+ linkend="guc-default-statistics-target"/> configuration parameter.
</para>
<para>
</note>
<para>
- <xref linkend="guc-vacuum-freeze-min-age">
+ <xref linkend="guc-vacuum-freeze-min-age"/>
controls how old an XID value has to be before rows bearing that XID will be
frozen. Increasing this setting may avoid unnecessary work if the
rows that would otherwise be frozen will soon be modified again,
Periodically, <command>VACUUM</command> will perform an <firstterm>aggressive
vacuum</firstterm>, skipping only those pages which contain neither dead rows nor
any unfrozen XID or MXID values.
- <xref linkend="guc-vacuum-freeze-table-age">
+ <xref linkend="guc-vacuum-freeze-table-age"/>
controls when <command>VACUUM</command> does that: all-visible but not all-frozen
pages are scanned if the number of transactions that have passed since the
last such scan is greater than <varname>vacuum_freeze_table_age</varname> minus
that, data loss could result. To ensure that this does not happen,
autovacuum is invoked on any table that might contain unfrozen rows with
XIDs older than the age specified by the configuration parameter <xref
- linkend="guc-autovacuum-freeze-max-age">. (This will happen even if
+ linkend="guc-autovacuum-freeze-max-age"/>. (This will happen even if
autovacuum is disabled.)
</para>
execute commands once it has gone into the safety shutdown mode,
the only way to do this is to stop the server and start the server in single-user
mode to execute <command>VACUUM</command>. The shutdown mode is not enforced
- in single-user mode. See the <xref linkend="app-postgres"> reference
+ in single-user mode. See the <xref linkend="app-postgres"/> reference
page for details about using single-user mode.
</para>
<para>
Whenever <command>VACUUM</command> scans any part of a table, it will replace
any multixact ID it encounters which is older than
- <xref linkend="guc-vacuum-multixact-freeze-min-age">
+ <xref linkend="guc-vacuum-multixact-freeze-min-age"/>
by a different value, which can be the zero value, a single
transaction ID, or a newer multixact ID. For each table,
<structname>pg_class</structname>.<structfield>relminmxid</structfield> stores the oldest
possible multixact ID still appearing in any tuple of that table.
If this value is older than
- <xref linkend="guc-vacuum-multixact-freeze-table-age">, an aggressive
+ <xref linkend="guc-vacuum-multixact-freeze-table-age"/>, an aggressive
vacuum is forced. As discussed in the previous section, an aggressive
vacuum means that only those pages which are known to be all-frozen will
be skipped. <function>mxid_age()</function> can be used on
<para>
As a safety device, an aggressive vacuum scan will occur for any table
whose multixact-age is greater than
- <xref linkend="guc-autovacuum-multixact-freeze-max-age">. Aggressive
+ <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>. Aggressive
vacuum scans will also occur progressively for all tables, starting with
those that have the oldest multixact-age, if the amount of used member
storage space exceeds the amount 50% of the addressable storage space.
tables that have had a large number of inserted, updated or deleted
tuples. These checks use the statistics collection facility;
therefore, autovacuum cannot be used unless <xref
- linkend="guc-track-counts"> is set to <literal>true</literal>.
+ linkend="guc-track-counts"/> is set to <literal>true</literal>.
In the default configuration, autovacuuming is enabled and the related
configuration parameters are appropriately set.
</para>
<firstterm>autovacuum launcher</firstterm>, which is in charge of starting
<firstterm>autovacuum worker</firstterm> processes for all databases. The
launcher will distribute the work across time, attempting to start one
- worker within each database every <xref linkend="guc-autovacuum-naptime">
+ worker within each database every <xref linkend="guc-autovacuum-naptime"/>
seconds. (Therefore, if the installation has <replaceable>N</replaceable> databases,
a new worker will be launched every
<varname>autovacuum_naptime</varname>/<replaceable>N</replaceable> seconds.)
- A maximum of <xref linkend="guc-autovacuum-max-workers"> worker processes
+ A maximum of <xref linkend="guc-autovacuum-max-workers"/> worker processes
are allowed to run at the same time. If there are more than
<varname>autovacuum_max_workers</varname> databases to be processed,
the next database will be processed as soon as the first worker finishes.
Each worker process will check each table within its database and
execute <command>VACUUM</command> and/or <command>ANALYZE</command> as needed.
- <xref linkend="guc-log-autovacuum-min-duration"> can be set to monitor
+ <xref linkend="guc-log-autovacuum-min-duration"/> can be set to monitor
autovacuum workers' activity.
</para>
available. There is no limit on how many workers might be in a
single database, but workers do try to avoid repeating work that has
already been done by other workers. Note that the number of running
- workers does not count towards <xref linkend="guc-max-connections"> or
- <xref linkend="guc-superuser-reserved-connections"> limits.
+ workers does not count towards <xref linkend="guc-max-connections"/> or
+ <xref linkend="guc-superuser-reserved-connections"/> limits.
</para>
<para>
Tables whose <structfield>relfrozenxid</structfield> value is more than
- <xref linkend="guc-autovacuum-freeze-max-age"> transactions old are always
+ <xref linkend="guc-autovacuum-freeze-max-age"/> transactions old are always
vacuumed (this also applies to those tables whose freeze max age has
been modified via storage parameters; see below). Otherwise, if the
number of tuples obsoleted since the last
vacuum threshold = vacuum base threshold + vacuum scale factor * number of tuples
</programlisting>
where the vacuum base threshold is
- <xref linkend="guc-autovacuum-vacuum-threshold">,
+ <xref linkend="guc-autovacuum-vacuum-threshold"/>,
the vacuum scale factor is
- <xref linkend="guc-autovacuum-vacuum-scale-factor">,
+ <xref linkend="guc-autovacuum-vacuum-scale-factor"/>,
and the number of tuples is
<structname>pg_class</structname>.<structfield>reltuples</structfield>.
The number of obsolete tuples is obtained from the statistics
<filename>postgresql.conf</filename>, but it is possible to override them
(and many other autovacuum control parameters) on a per-table basis; see
<xref linkend="sql-createtable-storage-parameters"
- endterm="sql-createtable-storage-parameters-title"> for more information.
+ endterm="sql-createtable-storage-parameters-title"/> for more information.
If a setting has been changed via a table's storage parameters, that value
is used when processing that table; otherwise the global settings are
- used. See <xref linkend="runtime-config-autovacuum"> for more details on
+ used. See <xref linkend="runtime-config-autovacuum"/> for more details on
the global settings.
</para>
<para>
When multiple workers are running, the autovacuum cost delay parameters
- (see <xref linkend="runtime-config-resource-vacuum-cost">) are
+ (see <xref linkend="runtime-config-resource-vacuum-cost"/>) are
<quote>balanced</quote> among all the running workers, so that the
total I/O impact on the system is the same regardless of the number
of workers actually running. However, any workers processing tables whose
<para>
In some situations it is worthwhile to rebuild indexes periodically
- with the <xref linkend="sql-reindex"> command or a series of individual
+ with the <xref linkend="sql-reindex"/> command or a series of individual
rebuilding steps.
</para>
</para>
<para>
- <xref linkend="sql-reindex"> can be used safely and easily in all cases.
+ <xref linkend="sql-reindex"/> can be used safely and easily in all cases.
But since the command requires an exclusive table lock, it is
often preferable to execute an index rebuild with a sequence of
creation and replacement steps. Index types that support
- <xref linkend="sql-createindex"> with the <literal>CONCURRENTLY</literal>
+ <xref linkend="sql-createindex"/> with the <literal>CONCURRENTLY</literal>
option can instead be recreated that way. If that is successful and the
resulting index is valid, the original index can then be replaced by
- the newly built one using a combination of <xref linkend="sql-alterindex">
- and <xref linkend="sql-dropindex">. When an index is used to enforce
- uniqueness or other constraints, <xref linkend="sql-altertable"> might
+ the newly built one using a combination of <xref linkend="sql-alterindex"/>
+ and <xref linkend="sql-dropindex"/>. When an index is used to enforce
+ uniqueness or other constraints, <xref linkend="sql-altertable"/> might
be necessary to swap the existing constraint with one enforced by
the new index. Review this alternate multistep rebuild approach
carefully before using it as there are limitations on which
setting the configuration parameter <varname>logging_collector</varname> to
<literal>true</literal> in <filename>postgresql.conf</filename>. The control
parameters for this program are described in <xref
- linkend="runtime-config-logging-where">. You can also use this approach
+ linkend="runtime-config-logging-where"/>. You can also use this approach
to capture the log data in machine readable <acronym>CSV</acronym>
(comma-separated values) format.
</para>
resources, they should be put in the same database but possibly
into separate schemas. Schemas are a purely logical structure and who can
access what is managed by the privilege system. More information about
- managing schemas is in <xref linkend="ddl-schemas">.
+ managing schemas is in <xref linkend="ddl-schemas"/>.
</para>
<para>
Databases are created with the <command>CREATE DATABASE</command> command
- (see <xref linkend="manage-ag-createdb">) and destroyed with the
+ (see <xref linkend="manage-ag-createdb"/>) and destroyed with the
<command>DROP DATABASE</command> command
- (see <xref linkend="manage-ag-dropdb">).
+ (see <xref linkend="manage-ag-dropdb"/>).
To determine the set of existing databases, examine the
<structname>pg_database</structname> system catalog, for example
<synopsis>
SELECT datname FROM pg_database;
</synopsis>
- The <xref linkend="app-psql"> program's <literal>\l</literal> meta-command
+ The <xref linkend="app-psql"/> program's <literal>\l</literal> meta-command
and <option>-l</option> command-line option are also useful for listing the
existing databases.
</para>
<para>
In order to create a database, the <productname>PostgreSQL</productname>
server must be up and running (see <xref
- linkend="server-start">).
+ linkend="server-start"/>).
</para>
<para>
Databases are created with the SQL command
- <xref linkend="sql-createdatabase">:
+ <xref linkend="sql-createdatabase"/>:
<synopsis>
CREATE DATABASE <replaceable>name</replaceable>;
</synopsis>
<para>
The creation of databases is a restricted operation. See <xref
- linkend="role-attributes"> for how to grant permission.
+ linkend="role-attributes"/> for how to grant permission.
</para>
<para>
question remains how the <emphasis>first</emphasis> database at any given
site can be created. The first database is always created by the
<command>initdb</command> command when the data storage area is
- initialized. (See <xref linkend="creating-cluster">.) This
+ initialized. (See <xref linkend="creating-cluster"/>.) This
database is called
<literal>postgres</literal>.<indexterm><primary>postgres</primary></indexterm> So to
create the first <quote>ordinary</quote> database you can connect to
propagated to all subsequently created databases. Because of this,
avoid creating objects in <literal>template1</literal> unless you want them
propagated to every newly created database. More details
- appear in <xref linkend="manage-ag-templatedbs">.
+ appear in <xref linkend="manage-ag-templatedbs"/>.
</para>
<para>
<command>createdb</command> does no magic. It connects to the <literal>postgres</literal>
database and issues the <command>CREATE DATABASE</command> command,
exactly as described above.
- The <xref linkend="app-createdb"> reference page contains the invocation
+ The <xref linkend="app-createdb"/> reference page contains the invocation
details. Note that <command>createdb</command> without any arguments will create
a database with the current user name.
</para>
<note>
<para>
- <xref linkend="client-authentication"> contains information about
+ <xref linkend="client-authentication"/> contains information about
how to restrict who can connect to a given database.
</para>
</note>
<title>Database Configuration</title>
<para>
- Recall from <xref linkend="runtime-config"> that the
+ Recall from <xref linkend="runtime-config"/> that the
<productname>PostgreSQL</productname> server provides a large number of
run-time configuration variables. You can set database-specific
default values for many of these settings.
<para>
Databases are destroyed with the command
- <xref linkend="sql-dropdatabase">:<indexterm><primary>DROP DATABASE</primary></indexterm>
+ <xref linkend="sql-dropdatabase"/>:<indexterm><primary>DROP DATABASE</primary></indexterm>
<synopsis>
DROP DATABASE <replaceable>name</replaceable>;
</synopsis>
<para>
For convenience, there is also a shell program to drop
- databases, <xref linkend="app-dropdb">:<indexterm><primary>dropdb</primary></indexterm>
+ databases, <xref linkend="app-dropdb"/>:<indexterm><primary>dropdb</primary></indexterm>
<synopsis>
dropdb <replaceable class="parameter">dbname</replaceable>
</synopsis>
<para>
To define a tablespace, use the <xref
- linkend="sql-createtablespace">
+ linkend="sql-createtablespace"/>
command, for example:<indexterm><primary>CREATE TABLESPACE</primary></indexterm>:
<programlisting>
CREATE TABLESPACE fastspace LOCATION '/ssd1/postgresql/data';
</para>
<para>
- Alternatively, use the <xref linkend="guc-default-tablespace"> parameter:
+ Alternatively, use the <xref linkend="guc-default-tablespace"/> parameter:
<programlisting>
SET default_tablespace = space1;
CREATE TABLE foo(i int);
</para>
<para>
- There is also a <xref linkend="guc-temp-tablespaces"> parameter, which
+ There is also a <xref linkend="guc-temp-tablespaces"/> parameter, which
determines the placement of temporary tables and indexes, as well as
temporary files that are used for purposes such as sorting large data
sets. This can be a list of tablespace names, rather than only one,
<para>
To remove an empty tablespace, use the <xref
- linkend="sql-droptablespace">
+ linkend="sql-droptablespace"/>
command.
</para>
<synopsis>
SELECT spcname FROM pg_tablespace;
</synopsis>
- The <xref linkend="app-psql"> program's <literal>\db</literal> meta-command
+ The <xref linkend="app-psql"/> program's <literal>\db</literal> meta-command
is also useful for listing the existing tablespaces.
</para>
<command>ps</command>, <command>top</command>, <command>iostat</command>, and <command>vmstat</command>.
Also, once one has identified a
poorly-performing query, further investigation might be needed using
- <productname>PostgreSQL</productname>'s <xref linkend="sql-explain"> command.
- <xref linkend="using-explain"> discusses <command>EXPLAIN</command>
+ <productname>PostgreSQL</productname>'s <xref linkend="sql-explain"/> command.
+ <xref linkend="using-explain"/> discusses <command>EXPLAIN</command>
and other methods for understanding the behavior of an individual
query.
</para>
</para>
<para>
- If <xref linkend="guc-cluster-name"> has been configured the
+ If <xref linkend="guc-cluster-name"/> has been configured the
cluster name will also be shown in <command>ps</command> output:
<screen>
$ psql -c 'SHOW cluster_name'
</para>
<para>
- If you have turned off <xref linkend="guc-update-process-title"> then the
+ If you have turned off <xref linkend="guc-update-process-title"/> then the
activity indicator is not updated; the process title is set only once
when a new process is launched. On some platforms this saves a measurable
amount of per-command overhead; on others it's insignificant.
Since collection of statistics adds some overhead to query execution,
the system can be configured to collect or not collect information.
This is controlled by configuration parameters that are normally set in
- <filename>postgresql.conf</filename>. (See <xref linkend="runtime-config"> for
+ <filename>postgresql.conf</filename>. (See <xref linkend="runtime-config"/> for
details about setting configuration parameters.)
</para>
<para>
- The parameter <xref linkend="guc-track-activities"> enables monitoring
+ The parameter <xref linkend="guc-track-activities"/> enables monitoring
of the current command being executed by any server process.
</para>
<para>
- The parameter <xref linkend="guc-track-counts"> controls whether
+ The parameter <xref linkend="guc-track-counts"/> controls whether
statistics are collected about table and index accesses.
</para>
<para>
- The parameter <xref linkend="guc-track-functions"> enables tracking of
+ The parameter <xref linkend="guc-track-functions"/> enables tracking of
usage of user-defined functions.
</para>
<para>
- The parameter <xref linkend="guc-track-io-timing"> enables monitoring
+ The parameter <xref linkend="guc-track-io-timing"/> enables monitoring
of block read and write times.
</para>
Normally these parameters are set in <filename>postgresql.conf</filename> so
that they apply to all server processes, but it is possible to turn
them on or off in individual sessions using the <xref
- linkend="sql-set"> command. (To prevent
+ linkend="sql-set"/> command. (To prevent
ordinary users from hiding their activity from the administrator,
only superusers are allowed to change these parameters with
<command>SET</command>.)
The statistics collector transmits the collected information to other
<productname>PostgreSQL</productname> processes through temporary files.
These files are stored in the directory named by the
- <xref linkend="guc-stats-temp-directory"> parameter,
+ <xref linkend="guc-stats-temp-directory"/> parameter,
<filename>pg_stat_tmp</filename> by default.
For better performance, <varname>stats_temp_directory</varname> can be
pointed at a RAM-based file system, decreasing physical I/O requirements.
<para>
Several predefined views, listed in <xref
- linkend="monitoring-stats-dynamic-views-table">, are available to show
+ linkend="monitoring-stats-dynamic-views-table"/>, are available to show
the current state of the system. There are also several other
views, listed in <xref
- linkend="monitoring-stats-views-table">, available to show the results
+ linkend="monitoring-stats-views-table"/>, available to show the results
of statistics collection. Alternatively, one can
build custom views using the underlying statistics functions, as discussed
- in <xref linkend="monitoring-stats-functions">.
+ in <xref linkend="monitoring-stats-functions"/>.
</para>
<para>
<entry>
One row per server process, showing information related to
the current activity of that process, such as state and current query.
- See <xref linkend="pg-stat-activity-view"> for details.
+ See <xref linkend="pg-stat-activity-view"/> for details.
</entry>
</row>
<entry><structname>pg_stat_replication</structname><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
<entry>One row per WAL sender process, showing statistics about
replication to that sender's connected standby server.
- See <xref linkend="pg-stat-replication-view"> for details.
+ See <xref linkend="pg-stat-replication-view"/> for details.
</entry>
</row>
<entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
<entry>Only one row, showing statistics about the WAL receiver from
that receiver's connected server.
- See <xref linkend="pg-stat-wal-receiver-view"> for details.
+ See <xref linkend="pg-stat-wal-receiver-view"/> for details.
</entry>
</row>
<entry><structname>pg_stat_subscription</structname><indexterm><primary>pg_stat_subscription</primary></indexterm></entry>
<entry>At least one row per subscription, showing information about
the subscription workers.
- See <xref linkend="pg-stat-subscription"> for details.
+ See <xref linkend="pg-stat-subscription"/> for details.
</entry>
</row>
<entry><structname>pg_stat_ssl</structname><indexterm><primary>pg_stat_ssl</primary></indexterm></entry>
<entry>One row per connection (regular and replication), showing information about
SSL used on this connection.
- See <xref linkend="pg-stat-ssl-view"> for details.
+ See <xref linkend="pg-stat-ssl-view"/> for details.
</entry>
</row>
<entry><structname>pg_stat_progress_vacuum</structname><indexterm><primary>pg_stat_progress_vacuum</primary></indexterm></entry>
<entry>One row for each backend (including autovacuum worker processes) running
<command>VACUUM</command>, showing current progress.
- See <xref linkend='vacuum-progress-reporting'>.
+ See <xref linkend='vacuum-progress-reporting'/>.
</entry>
</row>
<entry><structname>pg_stat_archiver</structname><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
- <xref linkend="pg-stat-archiver-view"> for details.
+ <xref linkend="pg-stat-archiver-view"/> for details.
</entry>
</row>
<entry><structname>pg_stat_bgwriter</structname><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
<entry>One row only, showing statistics about the
background writer process's activity. See
- <xref linkend="pg-stat-bgwriter-view"> for details.
+ <xref linkend="pg-stat-bgwriter-view"/> for details.
</entry>
</row>
<row>
<entry><structname>pg_stat_database</structname><indexterm><primary>pg_stat_database</primary></indexterm></entry>
<entry>One row per database, showing database-wide statistics. See
- <xref linkend="pg-stat-database-view"> for details.
+ <xref linkend="pg-stat-database-view"/> for details.
</entry>
</row>
<entry>
One row per database, showing database-wide statistics about
query cancels due to conflict with recovery on standby servers.
- See <xref linkend="pg-stat-database-conflicts-view"> for details.
+ See <xref linkend="pg-stat-database-conflicts-view"/> for details.
</entry>
</row>
<entry>
One row for each table in the current database, showing statistics
about accesses to that specific table.
- See <xref linkend="pg-stat-all-tables-view"> for details.
+ See <xref linkend="pg-stat-all-tables-view"/> for details.
</entry>
</row>
<entry>
One row for each index in the current database, showing statistics
about accesses to that specific index.
- See <xref linkend="pg-stat-all-indexes-view"> for details.
+ See <xref linkend="pg-stat-all-indexes-view"/> for details.
</entry>
</row>
<entry>
One row for each table in the current database, showing statistics
about I/O on that specific table.
- See <xref linkend="pg-statio-all-tables-view"> for details.
+ See <xref linkend="pg-statio-all-tables-view"/> for details.
</entry>
</row>
<entry>
One row for each index in the current database,
showing statistics about I/O on that specific index.
- See <xref linkend="pg-statio-all-indexes-view"> for details.
+ See <xref linkend="pg-statio-all-indexes-view"/> for details.
</entry>
</row>
<entry>
One row for each sequence in the current database,
showing statistics about I/O on that specific sequence.
- See <xref linkend="pg-statio-all-sequences-view"> for details.
+ See <xref linkend="pg-statio-all-sequences-view"/> for details.
</entry>
</row>
<entry>
One row for each tracked function, showing statistics
about executions of that function. See
- <xref linkend="pg-stat-user-functions-view"> for details.
+ <xref linkend="pg-stat-user-functions-view"/> for details.
</entry>
</row>
<entry>Host name of the connected client, as reported by a
reverse DNS lookup of <structfield>client_addr</structfield>. This field will
only be non-null for IP connections, and only when <xref
- linkend="guc-log-hostname"> is enabled.
+ linkend="guc-log-hostname"/> is enabled.
</entry>
</row>
<row>
<entry><structfield>wait_event</structfield></entry>
<entry><type>text</type></entry>
<entry>Wait event name if backend is currently waiting, otherwise NULL.
- See <xref linkend="wait-event-table"> for details.
+ See <xref linkend="wait-event-table"/> for details.
</entry>
</row>
<row>
<listitem>
<para>
<literal>disabled</literal>: This state is reported if <xref
- linkend="guc-track-activities"> is disabled in this backend.
+ linkend="guc-track-activities"/> is disabled in this backend.
</para>
</listitem>
</itemizedlist>
currently executing query. In all other states, it shows the last query
that was executed. By default the query text is truncated at 1024
characters; this value can be changed via the parameter
- <xref linkend="guc-track-activity-query-size">.
+ <xref linkend="guc-track-activity-query-size"/>.
</entry>
</row>
<row>
<entry>Host name of the connected client, as reported by a
reverse DNS lookup of <structfield>client_addr</structfield>. This field will
only be non-null for IP connections, and only when <xref
- linkend="guc-log-hostname"> is enabled.
+ linkend="guc-log-hostname"/> is enabled.
</entry>
</row>
<row>
<entry><structfield>backend_xmin</structfield></entry>
<entry><type>xid</type></entry>
<entry>This standby's <literal>xmin</literal> horizon reported
- by <xref linkend="guc-hot-standby-feedback">.</entry>
+ by <xref linkend="guc-hot-standby-feedback"/>.</entry>
</row>
<row>
<entry><structfield>state</structfield></entry>
<entry><type>bigint</type></entry>
<entry>Number of queries canceled due to conflicts with recovery
in this database. (Conflicts occur only on standby servers; see
- <xref linkend="pg-stat-database-conflicts-view"> for details.)
+ <xref linkend="pg-stat-database-conflicts-view"/> for details.)
</entry>
</row>
<row>
<entry>Number of temporary files created by queries in this database.
All temporary files are counted, regardless of why the temporary file
was created (e.g., sorting or hashing), and regardless of the
- <xref linkend="guc-log-temp-files"> setting.
+ <xref linkend="guc-log-temp-files"/> setting.
</entry>
</row>
<row>
<entry>Total amount of data written to temporary files by queries in
this database. All temporary files are counted, regardless of why
the temporary file was created, and
- regardless of the <xref linkend="guc-log-temp-files"> setting.
+ regardless of the <xref linkend="guc-log-temp-files"/> setting.
</entry>
</row>
<row>
<para>
The <structname>pg_stat_user_functions</structname> view will contain
one row for each tracked function, showing statistics about executions of
- that function. The <xref linkend="guc-track-functions"> parameter
+ that function. The <xref linkend="guc-track-functions"/> parameter
controls exactly which functions are tracked.
</para>
<para>
Additional functions related to statistics collection are listed in <xref
- linkend="monitoring-stats-funcs-table">.
+ linkend="monitoring-stats-funcs-table"/>.
</para>
<table id="monitoring-stats-funcs-table">
Sometimes it may be more convenient to obtain just a subset of this
information. In such cases, an older set of per-backend statistics
access functions can be used; these are shown in <xref
- linkend="monitoring-stats-backend-funcs-table">.
+ linkend="monitoring-stats-backend-funcs-table"/>.
These access functions use a backend ID number, which ranges from one
to the number of currently active backends.
The function <function>pg_stat_get_backend_idset</function> provides a
<entry><literal><function>pg_stat_get_backend_wait_event_type(integer)</function></literal></entry>
<entry><type>text</type></entry>
<entry>Wait event type name if backend is currently waiting, otherwise NULL.
- See <xref linkend="wait-event-table"> for details.
+ See <xref linkend="wait-event-table"/> for details.
</entry>
</row>
<entry><literal><function>pg_stat_get_backend_wait_event(integer)</function></literal></entry>
<entry><type>text</type></entry>
<entry>Wait event name if backend is currently waiting, otherwise NULL.
- See <xref linkend="wait-event-table"> for details.
+ See <xref linkend="wait-event-table"/> for details.
</entry>
</row>
</itemizedlist>
Details of the <structname>pg_locks</structname> view appear in
- <xref linkend="view-pg-locks">.
+ <xref linkend="view-pg-locks"/>.
For more information on locking and managing concurrency with
- <productname>PostgreSQL</productname>, refer to <xref linkend="mvcc">.
+ <productname>PostgreSQL</productname>, refer to <xref linkend="mvcc"/>.
</para>
</sect1>
<entry><structfield>phase</structfield></entry>
<entry><type>text</type></entry>
<entry>
- Current processing phase of vacuum. See <xref linkend='vacuum-phases'>.
+ Current processing phase of vacuum. See <xref linkend='vacuum-phases'/>.
</entry>
</row>
<row>
<entry>
Number of dead tuples that we can store before needing to perform
an index vacuum cycle, based on
- <xref linkend="guc-maintenance-work-mem">.
+ <xref linkend="guc-maintenance-work-mem"/>.
</entry>
</row>
<row>
<command>VACUUM</command> is currently vacuuming the indexes. If a table has
any indexes, this will happen at least once per vacuum, after the heap
has been completely scanned. It may happen multiple times per vacuum
- if <xref linkend="guc-maintenance-work-mem"> is insufficient to
+ if <xref linkend="guc-maintenance-work-mem"/> is insufficient to
store the number of dead tuples found.
</entry>
</row>
explicitly tell the configure script to make the probes available
in <productname>PostgreSQL</productname>. To include DTrace support
specify <option>--enable-dtrace</option> to configure. See <xref
- linkend="install-procedure"> for further information.
+ linkend="install-procedure"/> for further information.
</para>
</sect2>
<para>
A number of standard probes are provided in the source code,
- as shown in <xref linkend="dtrace-probe-point-table">;
- <xref linkend="typedefs-table">
+ as shown in <xref linkend="dtrace-probe-point-table"/>;
+ <xref linkend="typedefs-table"/>
shows the types used in the probes. More probes can certainly be
added to enhance <productname>PostgreSQL</productname>'s observability.
</para>
<entry><literal>(ForkNumber, BlockNumber, Oid, Oid, Oid)</literal></entry>
<entry>Probe that fires when a server process begins to write a dirty
buffer. (If this happens often, it implies that
- <xref linkend="guc-shared-buffers"> is too
+ <xref linkend="guc-shared-buffers"/> is too
small or the background writer control parameters need adjustment.)
arg0 and arg1 contain the fork and block numbers of the page.
arg2, arg3, and arg4 contain the tablespace, database, and relation OIDs
<entry>Probe that fires when a server process begins to write a
dirty WAL buffer because no more WAL buffer space is available.
(If this happens often, it implies that
- <xref linkend="guc-wal-buffers"> is too small.)</entry>
+ <xref linkend="guc-wal-buffers"/> is too small.)</entry>
</row>
<row>
<entry><literal>wal-buffer-write-dirty-done</literal></entry>
<primary>transaction isolation level</primary>
</indexterm>
The SQL standard and PostgreSQL-implemented transaction isolation levels
- are described in <xref linkend="mvcc-isolevel-table">.
+ are described in <xref linkend="mvcc-isolevel-table"/>.
</para>
<table tocentry="1" id="mvcc-isolevel-table">
<para>
To set the transaction isolation level of a transaction, use the
- command <xref linkend="sql-set-transaction">.
+ command <xref linkend="sql-set-transaction"/>.
</para>
<important>
made to a sequence (and therefore the counter of a
column declared using <type>serial</type>) are immediately visible
to all other transactions and are not rolled back if the transaction
- that made the changes aborts. See <xref linkend="functions-sequence">
- and <xref linkend="datatype-serial">.
+ that made the changes aborts. See <xref linkend="functions-sequence"/>
+ and <xref linkend="datatype-serial"/>.
</para>
</important>
even though they are not yet committed.) This is a stronger
guarantee than is required by the <acronym>SQL</acronym> standard
for this isolation level, and prevents all of the phenomena described
- in <xref linkend="mvcc-isolevel-table"> except for serialization
+ in <xref linkend="mvcc-isolevel-table"/> except for serialization
anomalies. As mentioned above, this is
specifically allowed by the standard, which only describes the
<emphasis>minimum</emphasis> protections each isolation level must
<para>
Don't leave connections dangling <quote>idle in transaction</quote>
longer than necessary. The configuration parameter
- <xref linkend="guc-idle-in-transaction-session-timeout"> may be used to
+ <xref linkend="guc-idle-in-transaction-session-timeout"/> may be used to
automatically disconnect lingering sessions.
</para>
</listitem>
locks into a single relation-level predicate lock because the predicate
lock table is short of memory, an increase in the rate of serialization
failures may occur. You can avoid this by increasing
- <xref linkend="guc-max-pred-locks-per-transaction">,
- <xref linkend="guc-max-pred-locks-per-relation">, and/or
- <xref linkend="guc-max-pred-locks-per-page">.
+ <xref linkend="guc-max-pred-locks-per-transaction"/>,
+ <xref linkend="guc-max-pred-locks-per-relation"/>, and/or
+ <xref linkend="guc-max-pred-locks-per-page"/>.
</para>
</listitem>
<listitem>
A sequential scan will always necessitate a relation-level predicate
lock. This can result in an increased rate of serialization failures.
It may be helpful to encourage the use of index scans by reducing
- <xref linkend="guc-random-page-cost"> and/or increasing
- <xref linkend="guc-cpu-tuple-cost">. Be sure to weigh any decrease
+ <xref linkend="guc-random-page-cost"/> and/or increasing
+ <xref linkend="guc-cpu-tuple-cost"/>. Be sure to weigh any decrease
in transaction rollbacks and restarts against any overall change in
query execution time.
</para>
server, use the
<link linkend="view-pg-locks"><structname>pg_locks</structname></link>
system view. For more information on monitoring the status of the lock
- manager subsystem, refer to <xref linkend="monitoring">.
+ manager subsystem, refer to <xref linkend="monitoring"/>.
</para>
<sect2 id="locking-tables">
which they are used automatically by
<productname>PostgreSQL</productname>. You can also acquire any
of these locks explicitly with the command <xref
- linkend="sql-lock">.
+ linkend="sql-lock"/>.
Remember that all of these lock modes are table-level locks,
even if the name contains the word
<quote>row</quote>; the names of the lock modes are historical.
To some extent the names reflect the typical usage of each lock
mode — but the semantics are all the same. The only real difference
between one lock mode and another is the set of lock modes with
- which each conflicts (see <xref linkend="table-lock-compatibility">).
+ which each conflicts (see <xref linkend="table-lock-compatibility"/>).
Two transactions cannot hold locks of conflicting
modes on the same table at the same time. (However, a transaction
never conflicts with itself. For example, it might acquire
<command>CREATE STATISTICS</command> and
<command>ALTER TABLE VALIDATE</command> and other
<command>ALTER TABLE</command> variants (for full details see
- <xref linkend="sql-altertable">).
+ <xref linkend="sql-altertable"/>).
</para>
</listitem>
</varlistentry>
<para>
Acquired by <command>CREATE COLLATION</command>,
<command>CREATE TRIGGER</command>, and many forms of
- <command>ALTER TABLE</command> (see <xref linkend="sql-altertable">).
+ <command>ALTER TABLE</command> (see <xref linkend="sql-altertable"/>).
</para>
</listitem>
</varlistentry>
<table tocentry="1" id="table-lock-compatibility">
<title> Conflicting Lock Modes</title>
<tgroup cols="9">
- <colspec colnum="2" colname="lockst">
- <colspec colnum="9" colname="lockend">
- <spanspec namest="lockst" nameend="lockend" spanname="lockreq">
+ <colspec colnum="2" colname="lockst"/>
+ <colspec colnum="9" colname="lockend"/>
+ <spanspec namest="lockst" nameend="lockend" spanname="lockreq"/>
<thead>
<row>
<entry morerows="1">Requested Lock Mode</entry>
In addition to table-level locks, there are row-level locks, which
are listed as below with the contexts in which they are used
automatically by <productname>PostgreSQL</productname>. See
- <xref linkend="row-lock-compatibility"> for a complete table of
+ <xref linkend="row-lock-compatibility"/> for a complete table of
row-level lock conflicts. Note that a transaction can hold
conflicting locks on the same row, even in different subtransactions;
but other than that, two transactions can never hold conflicting locks
<literal>SERIALIZABLE</literal> transaction,
however, an error will be thrown if a row to be locked has changed
since the transaction started. For further discussion see
- <xref linkend="applevel-consistency">.
+ <xref linkend="applevel-consistency"/>.
</para>
<para>
The <literal>FOR UPDATE</literal> lock mode
<table tocentry="1" id="row-lock-compatibility">
<title>Conflicting Row-level Locks</title>
<tgroup cols="5">
- <colspec colnum="2" colname="lockst">
- <colspec colnum="5" colname="lockend">
- <spanspec namest="lockst" nameend="lockend" spanname="lockreq">
+ <colspec colnum="2" colname="lockst"/>
+ <colspec colnum="5" colname="lockend"/>
+ <spanspec namest="lockst" nameend="lockend" spanname="lockreq"/>
<thead>
<row>
<entry morerows="1">Requested Lock Mode</entry>
<para>
Both advisory locks and regular locks are stored in a shared memory
pool whose size is defined by the configuration variables
- <xref linkend="guc-max-locks-per-transaction"> and
- <xref linkend="guc-max-connections">.
+ <xref linkend="guc-max-locks-per-transaction"/> and
+ <xref linkend="guc-max-connections"/>.
Care must be taken not to exhaust this
memory or the server will be unable to grant any locks at all.
This imposes an upper limit on the number of advisory locks
<para>
The functions provided to manipulate advisory locks are described in
- <xref linkend="functions-advisory-locks">.
+ <xref linkend="functions-advisory-locks"/>.
</para>
</sect2>
</para>
<para>
- As mentioned in <xref linkend="xact-serializable">, Serializable
+ As mentioned in <xref linkend="xact-serializable"/>, Serializable
transactions are just Repeatable Read transactions which add
nonblocking monitoring for dangerous patterns of read/write conflicts.
When a pattern is detected which could cause a cycle in the apparent
</para>
<para>
- See <xref linkend="xact-serializable"> for performance suggestions.
+ See <xref linkend="xact-serializable"/> for performance suggestions.
</para>
<warning>
<para>
This level of integrity protection using Serializable transactions
- does not yet extend to hot standby mode (<xref linkend="hot-standby">).
+ does not yet extend to hot standby mode (<xref linkend="hot-standby"/>).
Because of that, those using hot standby may want to use Repeatable
Read and explicit locking on the master.
</para>
<title>Caveats</title>
<para>
- Some DDL commands, currently only <xref linkend="sql-truncate"> and the
- table-rewriting forms of <xref linkend="sql-altertable">, are not
+ Some DDL commands, currently only <xref linkend="sql-truncate"/> and the
+ table-rewriting forms of <xref linkend="sql-altertable"/>, are not
MVCC-safe. This means that after the truncation or rewrite commits, the
table will appear empty to concurrent transactions, if they are using a
snapshot taken before the DDL command committed. This will only be an
<para>
Support for the Serializable transaction isolation level has not yet
been added to Hot Standby replication targets (described in
- <xref linkend="hot-standby">). The strictest isolation level currently
+ <xref linkend="hot-standby"/>). The strictest isolation level currently
supported in hot standby mode is Repeatable Read. While performing all
permanent database writes within Serializable transactions on the
master will ensure that all standbys will eventually reach a consistent
open file %s</literal>) should probably not start with a
capital letter (if your language distinguishes letter case) or
end with a period (if your language uses punctuation marks).
- It might help to read <xref linkend="error-style-guide">.
+ It might help to read <xref linkend="error-style-guide"/>.
</para>
</listitem>
<application>oid2name</application> is a utility program that helps administrators to
examine the file structure used by PostgreSQL. To make use of it, you need
to be familiar with the database file structure, which is described in
- <xref linkend="storage">.
+ <xref linkend="storage"/>.
</para>
<note>
worker processes</link> equal to the number
of workers chosen by the planner. The number of background workers that
the planner will consider using is limited to at most
- <xref linkend="guc-max-parallel-workers-per-gather">. The total number
+ <xref linkend="guc-max-parallel-workers-per-gather"/>. The total number
of background workers that can exist at any one time is limited by both
- <xref linkend="guc-max-worker-processes"> and
- <xref linkend="guc-max-parallel-workers">. Therefore, it is possible for a
+ <xref linkend="guc-max-worker-processes"/> and
+ <xref linkend="guc-max-parallel-workers"/>. Therefore, it is possible for a
parallel query to run with fewer workers than planned, or even with
no workers at all. The optimal plan may depend on the number of workers
that are available, so this can result in poor query performance. If this
<itemizedlist>
<listitem>
<para>
- <xref linkend="guc-max-parallel-workers-per-gather"> must be set to a
+ <xref linkend="guc-max-parallel-workers-per-gather"/> must be set to a
value which is greater than zero. This is a special case of the more
general principle that no more workers should be used than the number
configured via <varname>max_parallel_workers_per_gather</varname>.
<listitem>
<para>
- <xref linkend="guc-dynamic-shared-memory-type"> must be set to a
+ <xref linkend="guc-dynamic-shared-memory-type"/> must be set to a
value other than <literal>none</literal>. Parallel query requires dynamic
shared memory in order to pass data between cooperating processes.
</para>
Most system-defined functions are <literal>PARALLEL SAFE</literal>,
but user-defined functions are marked <literal>PARALLEL
UNSAFE</literal> by default. See the discussion of
- <xref linkend="parallel-safety">.
+ <xref linkend="parallel-safety"/>.
</para>
</listitem>
<para>
No background workers can be obtained because of the limitation that
the total number of background workers cannot exceed
- <xref linkend="guc-max-worker-processes">.
+ <xref linkend="guc-max-worker-processes"/>.
</para>
</listitem>
<para>
No background workers can be obtained because of the limitation that
the total number of background workers launched for purposes of
- parallel query cannot exceed <xref linkend="guc-max-parallel-workers">.
+ parallel query cannot exceed <xref linkend="guc-max-parallel-workers"/>.
</para>
</listitem>
send such a message, this can only occur when using a client that
does not rely on libpq. If this is a frequent
occurrence, it may be a good idea to set
- <xref linkend="guc-max-parallel-workers-per-gather"> to zero in
+ <xref linkend="guc-max-parallel-workers-per-gather"/> to zero in
sessions where it is likely, so as to avoid generating query plans
that may be suboptimal when run serially.
</para>
must be <link linkend="parallel-safety">safe</link> for parallelism and must
have a combine function. If the aggregate has a transition state of type
<literal>internal</literal>, it must have serialization and deserialization
- functions. See <xref linkend="sql-createaggregate"> for more details.
+ functions. See <xref linkend="sql-createaggregate"/> for more details.
Parallel aggregation is not supported if any aggregate function call
contains <literal>DISTINCT</literal> or <literal>ORDER BY</literal> clause and is also
not supported for ordered set aggregates or when the query involves
<para>
If a query that is expected to do so does not produce a parallel plan,
- you can try reducing <xref linkend="guc-parallel-setup-cost"> or
- <xref linkend="guc-parallel-tuple-cost">. Of course, this plan may turn
+ you can try reducing <xref linkend="guc-parallel-setup-cost"/> or
+ <xref linkend="guc-parallel-tuple-cost"/>. Of course, this plan may turn
out to be slower than the serial plan which the planner preferred, but
this will not always be the case. If you don't get a parallel
plan even with very small values of these settings (e.g. after setting
them both to zero), there may be some reason why the query planner is
unable to generate a parallel plan for your query. See
- <xref linkend="when-can-parallel-query-be-used"> and
- <xref linkend="parallel-safety"> for information on why this may be
+ <xref linkend="when-can-parallel-query-be-used"/> and
+ <xref linkend="parallel-safety"/> for information on why this may be
the case.
</para>
where it conceivably be done, we do not try, since this would be expensive
and error-prone. Instead, all user-defined functions are assumed to
be parallel unsafe unless otherwise marked. When using
- <xref linkend="sql-createfunction"> or
- <xref linkend="sql-alterfunction">, markings can be set by specifying
+ <xref linkend="sql-createfunction"/> or
+ <xref linkend="sql-alterfunction"/>, markings can be set by specifying
<literal>PARALLEL SAFE</literal>, <literal>PARALLEL RESTRICTED</literal>, or
<literal>PARALLEL UNSAFE</literal> as appropriate. When using
- <xref linkend="sql-createaggregate">, the
+ <xref linkend="sql-createaggregate"/>, the
<literal>PARALLEL</literal> option can be specified with <literal>SAFE</literal>,
<literal>RESTRICTED</literal>, or <literal>UNSAFE</literal> as the corresponding value.
</para>
<para>
The <filename>passwordcheck</filename> module checks users' passwords
whenever they are set with
- <xref linkend="sql-createrole"> or
- <xref linkend="sql-alterrole">.
+ <xref linkend="sql-createrole"/> or
+ <xref linkend="sql-alterrole"/>.
If a password is considered too weak, it will be rejected and
the command will terminate with an error.
</para>
<para>
To enable this module, add <literal>'$libdir/passwordcheck'</literal>
- to <xref linkend="guc-shared-preload-libraries"> in
+ to <xref linkend="guc-shared-preload-libraries"/> in
<filename>postgresql.conf</filename>, then restart the server.
</para>
For this reason, <filename>passwordcheck</filename> is not
recommended if your security requirements are high.
It is more secure to use an external authentication method such as GSSAPI
- (see <xref linkend="client-authentication">) than to rely on
+ (see <xref linkend="client-authentication"/>) than to rely on
passwords within the database.
</para>
<para>
plan to match the query structure and the properties of the data
is absolutely critical for good performance, so the system includes
a complex <firstterm>planner</firstterm> that tries to choose good plans.
- You can use the <xref linkend="sql-explain"> command
+ You can use the <xref linkend="sql-explain"/> command
to see what query plan the planner creates for any query.
Plan-reading is an art that requires some experience to master,
but this section attempts to cover the basics.
<para>
The costs are measured in arbitrary units determined by the planner's
- cost parameters (see <xref linkend="runtime-config-query-constants">).
+ cost parameters (see <xref linkend="runtime-config-query-constants"/>).
Traditional practice is to measure the costs in units of disk page
- fetches; that is, <xref linkend="guc-seq-page-cost"> is conventionally
+ fetches; that is, <xref linkend="guc-seq-page-cost"/> is conventionally
set to <literal>1.0</literal> and the other cost parameters are set relative
to that. The examples in this section are run with the default cost
parameters.
you will find that <classname>tenk1</classname> has 358 disk
pages and 10000 rows. The estimated cost is computed as (disk pages read *
- <xref linkend="guc-seq-page-cost">) + (rows scanned *
- <xref linkend="guc-cpu-tuple-cost">). By default,
+ <xref linkend="guc-seq-page-cost"/>) + (rows scanned *
+ <xref linkend="guc-cpu-tuple-cost"/>). By default,
<varname>seq_page_cost</varname> is 1.0 and <varname>cpu_tuple_cost</varname> is 0.01,
so the estimated cost is (358 * 1.0) + (10000 * 0.01) = 458.
</para>
<literal>WHERE</literal> clause.
However, the scan will still have to visit all 10000 rows, so the cost
hasn't decreased; in fact it has gone up a bit (by 10000 * <xref
- linkend="guc-cpu-operator-cost">, to be exact) to reflect the extra CPU
+ linkend="guc-cpu-operator-cost"/>, to be exact) to reflect the extra CPU
time spent checking the <literal>WHERE</literal> condition.
</para>
<para>
One way to look at variant plans is to force the planner to disregard
whatever strategy it thought was the cheapest, using the enable/disable
- flags described in <xref linkend="runtime-config-query-enable">.
+ flags described in <xref linkend="runtime-config-query-enable"/>.
(This is a crude tool, but useful. See
- also <xref linkend="explicit-joins">.)
+ also <xref linkend="explicit-joins"/>.)
For example, if we're unconvinced that sequential-scan-and-sort is the best way to
deal with table <literal>onek</literal> in the previous example, we could try
Second, the measurement overhead added by <command>EXPLAIN
ANALYZE</command> can be significant, especially on machines with slow
<function>gettimeofday()</function> operating-system calls. You can use the
- <xref linkend="pgtesttiming"> tool to measure the overhead of timing
+ <xref linkend="pgtesttiming"/> tool to measure the overhead of timing
on your system.
</para>
arrays for each column, can be set on a
column-by-column basis using the <command>ALTER TABLE SET STATISTICS</command>
command, or globally by setting the
- <xref linkend="guc-default-statistics-target"> configuration variable.
+ <xref linkend="guc-default-statistics-target"/> configuration variable.
The default limit is presently 100 entries. Raising the limit
might allow more accurate planner estimates to be made, particularly for
columns with irregular data distributions, at the price of consuming
<para>
Further details about the planner's use of statistics can be found in
- <xref linkend="planner-stats-details">.
+ <xref linkend="planner-stats-details"/>.
</para>
</sect2>
<para>
Statistics objects are created using
- <xref linkend="sql-createstatistics">, which see for more details.
+ <xref linkend="sql-createstatistics"/>, which see for more details.
Creation of such an object merely creates a catalog entry expressing
interest in the statistics. Actual data collection is performed
by <command>ANALYZE</command> (either a manual command, or background
<productname>PostgreSQL</productname> planner will switch from exhaustive
search to a <firstterm>genetic</firstterm> probabilistic search
through a limited number of possibilities. (The switch-over threshold is
- set by the <xref linkend="guc-geqo-threshold"> run-time
+ set by the <xref linkend="guc-geqo-threshold"/> run-time
parameter.)
The genetic search takes less time, but it won't
necessarily find the best possible plan.
<para>
To force the planner to follow the join order laid out by explicit
<literal>JOIN</literal>s,
- set the <xref linkend="guc-join-collapse-limit"> run-time parameter to 1.
+ set the <xref linkend="guc-join-collapse-limit"/> run-time parameter to 1.
(Other possible values are discussed below.)
</para>
</para>
<para>
- <xref linkend="guc-from-collapse-limit"> and <xref
- linkend="guc-join-collapse-limit">
+ <xref linkend="guc-from-collapse-limit"/> and <xref
+ linkend="guc-join-collapse-limit"/>
are similarly named because they do almost the same thing: one controls
when the planner will <quote>flatten out</quote> subqueries, and the
other controls when it will flatten out explicit joins. Typically
<title>Use <command>COPY</command></title>
<para>
- Use <xref linkend="sql-copy"> to load
+ Use <xref linkend="sql-copy"/> to load
all the rows in one command, instead of using a series of
<command>INSERT</command> commands. The <command>COPY</command>
command is optimized for loading large numbers of rows; it is less
<para>
If you cannot use <command>COPY</command>, it might help to use <xref
- linkend="sql-prepare"> to create a
+ linkend="sql-prepare"/> to create a
prepared <command>INSERT</command> statement, and then use
<command>EXECUTE</command> as many times as required. This avoids
some of the overhead of repeatedly parsing and planning
needs to be written, because in case of an error, the files
containing the newly loaded data will be removed anyway.
However, this consideration only applies when
- <xref linkend="guc-wal-level"> is <literal>minimal</literal> as all commands
+ <xref linkend="guc-wal-level"/> is <literal>minimal</literal> as all commands
must write WAL otherwise.
</para>
<title>Increase <varname>maintenance_work_mem</varname></title>
<para>
- Temporarily increasing the <xref linkend="guc-maintenance-work-mem">
+ Temporarily increasing the <xref linkend="guc-maintenance-work-mem"/>
configuration variable when loading large amounts of data can
lead to improved performance. This will help to speed up <command>CREATE
INDEX</command> commands and <command>ALTER TABLE ADD FOREIGN KEY</command> commands.
<title>Increase <varname>max_wal_size</varname></title>
<para>
- Temporarily increasing the <xref linkend="guc-max-wal-size">
+ Temporarily increasing the <xref linkend="guc-max-wal-size"/>
configuration variable can also
make large data loads faster. This is because loading a large
amount of data into <productname>PostgreSQL</productname> will
new base backup after the load has completed than to process a large
amount of incremental WAL data. To prevent incremental WAL logging
while loading, disable archiving and streaming replication, by setting
- <xref linkend="guc-wal-level"> to <literal>minimal</literal>,
- <xref linkend="guc-archive-mode"> to <literal>off</literal>, and
- <xref linkend="guc-max-wal-senders"> to zero.
+ <xref linkend="guc-wal-level"/> to <literal>minimal</literal>,
+ <xref linkend="guc-archive-mode"/> to <literal>off</literal>, and
+ <xref linkend="guc-max-wal-senders"/> to zero.
But note that changing these settings requires a server restart.
</para>
<para>
Whenever you have significantly altered the distribution of data
- within a table, running <xref linkend="sql-analyze"> is strongly recommended. This
+ within a table, running <xref linkend="sql-analyze"/> is strongly recommended. This
includes bulk loading large amounts of data into the table. Running
<command>ANALYZE</command> (or <command>VACUUM ANALYZE</command>)
ensures that the planner has up-to-date statistics about the
performance on any tables with inaccurate or nonexistent
statistics. Note that if the autovacuum daemon is enabled, it might
run <command>ANALYZE</command> automatically; see
- <xref linkend="vacuum-for-statistics">
- and <xref linkend="autovacuum"> for more information.
+ <xref linkend="vacuum-for-statistics"/>
+ and <xref linkend="autovacuum"/> for more information.
</para>
</sect2>
<varname>maintenance_work_mem</varname>; rather, you'd do that while
manually recreating indexes and foreign keys afterwards.
And don't forget to <command>ANALYZE</command> when you're done; see
- <xref linkend="vacuum-for-statistics">
- and <xref linkend="autovacuum"> for more information.
+ <xref linkend="vacuum-for-statistics"/>
+ and <xref linkend="autovacuum"/> for more information.
</para>
</sect2>
</sect1>
<listitem>
<para>
- Turn off <xref linkend="guc-fsync">; there is no need to flush
+ Turn off <xref linkend="guc-fsync"/>; there is no need to flush
data to disk.
</para>
</listitem>
<listitem>
<para>
- Turn off <xref linkend="guc-synchronous-commit">; there might be no
+ Turn off <xref linkend="guc-synchronous-commit"/>; there might be no
need to force <acronym>WAL</acronym> writes to disk on every
commit. This setting does risk transaction loss (though not data
corruption) in case of a crash of the <emphasis>database</emphasis>.
<listitem>
<para>
- Turn off <xref linkend="guc-full-page-writes">; there is no need
+ Turn off <xref linkend="guc-full-page-writes"/>; there is no need
to guard against partial page writes.
</para>
</listitem>
<listitem>
<para>
- Increase <xref linkend="guc-max-wal-size"> and <xref
- linkend="guc-checkpoint-timeout">; this reduces the frequency
+ Increase <xref linkend="guc-max-wal-size"/> and <xref
+ linkend="guc-checkpoint-timeout"/>; this reduces the frequency
of checkpoints, but increases the storage requirements of
<filename>/pg_wal</filename>.
</para>
<title>The <structname>pg_buffercache</structname> View</title>
<para>
- The definitions of the columns exposed by the view are shown in <xref linkend="pgbuffercache-columns">.
+ The definitions of the columns exposed by the view are shown in <xref linkend="pgbuffercache-columns"/>.
</para>
<table id="pgbuffercache-columns">
<literal>sha384</literal> and <literal>sha512</literal>.
If <filename>pgcrypto</filename> was built with
OpenSSL, more algorithms are available, as detailed in
- <xref linkend="pgcrypto-with-without-openssl">.
+ <xref linkend="pgcrypto-with-without-openssl"/>.
</para>
<para>
</orderedlist>
<para>
- <xref linkend="pgcrypto-crypt-algorithms"> lists the algorithms
+ <xref linkend="pgcrypto-crypt-algorithms"/> lists the algorithms
supported by the <function>crypt()</function> function.
</para>
— which is somewhat impractical. If the <parameter>iter_count</parameter>
parameter is omitted, the default iteration count is used.
Allowed values for <parameter>iter_count</parameter> depend on the algorithm and
- are shown in <xref linkend="pgcrypto-icfc-table">.
+ are shown in <xref linkend="pgcrypto-icfc-table"/>.
</para>
<table id="pgcrypto-icfc-table">
</para>
<para>
- <xref linkend="pgcrypto-hash-speed-table"> gives an overview of the relative slowness
+ <xref linkend="pgcrypto-hash-speed-table"/> gives an overview of the relative slowness
of different hashing algorithms.
The table shows how much time it would take to try all
combinations of characters in an 8-character password, assuming
or the <productname>PostgreSQL</productname> buffer cache. Prewarming
can be performed manually using the <filename>pg_prewarm</filename> function,
or can be performed automatically by including <literal>pg_prewarm</literal> in
- <xref linkend="guc-shared-preload-libraries">. In the latter case, the
+ <xref linkend="guc-shared-preload-libraries"/>. In the latter case, the
system will run a background worker which periodically records the contents
of shared buffers in a file called <filename>autoprewarm.blocks</filename> and
will, using 2 background workers, reload those same blocks after a restart.
<para>
The parameter is the name of a table. The result is a set of records,
with one row for each locked row within the table. The output columns
- are shown in <xref linkend="pgrowlocks-columns">.
+ are shown in <xref linkend="pgrowlocks-columns"/>.
</para>
<table id="pgrowlocks-columns">
<varname>restore_command</varname>, which is needed to turn a standard
archive recovery into a warm standby operation. Other
configuration is required as well, all of which is described in the main
- server manual (see <xref linkend="warm-standby">).
+ server manual (see <xref linkend="warm-standby"/>).
</para>
<para>
Set the number of seconds (up to 60, default 5) to sleep between
tests to see if the WAL file to be restored is available in
the archive yet. The default setting is not necessarily
- recommended; consult <xref linkend="warm-standby"> for discussion.
+ recommended; consult <xref linkend="warm-standby"/> for discussion.
</para>
</listitem>
</varlistentry>
after which a fast failover will be performed.
A setting of zero (the default) means wait forever.
The default setting is not necessarily recommended;
- consult <xref linkend="warm-standby"> for discussion.
+ consult <xref linkend="warm-standby"/> for discussion.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="pgarchivecleanup"></member>
+ <member><xref linkend="pgarchivecleanup"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The module must be loaded by adding <literal>pg_stat_statements</literal> to
- <xref linkend="guc-shared-preload-libraries"> in
+ <xref linkend="guc-shared-preload-libraries"/> in
<filename>postgresql.conf</filename>, because it requires additional shared memory.
This means that a server restart is needed to add or remove the module.
</para>
contains one row for each distinct database ID, user ID and query
ID (up to the maximum number of distinct statements that the module
can track). The columns of the view are shown in
- <xref linkend="pgstatstatements-columns">.
+ <xref linkend="pgstatstatements-columns"/>.
</para>
<table id="pgstatstatements-columns">
<entry></entry>
<entry>
Total time the statement spent reading blocks, in milliseconds
- (if <xref linkend="guc-track-io-timing"> is enabled, otherwise zero)
+ (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero)
</entry>
</row>
<entry></entry>
<entry>
Total time the statement spent writing blocks, in milliseconds
- (if <xref linkend="guc-track-io-timing"> is enabled, otherwise zero)
+ (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero)
</entry>
</row>
free_space | 8932
free_percent | 1.95
</programlisting>
- The output columns are described in <xref linkend="pgstattuple-columns">.
+ The output columns are described in <xref linkend="pgstattuple-columns"/>.
</para>
<table id="pgstattuple-columns">
approx_free_space | 11996
approx_free_percent | 2.09
</programlisting>
- The output columns are described in <xref linkend="pgstatapprox-columns">.
+ The output columns are described in <xref linkend="pgstatapprox-columns"/>.
</para>
<para>
<para>
The functions provided by the <filename>pg_trgm</filename> module
- are shown in <xref linkend="pgtrgm-func-table">, the operators
- in <xref linkend="pgtrgm-op-table">.
+ are shown in <xref linkend="pgtrgm-func-table"/>, the operators
+ in <xref linkend="pgtrgm-op-table"/>.
</para>
<table id="pgtrgm-func-table">
<para>
This chapter builds on the material covered in <xref
- linkend="using-explain"> and <xref linkend="planner-stats"> to show some
+ linkend="using-explain"/> and <xref linkend="planner-stats"/> to show some
additional details about how the planner uses the
system statistics to estimate the number of rows each part of a query might
return. This is a significant part of the planning process,
</programlisting>
How the planner determines the cardinality of <structname>tenk1</structname>
- is covered in <xref linkend="planner-stats">, but is repeated here for
+ is covered in <xref linkend="planner-stats"/>, but is repeated here for
completeness. The number of pages and rows is looked up in
<structname>pg_class</structname>:
ANALYZE t;
</programlisting>
- As explained in <xref linkend="planner-stats">, the planner can determine
+ As explained in <xref linkend="planner-stats"/>, the planner can determine
cardinality of <structname>t</structname> using the number of pages and
rows obtained from <structname>pg_class</structname>:
special pseudo-type identifies the function as a call handler and
prevents it from being called directly in SQL commands.
For more details on C language calling conventions and dynamic loading,
- see <xref linkend="xfunc-c">.
+ see <xref linkend="xfunc-c"/>.
</para>
<para>
<para>
After having compiled the handler function into a loadable module
- (see <xref linkend="dfunc">), the following commands then
+ (see <xref linkend="dfunc"/>), the following commands then
register the sample procedural language:
<programlisting>
CREATE FUNCTION plsample_call_handler() RETURNS language_handler
are a <firstterm>validator</firstterm> and an
<firstterm>inline handler</firstterm>. A validator can be provided
to allow language-specific checking to be done during
- <xref linkend="sql-createfunction">.
+ <xref linkend="sql-createfunction"/>.
An inline handler can be provided to allow the language to support
- anonymous code blocks executed via the <xref linkend="sql-do"> command.
+ anonymous code blocks executed via the <xref linkend="sql-do"/> command.
</para>
<para>
<para>
Validator functions should typically honor the <xref
- linkend="guc-check-function-bodies"> parameter: if it is turned off then
+ linkend="guc-check-function-bodies"/> parameter: if it is turned off then
any expensive or context-sensitive checking should be skipped. If the
language provides for code execution at compilation time, the validator
must suppress checks that would induce such execution. In particular,
as well as the <command>CREATE LANGUAGE</command> command itself, into
an <firstterm>extension</firstterm> so that a simple <command>CREATE EXTENSION</command>
command is sufficient to install the language. See
- <xref linkend="extend-extensions"> for information about writing
+ <xref linkend="extend-extensions"/> for information about writing
extensions.
</para>
The procedural languages included in the standard distribution
are good references when trying to write your own language handler.
Look into the <filename>src/pl</filename> subdirectory of the source tree.
- The <xref linkend="sql-createlanguage">
+ The <xref linkend="sql-createlanguage"/>
reference page also has some useful details.
</para>
<para>
Users of source packages must specially enable the build of
PL/Perl during the installation process. (Refer to <xref
- linkend="installation"> for more information.) Users of
+ linkend="installation"/> for more information.) Users of
binary packages might find PL/Perl in a separate subpackage.
</para>
</note>
<para>
To create a function in the PL/Perl language, use the standard
- <xref linkend="sql-createfunction">
+ <xref linkend="sql-createfunction"/>
syntax:
<programlisting>
<para>
PL/Perl also supports anonymous code blocks called with the
- <xref linkend="sql-do"> statement:
+ <xref linkend="sql-do"/> statement:
<programlisting>
DO $$
The syntax of the <command>CREATE FUNCTION</command> command requires
the function body to be written as a string constant. It is usually
most convenient to use dollar quoting (see <xref
- linkend="sql-syntax-dollar-quoting">) for the string constant.
+ linkend="sql-syntax-dollar-quoting"/>) for the string constant.
If you choose to use escape string syntax <literal>E''</literal>,
you must double any single quote marks (<literal>'</literal>) and backslashes
(<literal>\</literal>) used in the body of the function
- (see <xref linkend="sql-syntax-strings">).
+ (see <xref linkend="sql-syntax-strings"/>).
</para>
<para>
priority levels.
Whether messages of a particular priority are reported to the client,
written to the server log, or both is controlled by the
- <xref linkend="guc-log-min-messages"> and
- <xref linkend="guc-client-min-messages"> configuration
- variables. See <xref linkend="runtime-config"> for more
+ <xref linkend="guc-log-min-messages"/> and
+ <xref linkend="guc-client-min-messages"/> configuration
+ variables. See <xref linkend="runtime-config"/> for more
information.
</para>
</listitem>
<listitem>
<para>
Returns the contents of the referenced array as a string in array literal format
- (see <xref linkend="arrays-input">).
+ (see <xref linkend="arrays-input"/>).
Returns the argument value unaltered if it's not a reference to an array.
The delimiter used between elements of the array literal defaults to "<literal>, </literal>"
if a delimiter is not specified or is undef.
<listitem>
<para>
Returns the contents of the referenced array as a string in array constructor format
- (see <xref linkend="sql-syntax-array-constructors">).
+ (see <xref linkend="sql-syntax-array-constructors"/>).
Individual values are quoted using <function>quote_nullable</function>.
Returns the argument value, quoted using <function>quote_nullable</function>,
if it's not a reference to an array.
</para>
<para>
Initialization will happen in the postmaster if the <literal>plperl</literal> library is
- included in <xref linkend="guc-shared-preload-libraries">, in which
+ included in <xref linkend="guc-shared-preload-libraries"/>, in which
case extra consideration should be given to the risk of destabilizing
the postmaster. The principal reason for making use of this feature
is that Perl modules loaded by <literal>plperl.on_init</literal> need be
It is also possible to declare a <application>PL/pgSQL</application>
function as returning <type>record</type>, which means that the result
is a row type whose columns are determined by specification in the
- calling query, as discussed in <xref linkend="queries-tablefunctions">.
+ calling query, as discussed in <xref linkend="queries-tablefunctions"/>.
</para>
<para>
<application>PL/pgSQL</application> functions can be declared to accept a variable
number of arguments by using the <literal>VARIADIC</literal> marker. This
works exactly the same way as for SQL functions, as discussed in
- <xref linkend="xfunc-sql-variadic-functions">.
+ <xref linkend="xfunc-sql-variadic-functions"/>.
</para>
<para>
<type>anyelement</type>, <type>anyarray</type>, <type>anynonarray</type>,
<type>anyenum</type>, and <type>anyrange</type>. The actual
data types handled by a polymorphic function can vary from call to
- call, as discussed in <xref linkend="extend-types-polymorphic">.
- An example is shown in <xref linkend="plpgsql-declaration-parameters">.
+ call, as discussed in <xref linkend="extend-types-polymorphic"/>.
+ An example is shown in <xref linkend="plpgsql-declaration-parameters"/>.
</para>
<para>
<para>
Specific examples appear in
- <xref linkend="plpgsql-declaration-parameters"> and
- <xref linkend="plpgsql-statements-returning">.
+ <xref linkend="plpgsql-declaration-parameters"/> and
+ <xref linkend="plpgsql-statements-returning"/>.
</para>
</sect2>
</sect1>
<para>
Functions written in <application>PL/pgSQL</application> are defined
- to the server by executing <xref linkend="sql-createfunction"> commands.
+ to the server by executing <xref linkend="sql-createfunction"/> commands.
Such a command would normally look like, say,
<programlisting>
CREATE FUNCTION somefunc(integer, text) RETURNS integer
</programlisting>
The function body is simply a string literal so far as <command>CREATE
FUNCTION</command> is concerned. It is often helpful to use dollar quoting
- (see <xref linkend="sql-syntax-dollar-quoting">) to write the function
+ (see <xref linkend="sql-syntax-dollar-quoting"/>) to write the function
body, rather than the normal single quote syntax. Without dollar quoting,
any single quotes or backslashes in the function body must be escaped by
doubling them. Almost all the examples in this chapter use dollar-quoted
of any <application>PL/pgSQL</application> function. This block provides the
declarations of the function's parameters (if any), as well as some
special variables such as <literal>FOUND</literal> (see
- <xref linkend="plpgsql-statements-diagnostics">). The outer block is
+ <xref linkend="plpgsql-statements-diagnostics"/>). The outer block is
labeled with the function's name, meaning that parameters and special
variables can be qualified with the function's name.
</para>
However, a block containing an <literal>EXCEPTION</literal> clause effectively
forms a subtransaction that can be rolled back without affecting the
outer transaction. For more about that see <xref
- linkend="plpgsql-error-trapping">.
+ linkend="plpgsql-error-trapping"/>.
</para>
</sect1>
assigned to after initialization, so that its value will remain constant
for the duration of the block.
The <literal>COLLATE</literal> option specifies a collation to use for the
- variable (see <xref linkend="plpgsql-declaration-collation">).
+ variable (see <xref linkend="plpgsql-declaration-collation"/>).
If <literal>NOT NULL</literal>
is specified, an assignment of a null value results in a run-time
error. All variables declared as <literal>NOT NULL</literal>
$$ LANGUAGE plpgsql;
</programlisting>
- As discussed in <xref linkend="xfunc-output-parameters">, this
+ As discussed in <xref linkend="xfunc-output-parameters"/>, this
effectively creates an anonymous record type for the function's
results. If a <literal>RETURNS</literal> clause is given, it must say
<literal>RETURNS record</literal>.
or <type>anyrange</type>), a special parameter <literal>$0</literal>
is created. Its data type is the actual return type of the function,
as deduced from the actual input types (see <xref
- linkend="extend-types-polymorphic">).
+ linkend="extend-types-polymorphic"/>).
This allows the function to access its actual return type
- as shown in <xref linkend="plpgsql-declaration-type">.
+ as shown in <xref linkend="plpgsql-declaration-type"/>.
<literal>$0</literal> is initialized to null and can be modified by
the function, so it can be used to hold the return value if desired,
though that is not required. <literal>$0</literal> can also be
When a <application>PL/pgSQL</application> function has one or more
parameters of collatable data types, a collation is identified for each
function call depending on the collations assigned to the actual
- arguments, as described in <xref linkend="collation">. If a collation is
+ arguments, as described in <xref linkend="collation"/>. If a collation is
successfully identified (i.e., there are no conflicts of implicit
collations among the arguments) then all the collatable parameters are
treated as having that collation implicitly. This will affect the
to the main SQL engine. While forming the <command>SELECT</command> command,
any occurrences of <application>PL/pgSQL</application> variable names
are replaced by parameters, as discussed in detail in
- <xref linkend="plpgsql-var-subst">.
+ <xref linkend="plpgsql-var-subst"/>.
This allows the query plan for the <command>SELECT</command> to
be prepared just once and then reused for subsequent
evaluations with different values of the variables. Thus, what
parameter values. Normally these details are
not important to a <application>PL/pgSQL</application> user, but
they are useful to know when trying to diagnose a problem.
- More information appears in <xref linkend="plpgsql-plan-caching">.
+ More information appears in <xref linkend="plpgsql-plan-caching"/>.
</para>
</sect1>
<application>PL/pgSQL</application>.
Anything not recognized as one of these statement types is presumed
to be an SQL command and is sent to the main database engine to execute,
- as described in <xref linkend="plpgsql-statements-sql-noresult">
- and <xref linkend="plpgsql-statements-sql-onerow">.
+ as described in <xref linkend="plpgsql-statements-sql-noresult"/>
+ and <xref linkend="plpgsql-statements-sql-onerow"/>.
</para>
<sect2 id="plpgsql-statements-assignment">
<para>
If the expression's result data type doesn't match the variable's
data type, the value will be coerced as though by an assignment cast
- (see <xref linkend="typeconv-query">). If no assignment cast is known
+ (see <xref linkend="typeconv-query"/>). If no assignment cast is known
for the pair of data types involved, the <application>PL/pgSQL</application>
interpreter will attempt to convert the result value textually, that is
by applying the result type's output function followed by the variable
in the command text is treated as a parameter, and then the
current value of the variable is provided as the parameter value
at run time. This is exactly like the processing described earlier
- for expressions; for details see <xref linkend="plpgsql-var-subst">.
+ for expressions; for details see <xref linkend="plpgsql-var-subst"/>.
</para>
<para>
When executing a SQL command in this way,
<application>PL/pgSQL</application> may cache and re-use the execution
plan for the command, as discussed in
- <xref linkend="plpgsql-plan-caching">.
+ <xref linkend="plpgsql-plan-caching"/>.
</para>
<para>
and the plan is cached in the same way. Also, the special variable
<literal>FOUND</literal> is set to true if the query produced at
least one row, or false if it produced no rows (see
- <xref linkend="plpgsql-statements-diagnostics">).
+ <xref linkend="plpgsql-statements-diagnostics"/>).
</para>
<note>
well-defined unless you've used <literal>ORDER BY</literal>.) Any result rows
after the first row are discarded.
You can check the special <literal>FOUND</literal> variable (see
- <xref linkend="plpgsql-statements-diagnostics">) to
+ <xref linkend="plpgsql-statements-diagnostics"/>) to
determine whether a row was returned:
<programlisting>
<para>
To handle cases where you need to process multiple result rows
- from a SQL query, see <xref linkend="plpgsql-records-iterating">.
+ from a SQL query, see <xref linkend="plpgsql-records-iterating"/>.
</para>
</sect2>
that will involve different tables or different data types each
time they are executed. <application>PL/pgSQL</application>'s
normal attempts to cache plans for commands (as discussed in
- <xref linkend="plpgsql-plan-caching">) will not work in such
+ <xref linkend="plpgsql-plan-caching"/>) will not work in such
scenarios. To handle this sort of problem, the
<command>EXECUTE</command> statement is provided:
<para>
The <application>PL/pgSQL</application>
<command>EXECUTE</command> statement is not related to the
- <xref linkend="sql-execute"> SQL
+ <xref linkend="sql-execute"/> SQL
statement supported by the
<productname>PostgreSQL</productname> server. The server's
<command>EXECUTE</command> statement cannot be used directly within
of single quotes. The recommended method for quoting fixed text in your
function body is dollar quoting. (If you have legacy code that does
not use dollar quoting, please refer to the
- overview in <xref linkend="plpgsql-quote-tips">, which can save you
+ overview in <xref linkend="plpgsql-quote-tips"/>, which can save you
some effort when translating said code to a more reasonable scheme.)
</para>
This example demonstrates the use of the
<function>quote_ident</function> and
<function>quote_literal</function> functions (see <xref
- linkend="functions-string">). For safety, expressions containing column
+ linkend="functions-string"/>). For safety, expressions containing column
or table identifiers should be passed through
<function>quote_ident</function> before insertion in a dynamic query.
Expressions containing values that should be literal strings in the
</programlisting>
(At present, <literal>IS NOT DISTINCT FROM</literal> is handled much less
efficiently than <literal>=</literal>, so don't do this unless you must.
- See <xref linkend="functions-comparison"> for
+ See <xref linkend="functions-comparison"/> for
more information on nulls and <literal>IS DISTINCT</literal>.)
</para>
<para>
Dynamic SQL statements can also be safely constructed using the
<function>format</function> function (see <xref
- linkend="functions-string">). For example:
+ linkend="functions-string"/>). For example:
<programlisting>
EXECUTE format('UPDATE tbl SET %I = %L '
'WHERE key = %L', colname, newvalue, keyvalue);
<para>
A much larger example of a dynamic command and
<command>EXECUTE</command> can be seen in <xref
- linkend="plpgsql-porting-ex2">, which builds and executes a
+ linkend="plpgsql-porting-ex2"/>, which builds and executes a
<command>CREATE FUNCTION</command> command to define a new function.
</para>
</sect2>
This command allows retrieval of system status indicators.
<literal>CURRENT</literal> is a noise word (but see also <command>GET STACKED
- DIAGNOSTICS</command> in <xref linkend="plpgsql-exception-diagnostics">).
+ DIAGNOSTICS</command> in <xref linkend="plpgsql-exception-diagnostics"/>).
Each <replaceable>item</replaceable> is a key word identifying a status
value to be assigned to the specified <replaceable>variable</replaceable>
(which should be of the right data type to receive it). The currently
available status items are shown
- in <xref linkend="plpgsql-current-diagnostics-values">. Colon-equal
+ in <xref linkend="plpgsql-current-diagnostics-values"/>. Colon-equal
(<literal>:=</literal>) can be used instead of the SQL-standard <literal>=</literal>
token. An example:
<programlisting>
<entry><literal>PG_CONTEXT</literal></entry>
<entry><type>text</type></entry>
<entry>line(s) of text describing the current call stack
- (see <xref linkend="plpgsql-call-stack">)</entry>
+ (see <xref linkend="plpgsql-call-stack"/>)</entry>
</row>
</tbody>
</tgroup>
allow users to define set-returning functions
that do not have this limitation. Currently, the point at
which data begins being written to disk is controlled by the
- <xref linkend="guc-work-mem">
+ <xref linkend="guc-work-mem"/>
configuration variable. Administrators who have sufficient
memory to store larger result sets in memory should consider
increasing this parameter.
<para>
<application>PL/pgSQL</application> variables are substituted into the query text,
and the query plan is cached for possible re-use, as discussed in
- detail in <xref linkend="plpgsql-var-subst"> and
- <xref linkend="plpgsql-plan-caching">.
+ detail in <xref linkend="plpgsql-var-subst"/> and
+ <xref linkend="plpgsql-plan-caching"/>.
</para>
<para>
<para>
Another way to specify the query whose results should be iterated
through is to declare it as a cursor. This is described in
- <xref linkend="plpgsql-cursor-for-loop">.
+ <xref linkend="plpgsql-cursor-for-loop"/>.
</para>
</sect2>
<para>
The <replaceable>condition</replaceable> names can be any of
- those shown in <xref linkend="errcodes-appendix">. A category
+ those shown in <xref linkend="errcodes-appendix"/>. A category
name matches any error within its category. The special
condition name <literal>OTHERS</literal> matches every error type except
<literal>QUERY_CANCELED</literal> and <literal>ASSERT_FAILURE</literal>.
<para>
Within an exception handler, the special variable
<varname>SQLSTATE</varname> contains the error code that corresponds to
- the exception that was raised (refer to <xref linkend="errcodes-table">
+ the exception that was raised (refer to <xref linkend="errcodes-table"/>
for a list of possible error codes). The special variable
<varname>SQLERRM</varname> contains the error message associated with the
exception. These variables are undefined outside exception handlers.
value to be assigned to the specified <replaceable>variable</replaceable>
(which should be of the right data type to receive it). The currently
available status items are shown
- in <xref linkend="plpgsql-exception-diagnostics-values">.
+ in <xref linkend="plpgsql-exception-diagnostics-values"/>.
</para>
<table id="plpgsql-exception-diagnostics-values">
<entry><literal>PG_EXCEPTION_CONTEXT</literal></entry>
<entry><type>text</type></entry>
<entry>line(s) of text describing the call stack at the time of the
- exception (see <xref linkend="plpgsql-call-stack">)</entry>
+ exception (see <xref linkend="plpgsql-call-stack"/>)</entry>
</row>
</tbody>
</tgroup>
<para>
The <command>GET DIAGNOSTICS</command> command, previously described
- in <xref linkend="plpgsql-statements-diagnostics">, retrieves information
+ in <xref linkend="plpgsql-statements-diagnostics"/>, retrieves information
about current execution state (whereas the <command>GET STACKED
DIAGNOSTICS</command> command discussed above reports information about
the execution state as of a previous error). Its <literal>PG_CONTEXT</literal>
<para>
Bound cursor variables can also be used without explicitly opening the cursor,
via the <command>FOR</command> statement described in
- <xref linkend="plpgsql-cursor-for-loop">.
+ <xref linkend="plpgsql-cursor-for-loop"/>.
</para>
</note>
<type>refcursor</type> variable). The query is specified as a string
expression, in the same way as in the <command>EXECUTE</command>
command. As usual, this gives flexibility so the query plan can vary
- from one run to the next (see <xref linkend="plpgsql-plan-caching">),
+ from one run to the next (see <xref linkend="plpgsql-plan-caching"/>),
and it also means that variable substitution is not done on the
command string. As with <command>EXECUTE</command>, parameter values
can be inserted into the dynamic command via
notation, all arguments are specified in order. In named notation,
each argument's name is specified using <literal>:=</literal> to
separate it from the argument expression. Similar to calling
- functions, described in <xref linkend="sql-syntax-calling-funcs">, it
+ functions, described in <xref linkend="sql-syntax-calling-funcs"/>, it
is also allowed to mix positional and named notation.
</para>
<para>
The <replaceable>direction</replaceable> clause can be any of the
- variants allowed in the SQL <xref linkend="sql-fetch">
+ variants allowed in the SQL <xref linkend="sql-fetch"/>
command except the ones that can fetch
more than one row; namely, it can be
<literal>NEXT</literal>,
<para>
The <replaceable>direction</replaceable> clause can be any of the
- variants allowed in the SQL <xref linkend="sql-fetch">
+ variants allowed in the SQL <xref linkend="sql-fetch"/>
command, namely
<literal>NEXT</literal>,
<literal>PRIOR</literal>,
restrictions on what the cursor's query can be (in particular,
no grouping) and it's best to use <literal>FOR UPDATE</literal> in the
cursor. For more information see the
- <xref linkend="sql-declare">
+ <xref linkend="sql-declare"/>
reference page.
</para>
expressions must appear if and only if the cursor was declared to take
arguments. These values will be substituted in the query, in just
the same way as during an <command>OPEN</command> (see <xref
- linkend="plpgsql-open-bound-cursor">).
+ linkend="plpgsql-open-bound-cursor"/>).
</para>
<para>
priority levels.
Whether messages of a particular priority are reported to the client,
written to the server log, or both is controlled by the
- <xref linkend="guc-log-min-messages"> and
- <xref linkend="guc-client-min-messages"> configuration
- variables. See <xref linkend="runtime-config"> for more
+ <xref linkend="guc-log-min-messages"/> and
+ <xref linkend="guc-client-min-messages"/> configuration
+ variables. See <xref linkend="runtime-config"/> for more
information.
</para>
<term><literal>ERRCODE</literal></term>
<listitem>
<para>Specifies the error code (SQLSTATE) to report, either by condition
- name, as shown in <xref linkend="errcodes-appendix">, or directly as a
+ name, as shown in <xref linkend="errcodes-appendix"/>, or directly as a
five-character SQLSTATE code.</para>
</listitem>
</varlistentry>
</para>
<para>
- <xref linkend="plpgsql-trigger-example"> shows an example of a
+ <xref linkend="plpgsql-trigger-example"/> shows an example of a
trigger procedure in <application>PL/pgSQL</application>.
</para>
Another way to log changes to a table involves creating a new table that
holds a row for each insert, update, or delete that occurs. This approach
can be thought of as auditing changes to a table.
- <xref linkend="plpgsql-trigger-audit-example"> shows an example of an
+ <xref linkend="plpgsql-trigger-audit-example"/> shows an example of an
audit trigger procedure in <application>PL/pgSQL</application>.
</para>
approach still records the full audit trail of changes to the table,
but also presents a simplified view of the audit trail, showing just
the last modified timestamp derived from the audit trail for each entry.
- <xref linkend="plpgsql-view-trigger-audit-example"> shows an example
+ <xref linkend="plpgsql-view-trigger-audit-example"/> shows an example
of an audit trigger on a view in <application>PL/pgSQL</application>.
</para>
times.
This technique is commonly used in Data Warehousing, where the tables
of measured or observed data (called fact tables) might be extremely large.
- <xref linkend="plpgsql-trigger-summary-example"> shows an example of a
+ <xref linkend="plpgsql-trigger-summary-example"/> shows an example of a
trigger procedure in <application>PL/pgSQL</application> that maintains
a summary table for a fact table in a data warehouse.
</para>
statement. The <command>CREATE TRIGGER</command> command assigns names to one
or both transition tables, and then the function can refer to those names
as though they were read-only temporary tables.
- <xref linkend="plpgsql-trigger-audit-transition-example"> shows an example.
+ <xref linkend="plpgsql-trigger-audit-transition-example"/> shows an example.
</para>
<example id="plpgsql-trigger-audit-transition-example">
<para>
This example produces the same results as
- <xref linkend="plpgsql-trigger-audit-example">, but instead of using a
+ <xref linkend="plpgsql-trigger-audit-example"/>, but instead of using a
trigger that fires for every row, it uses a trigger that fires once
per statement, after collecting the relevant information in a transition
table. This can be significantly faster than the row-trigger approach
</para>
<para>
- <xref linkend="plpgsql-event-trigger-example"> shows an example of an
+ <xref linkend="plpgsql-event-trigger-example"/> shows an example of an
event trigger procedure in <application>PL/pgSQL</application>.
</para>
In the above example, <literal>src.foo</literal> would be an unambiguous reference
to the table column. To create an unambiguous reference to a variable,
declare it in a labeled block and use the block's label
- (see <xref linkend="plpgsql-structure">). For example,
+ (see <xref linkend="plpgsql-structure"/>). For example,
<programlisting>
<<block>>
DECLARE
to <command>EXECUTE</command> or one of its variants. If you need to
insert a varying value into such a command, do so as part of
constructing the string value, or use <literal>USING</literal>, as illustrated in
- <xref linkend="plpgsql-statements-executing-dyn">.
+ <xref linkend="plpgsql-statements-executing-dyn"/>.
</para>
<para>
this will happen only if the execution plan is not very sensitive to
the values of the <application>PL/pgSQL</application> variables referenced in it.
If it is, generating a plan each time is a net win. See <xref
- linkend="sql-prepare"> for more information about the behavior of
+ linkend="sql-prepare"/> for more information about the behavior of
prepared statements.
</para>
easily find yourself needing half a dozen or more adjacent quote marks.
It's recommended that you instead write the function body as a
<quote>dollar-quoted</quote> string literal (see <xref
- linkend="sql-syntax-dollar-quoting">). In the dollar-quoting
+ linkend="sql-syntax-dollar-quoting"/>). In the dollar-quoting
approach, you never double any quote marks, but instead take care to
choose a different dollar-quoting delimiter for each level of
nesting you need. For example, you might write the <command>CREATE
accounts for 8 quotation marks) and this is adjacent to the end of that
string constant (2 more). You will probably only need that if
you are writing a function that generates other functions, as in
- <xref linkend="plpgsql-porting-ex2">.
+ <xref linkend="plpgsql-porting-ex2"/>.
For example:
<programlisting>
a_output := a_output || '' if v_'' ||
to <application>PL/pgSQL</application>'s
<literal>plpgsql.variable_conflict</literal> = <literal>use_column</literal>
behavior, which is not the default,
- as explained in <xref linkend="plpgsql-var-subst">.
+ as explained in <xref linkend="plpgsql-var-subst"/>.
It's often best to avoid such ambiguities in the first place,
but if you have to port a large amount of code that depends on
this behavior, setting <literal>variable_conflict</literal> may be the
In <productname>PostgreSQL</productname> the function body must be written as
a string literal. Therefore you need to use dollar quoting or escape
single quotes in the function body. (See <xref
- linkend="plpgsql-quote-tips">.)
+ linkend="plpgsql-quote-tips"/>.)
</para>
</listitem>
from the first number to the second, requiring the loop bounds
to be swapped when porting. This incompatibility is unfortunate
but is unlikely to be changed. (See <xref
- linkend="plpgsql-integer-for">.)
+ linkend="plpgsql-integer-for"/>.)
</para>
</listitem>
<title>Porting Examples</title>
<para>
- <xref linkend="pgsql-porting-ex1"> shows how to port a simple
+ <xref linkend="pgsql-porting-ex1"/> shows how to port a simple
function from <application>PL/SQL</application> to <application>PL/pgSQL</application>.
</para>
</example>
<para>
- <xref linkend="plpgsql-porting-ex2"> shows how to port a
+ <xref linkend="plpgsql-porting-ex2"/> shows how to port a
function that creates another function and how to handle the
ensuing quoting problems.
</para>
</example>
<para>
- <xref linkend="plpgsql-porting-ex3"> shows how to port a function
+ <xref linkend="plpgsql-porting-ex3"/> shows how to port a function
with <literal>OUT</literal> parameters and string manipulation.
<productname>PostgreSQL</productname> does not have a built-in
<function>instr</function> function, but you can create one
using a combination of other
- functions. In <xref linkend="plpgsql-porting-appendix"> there is a
+ functions. In <xref linkend="plpgsql-porting-appendix"/> there is a
<application>PL/pgSQL</application> implementation of
<function>instr</function> that you can use to make your porting
easier.
</example>
<para>
- <xref linkend="plpgsql-porting-ex4"> shows how to port a procedure
+ <xref linkend="plpgsql-porting-ex4"/> shows how to port a procedure
that uses numerous features that are specific to Oracle.
</para>
<programlisting>
CREATE OR REPLACE PROCEDURE cs_create_job(v_job_id IN INTEGER) IS
a_running_job_count INTEGER;
- PRAGMA AUTONOMOUS_TRANSACTION; -- <co id="co.plpgsql-porting-pragma">
+ PRAGMA AUTONOMOUS_TRANSACTION; -- <co id="co.plpgsql-porting-pragma"/>
BEGIN
- LOCK TABLE cs_jobs IN EXCLUSIVE MODE; -- <co id="co.plpgsql-porting-locktable">
+ LOCK TABLE cs_jobs IN EXCLUSIVE MODE; -- <co id="co.plpgsql-porting-locktable"/>
SELECT count(*) INTO a_running_job_count FROM cs_jobs WHERE end_stamp IS NULL;
IF a_running_job_count > 0 THEN
- COMMIT; -- free lock <co id="co.plpgsql-porting-commit">
+ COMMIT; -- free lock <co id="co.plpgsql-porting-commit"/>
raise_application_error(-20000,
'Unable to create a new job: a job is currently running.');
END IF;
SELECT count(*) INTO a_running_job_count FROM cs_jobs WHERE end_stamp IS NULL;
IF a_running_job_count > 0 THEN
- RAISE EXCEPTION 'Unable to create a new job: a job is currently running'; -- <co id="co.plpgsql-porting-raise">
+ RAISE EXCEPTION 'Unable to create a new job: a job is currently running'; -- <co id="co.plpgsql-porting-raise"/>
END IF;
DELETE FROM cs_active_job;
BEGIN
INSERT INTO cs_jobs (job_id, start_stamp) VALUES (v_job_id, now());
EXCEPTION
- WHEN unique_violation THEN -- <co id="co.plpgsql-porting-exception">
+ WHEN unique_violation THEN -- <co id="co.plpgsql-porting-exception"/>
-- don't worry if it already exists
END;
END;
<para>
The exception names supported by <application>PL/pgSQL</application> are
different from Oracle's. The set of built-in exception names
- is much larger (see <xref linkend="errcodes-appendix">). There
+ is much larger (see <xref linkend="errcodes-appendix"/>). There
is not currently a way to declare user-defined exception names,
although you can throw user-chosen SQLSTATE values instead.
</para>
<application>PL/SQL</application> version, but you have to remember to use
<function>quote_literal</function> and
<function>quote_ident</function> as described in <xref
- linkend="plpgsql-statements-executing-dyn">. Constructs of the
+ linkend="plpgsql-statements-executing-dyn"/>. Constructs of the
type <literal>EXECUTE 'SELECT * FROM $1';</literal> will not work
reliably unless you use these functions.
</para>
the function always returns the same result when given the same
arguments) and <quote>strictness</quote> (whether the function
returns null if any argument is null). Consult the <xref
- linkend="sql-createfunction">
+ linkend="sql-createfunction"/>
reference page for details.
</para>
<para>
To install PL/Python in a particular database, use
<literal>CREATE EXTENSION plpythonu</literal> (but
- see also <xref linkend="plpython-python23">).
+ see also <xref linkend="plpython-python23"/>).
</para>
<tip>
The built variant depends on which Python version was found during
the installation or which version was explicitly set using
the <envar>PYTHON</envar> environment variable;
- see <xref linkend="install-procedure">. To make both variants of
+ see <xref linkend="install-procedure"/>. To make both variants of
PL/Python available in one installation, the source tree has to be
configured and built twice.
</para>
<para>
Functions in PL/Python are declared via the
- standard <xref linkend="sql-createfunction"> syntax:
+ standard <xref linkend="sql-createfunction"/> syntax:
<programlisting>
CREATE FUNCTION <replaceable>funcname</replaceable> (<replaceable>argument-list</replaceable>)
sortas="PL/Python">in PL/Python</secondary></indexterm> is passed to a
function, the argument value will appear as <symbol>None</symbol> in
Python. For example, the function definition of <function>pymax</function>
- shown in <xref linkend="plpython-funcs"> will return the wrong answer for null
+ shown in <xref linkend="plpython-funcs"/> will return the wrong answer for null
inputs. We could add <literal>STRICT</literal> to the function definition
to make <productname>PostgreSQL</productname> do something more reasonable:
if a null value is passed, the function will not be called at all,
<para>
PL/Python also supports anonymous code blocks called with the
- <xref linkend="sql-do"> statement:
+ <xref linkend="sql-do"/> statement:
<programlisting>
DO $$
<para>
Query parameters and result row fields are converted between PostgreSQL
- and Python data types as described in <xref linkend="plpython-data">.
+ and Python data types as described in <xref linkend="plpython-data"/>.
</para>
<para>
When you prepare a plan using the PL/Python module it is automatically
- saved. Read the SPI documentation (<xref linkend="spi">) for a
+ saved. Read the SPI documentation (<xref linkend="spi"/>) for a
description of what this means. In order to make effective use of this
across function calls one needs to use one of the persistent storage
dictionaries <literal>SD</literal> or <literal>GD</literal> (see
- <xref linkend="plpython-sharing">). For example:
+ <xref linkend="plpython-sharing"/>). For example:
<programlisting>
CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
if "plan" in SD:
<para>
The actual class of the exception being raised corresponds to the
specific condition that caused the error. Refer
- to <xref linkend="errcodes-table"> for a list of possible
+ to <xref linkend="errcodes-table"/> for a list of possible
conditions. The module
<literal>plpy.spiexceptions</literal> defines an exception class
for each <productname>PostgreSQL</productname> condition, deriving
<para>
Recovering from errors caused by database access as described in
- <xref linkend="plpython-trapping"> can lead to an undesirable
+ <xref linkend="plpython-trapping"/> can lead to an undesirable
situation where some operations succeed before one of them fails,
and after recovering from that error the data is left in an
inconsistent state. PL/Python offers a solution to this problem in
The other functions only generate messages of different priority levels.
Whether messages of a particular priority are reported to the client,
written to the server log, or both is controlled by the
- <xref linkend="guc-log-min-messages"> and
- <xref linkend="guc-client-min-messages"> configuration
- variables. See <xref linkend="runtime-config"> for more information.
+ <xref linkend="guc-log-min-messages"/> and
+ <xref linkend="guc-client-min-messages"/> configuration
+ variables. See <xref linkend="runtime-config"/> for more information.
</para>
<para>
<literal>plpy.quote_nullable(<replaceable>string</replaceable>)</literal>, and
<literal>plpy.quote_ident(<replaceable>string</replaceable>)</literal>. They
are equivalent to the built-in quoting functions described in <xref
- linkend="functions-string">. They are useful when constructing
+ linkend="functions-string"/>. They are useful when constructing
ad-hoc queries. A PL/Python equivalent of dynamic SQL from <xref
- linkend="plpgsql-quote-literal-example"> would be:
+ linkend="plpgsql-quote-literal-example"/> would be:
<programlisting>
plpy.execute("UPDATE tbl SET %s = %s WHERE key = %s" % (
plpy.quote_ident(colname),
<para>
To create a function in the <application>PL/Tcl</application> language, use
- the standard <xref linkend="sql-createfunction"> syntax:
+ the standard <xref linkend="sql-createfunction"/> syntax:
<programlisting>
CREATE FUNCTION <replaceable>funcname</replaceable> (<replaceable>argument-types</replaceable>) RETURNS <replaceable>return-type</replaceable> AS $$
executed within a SQL subtransaction. If the script returns an
error, that entire subtransaction is rolled back before returning the
error out to the surrounding Tcl code.
- See <xref linkend="pltcl-subtransactions"> for more details and an
+ See <xref linkend="pltcl-subtransactions"/> for more details and an
example.
</para>
</listitem>
priority levels.
Whether messages of a particular priority are reported to the client,
written to the server log, or both is controlled by the
- <xref linkend="guc-log-min-messages"> and
- <xref linkend="guc-client-min-messages"> configuration
- variables. See <xref linkend="runtime-config">
- and <xref linkend="pltcl-error-handling">
+ <xref linkend="guc-log-min-messages"/> and
+ <xref linkend="guc-client-min-messages"/> configuration
+ variables. See <xref linkend="runtime-config"/>
+ and <xref linkend="pltcl-error-handling"/>
for more information.
</para>
</listitem>
Fields <varname>SQLSTATE</varname>, <varname>condition</varname>,
and <varname>message</varname> are always supplied
(the first two represent the error code and condition name as shown
- in <xref linkend="errcodes-appendix">).
+ in <xref linkend="errcodes-appendix"/>).
Fields that may be present include
<varname>detail</varname>, <varname>hint</varname>, <varname>context</varname>,
<varname>schema</varname>, <varname>table</varname>, <varname>column</varname>,
<para>
Recovering from errors caused by database access as described in
- <xref linkend="pltcl-error-handling"> can lead to an undesirable
+ <xref linkend="pltcl-error-handling"/> can lead to an undesirable
situation where some operations succeed before one of them fails,
and after recovering from that error the data is left in an
inconsistent state. PL/Tcl offers a solution to this problem in
<para>
The functionality provided by this module overlaps substantially
- with the functionality of the older <xref linkend="dblink"> module.
+ with the functionality of the older <xref linkend="dblink"/> module.
But <filename>postgres_fdw</filename> provides more transparent and
standards-compliant syntax for accessing remote tables, and can give
better performance in many cases.
<listitem>
<para>
Install the <filename>postgres_fdw</filename> extension using <xref
- linkend="sql-createextension">.
+ linkend="sql-createextension"/>.
</para>
</listitem>
<listitem>
<para>
- Create a foreign server object, using <xref linkend="sql-createserver">,
+ Create a foreign server object, using <xref linkend="sql-createserver"/>,
to represent each remote database you want to connect to.
Specify connection information, except <literal>user</literal> and
<literal>password</literal>, as options of the server object.
</listitem>
<listitem>
<para>
- Create a user mapping, using <xref linkend="sql-createusermapping">, for
+ Create a user mapping, using <xref linkend="sql-createusermapping"/>, for
each database user you want to allow to access each foreign server.
Specify the remote user name and password to use as
<literal>user</literal> and <literal>password</literal> options of the
</listitem>
<listitem>
<para>
- Create a foreign table, using <xref linkend="sql-createforeigntable">
- or <xref linkend="sql-importforeignschema">,
+ Create a foreign table, using <xref linkend="sql-createforeigntable"/>
+ or <xref linkend="sql-importforeignschema"/>,
for each remote table you want to access. The columns of the foreign
table must match the referenced remote table. You can, however, use
table and/or column names different from the remote table's, if you
<para>
A foreign server using the <filename>postgres_fdw</filename> foreign data wrapper
can have the same options that <application>libpq</application> accepts in
- connection strings, as described in <xref linkend="libpq-paramkeywords">,
+ connection strings, as described in <xref linkend="libpq-paramkeywords"/>,
except that these options are not allowed:
<itemizedlist spacing="compact">
<literal>fdw_tuple_cost</literal> to the cost estimates. This local
estimation is unlikely to be very accurate unless local copies of the
remote table's statistics are available. Running
- <xref linkend="sql-analyze"> on the foreign table is the way to update
+ <xref linkend="sql-analyze"/> on the foreign table is the way to update
the local statistics; this will perform a scan of the remote table and
then calculate and store statistics just as though the table were local.
Keeping local statistics can be a useful way to reduce per-query planning
<para>
<filename>postgres_fdw</filename> is able to import foreign table definitions
- using <xref linkend="sql-importforeignschema">. This command creates
+ using <xref linkend="sql-importforeignschema"/>. This command creates
foreign table definitions on the local server that match tables or
views present on the remote server. If the remote tables to be imported
have columns of user-defined data types, the local server must have
So if you wish to import <literal>CHECK</literal> constraints, you must do so
manually, and you should verify the semantics of each one carefully.
For more detail about the treatment of <literal>CHECK</literal> constraints on
- foreign tables, see <xref linkend="sql-createforeigntable">.
+ foreign tables, see <xref linkend="sql-createforeigntable"/>.
</para>
<para>
<para>
In the remote sessions opened by <filename>postgres_fdw</filename>,
- the <xref linkend="guc-search-path"> parameter is set to
+ the <xref linkend="guc-search-path"/> parameter is set to
just <literal>pg_catalog</literal>, so that only built-in objects are visible
without schema qualification. This is not an issue for queries
generated by <filename>postgres_fdw</filename> itself, because it always
any functions used in that view will be executed with the restricted
search path. It is recommended to schema-qualify all names in such
functions, or else attach <literal>SET search_path</literal> options
- (see <xref linkend="sql-createfunction">) to such functions
+ (see <xref linkend="sql-createfunction"/>) to such functions
to establish their expected search path environment.
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
- <xref linkend="guc-timezone"> is set to <literal>UTC</literal>
+ <xref linkend="guc-timezone"/> is set to <literal>UTC</literal>
</para>
</listitem>
<listitem>
<para>
- <xref linkend="guc-datestyle"> is set to <literal>ISO</literal>
+ <xref linkend="guc-datestyle"/> is set to <literal>ISO</literal>
</para>
</listitem>
<listitem>
<para>
- <xref linkend="guc-intervalstyle"> is set to <literal>postgres</literal>
+ <xref linkend="guc-intervalstyle"/> is set to <literal>postgres</literal>
</para>
</listitem>
<listitem>
<para>
- <xref linkend="guc-extra-float-digits"> is set to <literal>3</literal> for remote
+ <xref linkend="guc-extra-float-digits"/> is set to <literal>3</literal> for remote
servers 9.0 and newer and is set to <literal>2</literal> for older versions
</para>
</listitem>
</programlisting>
<para>
- Then create a foreign server using <xref linkend="sql-createserver">.
+ Then create a foreign server using <xref linkend="sql-createserver"/>.
In this example we wish to connect to a <productname>PostgreSQL</productname> server
on host <literal>192.83.123.89</literal> listening on
port <literal>5432</literal>. The database to which the connection is made
</para>
<para>
- A user mapping, defined with <xref linkend="sql-createusermapping">, is
+ A user mapping, defined with <xref linkend="sql-createusermapping"/>, is
needed as well to identify the role that will be used on the remote
server:
<para>
Now it is possible to create a foreign table with
- <xref linkend="sql-createforeigntable">. In this example we
+ <xref linkend="sql-createforeigntable"/>. In this example we
wish to access the table named <structname>some_schema.some_table</structname>
on the remote server. The local name for it will
be <structname>foreign_table</structname>:
Column names must match as well, unless you attach <literal>column_name</literal>
options to the individual columns to show how they are named in the remote
table.
- In many cases, use of <xref linkend="sql-importforeignschema"> is
+ In many cases, use of <xref linkend="sql-importforeignschema"/> is
preferable to constructing foreign table definitions manually.
</para>
</sect2>
<!-- doc/src/sgml/postgres.sgml -->
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[
<!ENTITY % version SYSTEM "version.sgml">
%version;
<para>
After you have worked through this tutorial you might want to move
- on to reading <xref linkend="sql"> to gain a more formal knowledge
- of the SQL language, or <xref linkend="client-interfaces"> for
+ on to reading <xref linkend="sql"/> to gain a more formal knowledge
+ of the SQL language, or <xref linkend="client-interfaces"/> for
information about developing applications for
<productname>PostgreSQL</productname>. Those who set up and
- manage their own server should also read <xref linkend="admin">.
+ manage their own server should also read <xref linkend="admin"/>.
</para>
</partintro>
chapters individually as they choose. The information in this
part is presented in a narrative fashion in topical units.
Readers looking for a complete description of a particular command
- should see <xref linkend="reference">.
+ should see <xref linkend="reference"/>.
</para>
<para>
Readers of this part should know how to connect to a
<productname>PostgreSQL</productname> database and issue
<acronym>SQL</acronym> commands. Readers that are unfamiliar with
- these issues are encouraged to read <xref linkend="tutorial">
+ these issues are encouraged to read <xref linkend="tutorial"/>
first. <acronym>SQL</acronym> commands are typically entered
using the <productname>PostgreSQL</productname> interactive terminal
<application>psql</application>, but other programs that have
self-contained and can be read individually as desired. The
information in this part is presented in a narrative fashion in
topical units. Readers looking for a complete description of a
- particular command should see <xref linkend="reference">.
+ particular command should see <xref linkend="reference"/>.
</para>
<para>
The rest of this part is about tuning and management; that material
assumes that the reader is familiar with the general use of
the <productname>PostgreSQL</productname> database system. Readers are
- encouraged to look at <xref linkend="tutorial"> and <xref
- linkend="sql"> for additional information.
+ encouraged to look at <xref linkend="tutorial"/> and <xref
+ linkend="sql"/> for additional information.
</para>
</partintro>
with <productname>PostgreSQL</productname>. Each of these chapters can be
read independently. Note that there are many other programming
interfaces for client programs that are distributed separately and
- contain their own documentation (<xref linkend="external-projects">
+ contain their own documentation (<xref linkend="external-projects"/>
lists some of the more popular ones). Readers of this part should be
familiar with using <acronym>SQL</acronym> commands to manipulate
- and query the database (see <xref linkend="sql">) and of course
+ and query the database (see <xref linkend="sql"/>) and of course
with the programming language that the interface uses.
</para>
</partintro>
<productname>PostgreSQL</productname> distribution as well as
general issues concerning server-side programming languages. It
is essential to read at least the earlier sections of <xref
- linkend="extend"> (covering functions) before diving into the
+ linkend="extend"/> (covering functions) before diving into the
material about server-side programming languages.
</para>
</partintro>
form of the message. In <application>psql</application>, say <literal>\set
VERBOSITY verbose</literal> beforehand. If you are extracting the message
from the server log, set the run-time parameter
- <xref linkend="guc-log-error-verbosity"> to <literal>verbose</literal> so that all
+ <xref linkend="guc-log-error-verbosity"/> to <literal>verbose</literal> so that all
details are logged.
</para>
</note>
<para>
This section describes the message flow and the semantics of each
message type. (Details of the exact representation of each message
- appear in <xref linkend="protocol-message-formats">.) There are
+ appear in <xref linkend="protocol-message-formats"/>.) There are
several different sub-protocols depending on the state of the
connection: start-up, query, function call,
<command>COPY</command>, and termination. There are also special
SASLInitialResponse with the name of the selected mechanism, and the
first part of the SASL data stream in response to this. If further
messages are needed, the server will respond with
- AuthenticationSASLContinue. See <xref linkend="sasl-authentication">
+ AuthenticationSASLContinue. See <xref linkend="sasl-authentication"/>
for details.
</para>
</listitem>
<para>
This message informs the frontend about the current (initial)
setting of backend parameters, such as <xref
- linkend="guc-client-encoding"> or <xref linkend="guc-datestyle">.
+ linkend="guc-client-encoding"/> or <xref linkend="guc-datestyle"/>.
The frontend can ignore this message, or record the settings
- for its future use; see <xref linkend="protocol-async"> for
+ for its future use; see <xref linkend="protocol-async"/> for
more details. The frontend should not respond to this
message, but should continue listening for a ReadyForQuery
message.
<listitem>
<para>
The backend is ready to copy data from the frontend to a
- table; see <xref linkend="protocol-copy">.
+ table; see <xref linkend="protocol-copy"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The backend is ready to copy data from a table to the
- frontend; see <xref linkend="protocol-copy">.
+ frontend; see <xref linkend="protocol-copy"/>.
</para>
</listitem>
</varlistentry>
normally consists of RowDescription, zero or more
DataRow messages, and then CommandComplete.
<command>COPY</command> to or from the frontend invokes special protocol
- as described in <xref linkend="protocol-copy">.
+ as described in <xref linkend="protocol-copy"/>.
All other query types normally produce only
a CommandComplete message.
</para>
<para>
A frontend must be prepared to accept ErrorResponse and
NoticeResponse messages whenever it is expecting any other type of
- message. See also <xref linkend="protocol-async"> concerning messages
+ message. See also <xref linkend="protocol-async"/> concerning messages
that the backend might generate due to outside events.
</para>
It is possible for NoticeResponse and ParameterStatus messages to be
interspersed between CopyData messages; frontends must handle these cases,
and should be prepared for other asynchronous message types as well (see
- <xref linkend="protocol-async">). Otherwise, any message type other than
+ <xref linkend="protocol-async"/>). Otherwise, any message type other than
CopyData or CopyDone may be treated as terminating copy-out mode.
</para>
until a Sync message is received, and then issue ReadyForQuery and return
to normal processing. The frontend should treat receipt of ErrorResponse
as terminating the copy in both directions; no CopyDone should be sent
- in this case. See <xref linkend="protocol-replication"> for more
+ in this case. See <xref linkend="protocol-replication"/> for more
information on the subprotocol transmitted over copy-both mode.
</para>
communication security in environments where attackers might be
able to capture the session traffic. For more information on
encrypting <productname>PostgreSQL</productname> sessions with
- <acronym>SSL</acronym>, see <xref linkend="ssl-tcp">.
+ <acronym>SSL</acronym>, see <xref linkend="ssl-tcp"/>.
</para>
<para>
small set of replication commands can be issued instead of SQL statements. Only
the simple query protocol can be used in walsender mode.
Replication commands are logged in the server log when
-<xref linkend="guc-log-replication-commands"> is enabled.
+<xref linkend="guc-log-replication-commands"/> is enabled.
Passing <literal>database</literal> as the value instructs walsender to connect to
the database specified in the <literal>dbname</literal> parameter, which will allow
the connection to be used for logical replication from that database.
psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
</programlisting>
However, it is often more useful to use
- <xref linkend="app-pgreceivewal"> (for physical replication) or
- <xref linkend="app-pgrecvlogical"> (for logical replication).
+ <xref linkend="app-pgreceivewal"/> (for physical replication) or
+ <xref linkend="app-pgrecvlogical"/> (for logical replication).
</para>
<para>
<listitem>
<para>
Requests the server to send the current setting of a run-time parameter.
- This is similar to the SQL command <xref linkend="sql-show">.
+ This is similar to the SQL command <xref linkend="sql-show"/>.
</para>
<variablelist>
<listitem>
<para>
The name of a run-time parameter. Available parameters are documented
- in <xref linkend="runtime-config">.
+ in <xref linkend="runtime-config"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Create a physical or logical replication
- slot. See <xref linkend="streaming-replication-slots"> for more about
+ slot. See <xref linkend="streaming-replication-slots"/> for more about
replication slots.
</para>
<variablelist>
<listitem>
<para>
The name of the slot to create. Must be a valid replication slot
- name (see <xref linkend="streaming-replication-slots-manipulation">).
+ name (see <xref linkend="streaming-replication-slots-manipulation"/>).
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The name of the output plugin used for logical decoding
- (see <xref linkend="logicaldecoding-output-plugin">).
+ (see <xref linkend="logicaldecoding-output-plugin"/>).
</para>
</listitem>
</varlistentry>
Sets the label of the backup. If none is specified, a backup label
of <literal>base backup</literal> will be used. The quoting rules
for the label are the same as a standard SQL string with
- <xref linkend="guc-standard-conforming-strings"> turned on.
+ <xref linkend="guc-standard-conforming-strings"/> turned on.
</para>
</listitem>
</varlistentry>
<para>
The individual protocol messages are discussed in the following
subsections. Individual messages are described in
- <xref linkend="protocol-logicalrep-message-formats">.
+ <xref linkend="protocol-logicalrep-message-formats"/>.
</para>
<para>
characters, etc).
1 indicates the overall copy format is binary (similar
to DataRow format).
- See <xref linkend="sql-copy">
+ See <xref linkend="sql-copy"/>
for more information.
</para>
</listitem>
is textual (rows separated by newlines, columns
separated by separator characters, etc). 1 indicates
the overall copy format is binary (similar to DataRow
- format). See <xref linkend="sql-copy"> for more information.
+ format). See <xref linkend="sql-copy"/> for more information.
</para>
</listitem>
</varlistentry>
is textual (rows separated by newlines, columns
separated by separator characters, etc). 1 indicates
the overall copy format is binary (similar to DataRow
- format). See <xref linkend="sql-copy"> for more information.
+ format). See <xref linkend="sql-copy"/> for more information.
</para>
</listitem>
</varlistentry>
A code identifying the field type; if zero, this is
the message terminator and no string follows.
The presently defined field types are listed in
- <xref linkend="protocol-error-fields">.
+ <xref linkend="protocol-error-fields"/>.
Since more field types might be added in future,
frontends should silently ignore fields of unrecognized
type.
A code identifying the field type; if zero, this is
the message terminator and no string follows.
The presently defined field types are listed in
- <xref linkend="protocol-error-fields">.
+ <xref linkend="protocol-error-fields"/>.
Since more field types might be added in future,
frontends should silently ignore fields of unrecognized
type.
<literal>true</literal>, <literal>false</literal>, or
<literal>database</literal>, and the default is
<literal>false</literal>. See
- <xref linkend="protocol-replication"> for details.
+ <xref linkend="protocol-replication"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Code: the SQLSTATE code for the error (see <xref
- linkend="errcodes-appendix">). Not localizable. Always present.
+ linkend="errcodes-appendix"/>). Not localizable. Always present.
</para>
</listitem>
</varlistentry>
<para>
The fields for schema name, table name, column name, data type name, and
constraint name are supplied only for a limited number of error types;
- see <xref linkend="errcodes-appendix">. Frontends should not assume that
+ see <xref linkend="errcodes-appendix"/>. Frontends should not assume that
the presence of any of these fields guarantees the presence of another
field. Core error sources observe the interrelationships noted above, but
user-defined functions may use these fields in other ways. In the same
This section describes the detailed format of each logical replication message.
These messages are returned either by the replication slot SQL interface or are
sent by a walsender. In case of a walsender they are encapsulated inside the replication
-protocol WAL messages as described in <xref linkend="protocol-replication">
+protocol WAL messages as described in <xref linkend="protocol-replication"/>
and generally obey same message flow as physical replication.
</para>
<para>
The process of retrieving or the command to retrieve data from a
database is called a <firstterm>query</firstterm>. In SQL the
- <xref linkend="sql-select"> command is
+ <xref linkend="sql-select"/> command is
used to specify queries. The general syntax of the
<command>SELECT</command> command is
<synopsis>
</programlisting>
(assuming that <literal>b</literal> and <literal>c</literal> are of a numerical
data type).
- See <xref linkend="queries-select-lists"> for more details.
+ See <xref linkend="queries-select-lists"/> for more details.
</para>
<para>
<title>The <literal>FROM</literal> Clause</title>
<para>
- The <xref linkend="sql-from" endterm="sql-from-title"> derives a
+ The <xref linkend="sql-from" endterm="sql-from-title"/> derives a
table from one or more other tables given in a comma-separated
table reference list.
<synopsis>
SELECT * FROM people AS mother JOIN people AS child ON mother.id = child.mother_id;
</programlisting>
Additionally, an alias is required if the table reference is a
- subquery (see <xref linkend="queries-subqueries">).
+ subquery (see <xref linkend="queries-subqueries"/>).
</para>
<para>
<para>
Subqueries specifying a derived table must be enclosed in
parentheses and <emphasis>must</emphasis> be assigned a table
- alias name (as in <xref linkend="queries-table-aliases">). For
+ alias name (as in <xref linkend="queries-table-aliases"/>). For
example:
<programlisting>
FROM (SELECT * FROM table1) AS alias_name
</programlisting>
Again, a table alias is required. Assigning alias names to the columns
of the <command>VALUES</command> list is optional, but is good practice.
- For more information see <xref linkend="queries-values">.
+ For more information see <xref linkend="queries-values"/>.
</para>
</sect3>
The special table function <literal>UNNEST</literal> may be called with
any number of array parameters, and it returns a corresponding number of
columns, as if <literal>UNNEST</literal>
- (<xref linkend="functions-array">) had been called on each parameter
+ (<xref linkend="functions-array"/>) had been called on each parameter
separately and combined using the <literal>ROWS FROM</literal> construct.
</para>
AS t1(proname name, prosrc text)
WHERE proname LIKE 'bytea%';
</programlisting>
- The <xref linkend="contrib-dblink-function"> function
- (part of the <xref linkend="dblink"> module) executes
+ The <xref linkend="contrib-dblink-function"/> function
+ (part of the <xref linkend="dblink"/> module) executes
a remote query. It is declared to return
<type>record</type> since it might be used for any kind of query.
The actual column set must be specified in the calling query so
<para>
The syntax of the <xref linkend="sql-where"
- endterm="sql-where-title"> is
+ endterm="sql-where-title"/> is
<synopsis>
WHERE <replaceable>search_condition</replaceable>
</synopsis>
where <replaceable>search_condition</replaceable> is any value
- expression (see <xref linkend="sql-expressions">) that
+ expression (see <xref linkend="sql-expressions"/>) that
returns a value of type <type>boolean</type>.
</para>
</synopsis>
<para>
- The <xref linkend="sql-groupby" endterm="sql-groupby-title"> is
+ The <xref linkend="sql-groupby" endterm="sql-groupby-title"/> is
used to group together those rows in a table that have the same
values in all the columns listed. The order in which the columns
are listed does not matter. The effect is to combine each set
Here <literal>sum</literal> is an aggregate function that
computes a single value over the entire group. More information
about the available aggregate functions can be found in <xref
- linkend="functions-aggregate">.
+ linkend="functions-aggregate"/>.
</para>
<tip>
Grouping without aggregate expressions effectively calculates the
set of distinct values in a column. This can also be achieved
using the <literal>DISTINCT</literal> clause (see <xref
- linkend="queries-distinct">).
+ linkend="queries-distinct"/>).
</para>
</tip>
References to the grouping columns or expressions are replaced
by null values in result rows for grouping sets in which those
columns do not appear. To distinguish which grouping a particular output
- row resulted from, see <xref linkend="functions-grouping-table">.
+ row resulted from, see <xref linkend="functions-grouping-table"/>.
</para>
<para>
<para>
If the query contains any window functions (see
- <xref linkend="tutorial-window">,
- <xref linkend="functions-window"> and
- <xref linkend="syntax-window-functions">), these functions are evaluated
+ <xref linkend="tutorial-window"/>,
+ <xref linkend="functions-window"/> and
+ <xref linkend="syntax-window-functions"/>), these functions are evaluated
after any grouping, aggregation, and <literal>HAVING</literal> filtering is
performed. That is, if the query uses any aggregates, <literal>GROUP
BY</literal>, or <literal>HAVING</literal>, then the rows seen by the window functions
The simplest kind of select list is <literal>*</literal> which
emits all columns that the table expression produces. Otherwise,
a select list is a comma-separated list of value expressions (as
- defined in <xref linkend="sql-expressions">). For instance, it
+ defined in <xref linkend="sql-expressions"/>). For instance, it
could be a list of column names:
<programlisting>
SELECT a, b, c FROM ...
The columns names <literal>a</literal>, <literal>b</literal>, and <literal>c</literal>
are either the actual names of the columns of tables referenced
in the <literal>FROM</literal> clause, or the aliases given to them as
- explained in <xref linkend="queries-table-aliases">. The name
+ explained in <xref linkend="queries-table-aliases"/>. The name
space available in the select list is the same as in the
<literal>WHERE</literal> clause, unless grouping is used, in which case
it is the same as in the <literal>HAVING</literal> clause.
<programlisting>
SELECT tbl1.*, tbl2.a FROM ...
</programlisting>
- See <xref linkend="rowtypes-usage"> for more about
+ See <xref linkend="rowtypes-usage"/> for more about
the <replaceable>table_name</replaceable><literal>.*</literal> notation.
</para>
The <literal>AS</literal> keyword is optional, but only if the new column
name does not match any
<productname>PostgreSQL</productname> keyword (see <xref
- linkend="sql-keywords-appendix">). To avoid an accidental match to
+ linkend="sql-keywords-appendix"/>). To avoid an accidental match to
a keyword, you can double-quote the column name. For example,
<literal>VALUE</literal> is a keyword, so this does not work:
<programlisting>
<para>
The naming of output columns here is different from that done in
the <literal>FROM</literal> clause (see <xref
- linkend="queries-table-aliases">). It is possible
+ linkend="queries-table-aliases"/>). It is possible
to rename the same column twice, but the name assigned in
the select list is the one that will be passed on.
</para>
queries, the two queries must be <quote>union compatible</quote>,
which means that they return the same number of columns and
the corresponding columns have compatible data types, as
- described in <xref linkend="typeconv-union-case">.
+ described in <xref linkend="typeconv-union-case"/>.
</para>
</sect1>
of columns in the table), and corresponding entries in each list must
have compatible data types. The actual data type assigned to each column
of the result is determined using the same rules as for <literal>UNION</literal>
- (see <xref linkend="typeconv-union-case">).
+ (see <xref linkend="typeconv-union-case"/>).
</para>
<para>
</para>
<para>
- For more information see <xref linkend="sql-values">.
+ For more information see <xref linkend="sql-values"/>.
</para>
</sect1>
<para>
Data-modifying statements in <literal>WITH</literal> usually have
- <literal>RETURNING</literal> clauses (see <xref linkend="dml-returning">),
+ <literal>RETURNING</literal> clauses (see <xref linkend="dml-returning"/>),
as shown in the example above.
It is the output of the <literal>RETURNING</literal> clause, <emphasis>not</emphasis> the
target table of the data-modifying statement, that forms the temporary
each other and with the main query. Therefore, when using data-modifying
statements in <literal>WITH</literal>, the order in which the specified updates
actually happen is unpredictable. All the statements are executed with
- the same <firstterm>snapshot</firstterm> (see <xref linkend="mvcc">), so they
+ the same <firstterm>snapshot</firstterm> (see <xref linkend="mvcc"/>), so they
cannot <quote>see</quote> one another's effects on the target tables. This
alleviates the effects of the unpredictability of the actual order of row
updates, and means that <literal>RETURNING</literal> data is the only way to
tutorial is only intended to give you an introduction and is in no
way a complete tutorial on <acronym>SQL</acronym>. Numerous books
have been written on <acronym>SQL</acronym>, including <xref
- linkend="melt93"> and <xref linkend="date97">.
+ linkend="melt93"/> and <xref linkend="date97"/>.
You should be aware that some <productname>PostgreSQL</productname>
language features are extensions to the standard.
</para>
where the file name for the source file must be available on the
machine running the backend process, not the client, since the backend process
reads the file directly. You can read more about the
- <command>COPY</command> command in <xref linkend="sql-copy">.
+ <command>COPY</command> command in <xref linkend="sql-copy"/>.
</para>
</sect1>
<programlisting>
SELECT city, max(temp_lo)
FROM weather
- WHERE city LIKE 'S%' -- <co id="co.tutorial-agg-like">
+ WHERE city LIKE 'S%' -- <co id="co.tutorial-agg-like"/>
GROUP BY city
HAVING max(temp_lo) < 40;
</programlisting>
<callout arearefs="co.tutorial-agg-like">
<para>
The <literal>LIKE</literal> operator does pattern matching and
- is explained in <xref linkend="functions-matching">.
+ is explained in <xref linkend="functions-matching"/>.
</para>
</callout>
</calloutlist>
</listitem>
</itemizedlist>
In addition, you can define your own range types;
- see <xref linkend="sql-createtype"> for more information.
+ see <xref linkend="sql-createtype"/> for more information.
</para>
</sect2>
SELECT isempty(numrange(1, 5));
</programlisting>
- See <xref linkend="range-operators-table">
- and <xref linkend="range-functions-table"> for complete lists of
+ See <xref linkend="range-operators-table"/>
+ and <xref linkend="range-functions-table"/> for complete lists of
operators and functions on range types.
</para>
</sect2>
represented by <quote><literal>(</literal></quote>. Likewise, an inclusive upper bound is represented by
<quote><literal>]</literal></quote>, while an exclusive upper bound is
represented by <quote><literal>)</literal></quote>.
- (See <xref linkend="rangetypes-io"> for more details.)
+ (See <xref linkend="rangetypes-io"/> for more details.)
</para>
<para>
<note>
<para>
These rules are very similar to those for writing field values in
- composite-type literals. See <xref linkend="rowtypes-io-syntax"> for
+ composite-type literals. See <xref linkend="rowtypes-io-syntax"/> for
additional commentary.
</para>
</note>
</programlisting>
<para>
- See <xref linkend="sql-createtype"> for more information about creating
+ See <xref linkend="sql-createtype"/> for more information about creating
range types.
</para>
</sect2>
<literal>-|-</literal>,
<literal>&<</literal>, and
<literal>&></literal>
- (see <xref linkend="range-operators-table"> for more information).
+ (see <xref linkend="range-operators-table"/> for more information).
</para>
<para>
to truncate the archive to just the minimum required to support
restarting from the current restore. <literal>%r</literal> is typically only
used by warm-standby configurations
- (see <xref linkend="warm-standby">).
+ (see <xref linkend="warm-standby"/>).
Write <literal>%%</literal> to embed an actual <literal>%</literal> character.
</para>
may be safely removed.
This information can be used to truncate the archive to just the
minimum required to support restart from the current restore.
- The <xref linkend="pgarchivecleanup"> module
+ The <xref linkend="pgarchivecleanup"/> module
is often used in <varname>archive_cleanup_command</varname> for
single-standby configurations, for example:
<programlisting>archive_cleanup_command = 'pg_archivecleanup /mnt/server/archivedir %r'</programlisting>
same archive directory, you will need to ensure that you do not delete
WAL files until they are no longer needed by any of the servers.
<varname>archive_cleanup_command</varname> would typically be used in a
- warm-standby configuration (see <xref linkend="warm-standby">).
+ warm-standby configuration (see <xref linkend="warm-standby"/>).
Write <literal>%%</literal> to embed an actual <literal>%</literal> character in the
command.
</para>
<varname>recovery_end_command</varname> is to provide a mechanism for cleanup
following replication or recovery.
Any <literal>%r</literal> is replaced by the name of the file containing the
- last valid restart point, like in <xref linkend="archive-cleanup-command">.
+ last valid restart point, like in <xref linkend="archive-cleanup-command"/>.
</para>
<para>
If the command returns a nonzero exit status then a warning log
This parameter specifies the time stamp up to which recovery
will proceed.
The precise stopping point is also influenced by
- <xref linkend="recovery-target-inclusive">.
+ <xref linkend="recovery-target-inclusive"/>.
</para>
</listitem>
</varlistentry>
The transactions that will be recovered are those that committed
before (and optionally including) the specified one.
The precise stopping point is also influenced by
- <xref linkend="recovery-target-inclusive">.
+ <xref linkend="recovery-target-inclusive"/>.
</para>
</listitem>
</varlistentry>
<para>
This parameter specifies the LSN of the write-ahead log location up
to which recovery will proceed. The precise stopping point is also
- influenced by <xref linkend="recovery-target-inclusive">. This
+ influenced by <xref linkend="recovery-target-inclusive"/>. This
parameter is parsed using the system data type
<link linkend="datatype-pg-lsn"><type>pg_lsn</type></link>.
</para>
Specifies whether to stop just after the specified recovery target
(<literal>true</literal>), or just before the recovery target
(<literal>false</literal>).
- Applies when <xref linkend="recovery-target-lsn">,
- <xref linkend="recovery-target-time">, or
- <xref linkend="recovery-target-xid"> is specified.
+ Applies when <xref linkend="recovery-target-lsn"/>,
+ <xref linkend="recovery-target-time"/>, or
+ <xref linkend="recovery-target-xid"/> is specified.
This setting controls whether transactions
having exactly the target WAL location (LSN), commit time, or transaction ID, respectively, will
be included in the recovery. Default is <literal>true</literal>.
a standby server. Other than that you only need to set this parameter
in complex re-recovery situations, where you need to return to
a state that itself was reached after a point-in-time recovery.
- See <xref linkend="backup-timelines"> for discussion.
+ See <xref linkend="backup-timelines"/> for discussion.
</para>
</listitem>
</varlistentry>
is the most desirable point for recovery.
The paused state can be resumed by
using <function>pg_wal_replay_resume()</function> (see
- <xref linkend="functions-recovery-control-table">), which then
+ <xref linkend="functions-recovery-control-table"/>), which then
causes recovery to end. If this recovery target is not the
desired stopping point, then shut down the server, change the
recovery target settings to a later target and restart to
</para>
<para>
This setting has no effect if no recovery target is set.
- If <xref linkend="guc-hot-standby"> is not enabled, a setting of
+ If <xref linkend="guc-hot-standby"/> is not enabled, a setting of
<literal>pause</literal> will act the same as <literal>shutdown</literal>.
</para>
</listitem>
<para>
Specifies a connection string to be used for the standby server
to connect with the primary. This string is in the format
- described in <xref linkend="libpq-connstring">. If any option is
+ described in <xref linkend="libpq-connstring"/>. If any option is
unspecified in this string, then the corresponding environment
- variable (see <xref linkend="libpq-envars">) is checked. If the
+ variable (see <xref linkend="libpq-envars"/>) is checked. If the
environment variable is not set either, then
defaults are used.
</para>
the same as the standby server's default.
Also specify a user name corresponding to a suitably-privileged role
on the primary (see
- <xref linkend="streaming-replication-authentication">).
+ <xref linkend="streaming-replication-authentication"/>).
A password needs to be provided too, if the primary demands password
authentication. It can be provided in the
<varname>primary_conninfo</varname> string, or in a separate
Optionally specifies an existing replication slot to be used when
connecting to the primary via streaming replication to control
resource removal on the upstream node
- (see <xref linkend="streaming-replication-slots">).
+ (see <xref linkend="streaming-replication-slots"/>).
This setting has no effect if <varname>primary_conninfo</varname> is not
set.
</para>
all the updates made by the transaction to be discarded.
This command is identical
in behavior to the standard <acronym>SQL</acronym> command
- <xref linkend="sql-rollback">,
+ <xref linkend="sql-rollback"/>,
and is present only for historical reasons.
</para>
</refsect1>
<title>Notes</title>
<para>
- Use <xref linkend="sql-commit"> to
+ Use <xref linkend="sql-commit"/> to
successfully terminate a transaction.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-rollback"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-rollback"/></member>
</simplelist>
</refsect1>
</refentry>
The recommended syntax for referencing an ordered-set aggregate
is to write <literal>ORDER BY</literal> between the direct and aggregated
argument specifications, in the same style as in
- <xref linkend="sql-createaggregate">. However, it will also work to
+ <xref linkend="sql-createaggregate"/>. However, it will also work to
omit <literal>ORDER BY</literal> and just run the direct and aggregated
argument specifications into a single list. In this abbreviated form,
if <literal>VARIADIC "any"</literal> was used in both the direct and
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createaggregate"></member>
- <member><xref linkend="sql-dropaggregate"></member>
+ <member><xref linkend="sql-createaggregate"/></member>
+ <member><xref linkend="sql-dropaggregate"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
Update the collation's version.
See <xref linkend="sql-altercollation-notes"
- endterm="sql-altercollation-notes-title"> below.
+ endterm="sql-altercollation-notes-title"/> below.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createcollation"></member>
- <member><xref linkend="sql-dropcollation"></member>
+ <member><xref linkend="sql-createcollation"/></member>
+ <member><xref linkend="sql-dropcollation"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createconversion"></member>
- <member><xref linkend="sql-dropconversion"></member>
+ <member><xref linkend="sql-createconversion"/></member>
+ <member><xref linkend="sql-dropconversion"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- See <xref linkend="sql-set"> and <xref linkend="runtime-config">
+ See <xref linkend="sql-set"/> and <xref linkend="runtime-config"/>
for more information about allowed parameter names
and values.
</para>
<para>
It is also possible to tie a session default to a specific role
rather than to a database; see
- <xref linkend="sql-alterrole">.
+ <xref linkend="sql-alterrole"/>.
Role-specific settings override database-specific
ones if there is a conflict.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createdatabase"></member>
- <member><xref linkend="sql-dropdatabase"></member>
- <member><xref linkend="sql-set"></member>
- <member><xref linkend="sql-createtablespace"></member>
+ <member><xref linkend="sql-createdatabase"/></member>
+ <member><xref linkend="sql-dropdatabase"/></member>
+ <member><xref linkend="sql-set"/></member>
+ <member><xref linkend="sql-createtablespace"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- As explained under <xref linkend="sql-grant">,
+ As explained under <xref linkend="sql-grant"/>,
the default privileges for any object type normally grant all grantable
permissions to the object owner, and may grant some privileges to
<literal>PUBLIC</literal> as well. However, this behavior can be changed by
This parameter, and all the other parameters in
<replaceable class="parameter">abbreviated_grant_or_revoke</replaceable>,
act as described under
- <xref linkend="sql-grant"> or
- <xref linkend="sql-revoke">,
+ <xref linkend="sql-grant"/> or
+ <xref linkend="sql-revoke"/>,
except that one is setting permissions for a whole class of objects
rather than specific named objects.
</para>
<title>Notes</title>
<para>
- Use <xref linkend="app-psql">'s <command>\ddp</command> command
+ Use <xref linkend="app-psql"/>'s <command>\ddp</command> command
to obtain information about existing assignments of default privileges.
The meaning of the privilege values is the same as explained for
<command>\dp</command> under
- <xref linkend="sql-grant">.
+ <xref linkend="sql-grant"/>.
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-grant"></member>
- <member><xref linkend="sql-revoke"></member>
+ <member><xref linkend="sql-grant"/></member>
+ <member><xref linkend="sql-revoke"/></member>
</simplelist>
</refsect1>
<listitem>
<para>
This form adds a new constraint to a domain using the same syntax as
- <xref linkend="sql-createdomain">.
+ <xref linkend="sql-createdomain"/>.
When a new constraint is added to a domain, all columns using that
domain will be checked against the newly added constraint. These
checks can be suppressed by adding the new constraint using the
<para>
Automatically drop objects that depend on the constraint,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createdomain"></member>
- <member><xref linkend="sql-dropdomain"></member>
+ <member><xref linkend="sql-createdomain"/></member>
+ <member><xref linkend="sql-dropdomain"/></member>
</simplelist>
</refsect1>
<para>
These forms configure the firing of event triggers. A disabled trigger
is still known to the system, but is not executed when its triggering
- event occurs. See also <xref linkend="guc-session-replication-role">.
+ event occurs. See also <xref linkend="guc-session-replication-role"/>.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createeventtrigger"></member>
- <member><xref linkend="sql-dropeventtrigger"></member>
+ <member><xref linkend="sql-createeventtrigger"/></member>
+ <member><xref linkend="sql-dropeventtrigger"/></member>
</simplelist>
</refsect1>
</refentry>
</varlistentry>
</variablelist>
- See <xref linkend="extend-extensions"> for more information about these
+ See <xref linkend="extend-extensions"/> for more information about these
operations.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createextension"></member>
- <member><xref linkend="sql-dropextension"></member>
+ <member><xref linkend="sql-createextension"/></member>
+ <member><xref linkend="sql-dropextension"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createforeigndatawrapper"></member>
- <member><xref linkend="sql-dropforeigndatawrapper"></member>
+ <member><xref linkend="sql-createforeigndatawrapper"/></member>
+ <member><xref linkend="sql-dropforeigndatawrapper"/></member>
</simplelist>
</refsect1>
<listitem>
<para>
This form adds a new column to the foreign table, using the same syntax as
- <xref linkend="sql-createforeigntable">.
+ <xref linkend="sql-createforeigntable"/>.
Unlike the case when adding a column to a regular table, nothing happens
to the underlying storage: this action simply declares that
some new column is now accessible through the foreign table.
<para>
This form
sets the per-column statistics-gathering target for subsequent
- <xref linkend="sql-analyze"> operations.
- See the similar form of <xref linkend="sql-altertable">
+ <xref linkend="sql-analyze"/> operations.
+ See the similar form of <xref linkend="sql-altertable"/>
for more details.
</para>
</listitem>
<listitem>
<para>
This form sets or resets per-attribute options.
- See the similar form of <xref linkend="sql-altertable">
+ See the similar form of <xref linkend="sql-altertable"/>
for more details.
</para>
</listitem>
<listitem>
<para>
This form sets the storage mode for a column.
- See the similar form of <xref linkend="sql-altertable">
+ See the similar form of <xref linkend="sql-altertable"/>
for more details.
Note that the storage mode has no effect unless the table's
foreign-data wrapper chooses to pay attention to it.
<listitem>
<para>
This form adds a new constraint to a foreign table, using the same
- syntax as <xref linkend="sql-createforeigntable">.
+ syntax as <xref linkend="sql-createforeigntable"/>.
Currently only <literal>CHECK</literal> constraints are supported.
</para>
done to verify the constraint is correct; rather, this action simply
declares that some new condition should be assumed to hold for all rows
in the foreign table. (See the discussion
- in <xref linkend="sql-createforeigntable">.)
+ in <xref linkend="sql-createforeigntable"/>.)
If the constraint is marked <literal>NOT VALID</literal>, then it isn't
assumed to hold, but is only recorded for possible future use.
</para>
<listitem>
<para>
These forms configure the firing of trigger(s) belonging to the foreign
- table. See the similar form of <xref linkend="sql-altertable"> for more
+ table. See the similar form of <xref linkend="sql-altertable"/> for more
details.
</para>
</listitem>
<listitem>
<para>
This form adds an <literal>oid</literal> system column to the
- table (see <xref linkend="ddl-system-columns">).
+ table (see <xref linkend="ddl-system-columns"/>).
It does nothing if the table already has OIDs.
Unless the table's foreign-data wrapper supports OIDs, this column
will simply read as zeroes.
<para>
This form adds the target foreign table as a new child of the specified
parent table.
- See the similar form of <xref linkend="sql-altertable">
+ See the similar form of <xref linkend="sql-altertable"/>
for more details.
</para>
</listitem>
Automatically drop objects that depend on the dropped column
or constraint (for example, views referencing the column),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
</para>
<para>
- Refer to <xref linkend="sql-createforeigntable"> for a further description of valid
+ Refer to <xref linkend="sql-createforeigntable"/> for a further description of valid
parameters.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createforeigntable"></member>
- <member><xref linkend="sql-dropforeigntable"></member>
+ <member><xref linkend="sql-createforeigntable"/></member>
+ <member><xref linkend="sql-dropforeigntable"/></member>
</simplelist>
</refsect1>
</refentry>
null. <literal>RETURNS NULL ON NULL INPUT</literal> or
<literal>STRICT</literal> changes the function so that it is not
invoked if any of its arguments are null; instead, a null result
- is assumed automatically. See <xref linkend="sql-createfunction">
+ is assumed automatically. See <xref linkend="sql-createfunction"/>
for more information.
</para>
</listitem>
<listitem>
<para>
Change the volatility of the function to the specified setting.
- See <xref linkend="sql-createfunction"> for details.
+ See <xref linkend="sql-createfunction"/> for details.
</para>
</listitem>
</varlistentry>
<para>
Change whether the function is a security definer or not. The
key word <literal>EXTERNAL</literal> is ignored for SQL
- conformance. See <xref linkend="sql-createfunction"> for more information about
+ conformance. See <xref linkend="sql-createfunction"/> for more information about
this capability.
</para>
</listitem>
<listitem>
<para>
Change whether the function is deemed safe for parallelism.
- See <xref linkend="sql-createfunction"> for details.
+ See <xref linkend="sql-createfunction"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Change whether the function is considered leakproof or not.
- See <xref linkend="sql-createfunction"> for more information about
+ See <xref linkend="sql-createfunction"/> for more information about
this capability.
</para>
</listitem>
<listitem>
<para>
Change the estimated execution cost of the function.
- See <xref linkend="sql-createfunction"> for more information.
+ See <xref linkend="sql-createfunction"/> for more information.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Change the estimated number of rows returned by a set-returning
- function. See <xref linkend="sql-createfunction"> for more information.
+ function. See <xref linkend="sql-createfunction"/> for more information.
</para>
</listitem>
</varlistentry>
</para>
<para>
- See <xref linkend="sql-set"> and
- <xref linkend="runtime-config">
+ See <xref linkend="sql-set"/> and
+ <xref linkend="runtime-config"/>
for more information about allowed parameter names and values.
</para>
</listitem>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createfunction"></member>
- <member><xref linkend="sql-dropfunction"></member>
+ <member><xref linkend="sql-createfunction"/></member>
+ <member><xref linkend="sql-dropfunction"/></member>
</simplelist>
</refsect1>
</refentry>
<quote>group</quote> for this purpose.) These variants are effectively
equivalent to granting or revoking membership in the role named as the
<quote>group</quote>; so the preferred way to do this is to use
- <xref linkend="sql-grant"> or
- <xref linkend="sql-revoke">.
+ <xref linkend="sql-grant"/> or
+ <xref linkend="sql-revoke"/>.
</para>
<para>
The third variant changes the name of the group. This is exactly
equivalent to renaming the role with
- <xref linkend="sql-alterrole">.
+ <xref linkend="sql-alterrole"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-grant"></member>
- <member><xref linkend="sql-revoke"></member>
- <member><xref linkend="sql-alterrole"></member>
+ <member><xref linkend="sql-grant"/></member>
+ <member><xref linkend="sql-revoke"/></member>
+ <member><xref linkend="sql-alterrole"/></member>
</simplelist>
</refsect1>
this command, use <command>ALTER DATABASE</command> or explicit
<command>ALTER INDEX</command> invocations instead if desired.
See also
- <xref linkend="sql-createtablespace">.
+ <xref linkend="sql-createtablespace"/>.
</para>
</listitem>
</varlistentry>
<para>
This form changes one or more index-method-specific storage parameters
for the index. See
- <xref linkend="sql-createindex">
+ <xref linkend="sql-createindex"/>
for details on the available parameters. Note that the index contents
will not be modified immediately by this command; depending on the
parameter you might need to rebuild the index with
- <xref linkend="sql-reindex">
+ <xref linkend="sql-reindex"/>
to get the desired effects.
</para>
</listitem>
<listitem>
<para>
This form sets the per-column statistics-gathering target for
- subsequent <xref linkend="sql-analyze"> operations, though can
+ subsequent <xref linkend="sql-analyze"/> operations, though can
be used only on index columns that are defined as an expression.
Since expressions lack a unique name, we refer to them using the
ordinal number of the index column.
The target can be set in the range 0 to 10000; alternatively, set it
to -1 to revert to using the system default statistics
- target (<xref linkend="guc-default-statistics-target">).
+ target (<xref linkend="guc-default-statistics-target"/>).
For more information on the use of statistics by the
<productname>PostgreSQL</productname> query planner, refer to
- <xref linkend="planner-stats">.
+ <xref linkend="planner-stats"/>.
</para>
</listitem>
</varlistentry>
<para>
These operations are also possible using
- <xref linkend="sql-altertable">.
+ <xref linkend="sql-altertable"/>.
<command>ALTER INDEX</command> is in fact just an alias for the forms
of <command>ALTER TABLE</command> that apply to indexes.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createindex"></member>
- <member><xref linkend="sql-reindex"></member>
+ <member><xref linkend="sql-createindex"/></member>
+ <member><xref linkend="sql-reindex"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createlanguage"></member>
- <member><xref linkend="sql-droplanguage"></member>
+ <member><xref linkend="sql-createlanguage"/></member>
+ <member><xref linkend="sql-droplanguage"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="largeobjects"></member>
+ <member><xref linkend="largeobjects"/></member>
</simplelist>
</refsect1>
The statement subforms and actions available for
<command>ALTER MATERIALIZED VIEW</command> are a subset of those available
for <command>ALTER TABLE</command>, and have the same meaning when used for
- materialized views. See the descriptions for <xref linkend="sql-altertable">
+ materialized views. See the descriptions for <xref linkend="sql-altertable"/>
for details.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-creatematerializedview"></member>
- <member><xref linkend="sql-dropmaterializedview"></member>
- <member><xref linkend="sql-refreshmaterializedview"></member>
+ <member><xref linkend="sql-creatematerializedview"/></member>
+ <member><xref linkend="sql-dropmaterializedview"/></member>
+ <member><xref linkend="sql-refreshmaterializedview"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-dropopclass"></member>
- <member><xref linkend="sql-alteropfamily"></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-dropopclass"/></member>
+ <member><xref linkend="sql-alteropfamily"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createoperator"></member>
- <member><xref linkend="sql-dropoperator"></member>
+ <member><xref linkend="sql-createoperator"/></member>
+ <member><xref linkend="sql-dropoperator"/></member>
</simplelist>
</refsect1>
</refentry>
are compatible with the family's semantics, but are not required for
correct functioning of any specific index. (Operators and functions
that are so required should be declared as part of an operator class,
- instead; see <xref linkend="sql-createopclass">.)
+ instead; see <xref linkend="sql-createopclass"/>.)
<productname>PostgreSQL</productname> will allow loose members of a
family to be dropped from the family at any time, but members of an
operator class cannot be dropped without dropping the whole class and
</para>
<para>
- Refer to <xref linkend="xindex"> for further information.
+ Refer to <xref linkend="xindex"/> for further information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createopfamily"></member>
- <member><xref linkend="sql-dropopfamily"></member>
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-alteropclass"></member>
- <member><xref linkend="sql-dropopclass"></member>
+ <member><xref linkend="sql-createopfamily"/></member>
+ <member><xref linkend="sql-dropopfamily"/></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-alteropclass"/></member>
+ <member><xref linkend="sql-dropopclass"/></member>
</simplelist>
</refsect1>
</refentry>
<listitem>
<para>
The <literal>USING</literal> expression for the policy.
- See <xref linkend="sql-createpolicy"> for details.
+ See <xref linkend="sql-createpolicy"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The <literal>WITH CHECK</literal> expression for the policy.
- See <xref linkend="sql-createpolicy"> for details.
+ See <xref linkend="sql-createpolicy"/> for details.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createpolicy"></member>
- <member><xref linkend="sql-droppolicy"></member>
+ <member><xref linkend="sql-createpolicy"/></member>
+ <member><xref linkend="sql-droppolicy"/></member>
</simplelist>
</refsect1>
<para>
The fourth variant of this command listed in the synopsis can change
all of the publication properties specified in
- <xref linkend="sql-createpublication">. Properties not mentioned in the
+ <xref linkend="sql-createpublication"/>. Properties not mentioned in the
command retain their previous settings.
</para>
<listitem>
<para>
This clause alters publication parameters originally set by
- <xref linkend="sql-createpublication">. See there for more information.
+ <xref linkend="sql-createpublication"/>. See there for more information.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createpublication"></member>
- <member><xref linkend="sql-droppublication"></member>
- <member><xref linkend="sql-createsubscription"></member>
- <member><xref linkend="sql-altersubscription"></member>
+ <member><xref linkend="sql-createpublication"/></member>
+ <member><xref linkend="sql-droppublication"/></member>
+ <member><xref linkend="sql-createsubscription"/></member>
+ <member><xref linkend="sql-altersubscription"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The first variant of this command listed in the synopsis can change
many of the role attributes that can be specified in
- <xref linkend="sql-createrole">.
+ <xref linkend="sql-createrole"/>.
(All the possible attributes are covered,
except that there are no options for adding or removing memberships; use
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke"> for that.)
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/> for that.)
Attributes not mentioned in the command retain their previous settings.
Database superusers can change any of these settings for any role.
Roles having <literal>CREATEROLE</literal> privilege can change any of these
default, overriding whatever setting is present in
<filename>postgresql.conf</filename> or has been received from the <command>postgres</command>
command line. This only happens at login time; executing
- <xref linkend="sql-set-role"> or
- <xref linkend="sql-set-session-authorization"> does not cause new
+ <xref linkend="sql-set-role"/> or
+ <xref linkend="sql-set-session-authorization"/> does not cause new
configuration values to be set.
Settings set for all databases are overridden by database-specific settings
attached to a role. Settings for specific databases or specific roles override
<listitem>
<para>
These clauses alter attributes originally set by
- <xref linkend="sql-createrole">. For more information, see the
+ <xref linkend="sql-createrole"/>. For more information, see the
<command>CREATE ROLE</command> reference page.
</para>
</listitem>
<para>
Role-specific variable settings take effect only at login;
- <xref linkend="sql-set-role"> and
- <xref linkend="sql-set-session-authorization">
+ <xref linkend="sql-set-role"/> and
+ <xref linkend="sql-set-session-authorization"/>
do not process role-specific variable settings.
</para>
<para>
- See <xref linkend="sql-set"> and <xref
- linkend="runtime-config"> for more information about allowed
+ See <xref linkend="sql-set"/> and <xref
+ linkend="runtime-config"/> for more information about allowed
parameter names and values.
</para>
</listitem>
<title>Notes</title>
<para>
- Use <xref linkend="sql-createrole">
- to add new roles, and <xref linkend="sql-droprole"> to remove a role.
+ Use <xref linkend="sql-createrole"/>
+ to add new roles, and <xref linkend="sql-droprole"/> to remove a role.
</para>
<para>
<command>ALTER ROLE</command> cannot change a role's memberships.
- Use <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ Use <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
to do that.
</para>
Caution must be exercised when specifying an unencrypted password
with this command. The password will be transmitted to the server
in cleartext, and it might also be logged in the client's command
- history or the server log. <xref linkend="app-psql">
+ history or the server log. <xref linkend="app-psql"/>
contains a command
<command>\password</command> that can be used to change a
role's password without exposing the cleartext password.
<para>
It is also possible to tie a
session default to a specific database rather than to a role; see
- <xref linkend="sql-alterdatabase">.
+ <xref linkend="sql-alterdatabase"/>.
If there is a conflict, database-role-specific settings override role-specific
ones, which in turn override database-specific ones.
</para>
<para>
Give a role a non-default setting of the
- <xref linkend="guc-maintenance-work-mem"> parameter:
+ <xref linkend="guc-maintenance-work-mem"/> parameter:
<programlisting>
ALTER ROLE worker_bee SET maintenance_work_mem = 100000;
<para>
Give a role a non-default, database-specific setting of the
- <xref linkend="guc-client-min-messages"> parameter:
+ <xref linkend="guc-client-min-messages"/> parameter:
<programlisting>
ALTER ROLE fred IN DATABASE devel SET client_min_messages = DEBUG;
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createrole"></member>
- <member><xref linkend="sql-droprole"></member>
- <member><xref linkend="sql-alterdatabase"></member>
- <member><xref linkend="sql-set"></member>
+ <member><xref linkend="sql-createrole"/></member>
+ <member><xref linkend="sql-droprole"/></member>
+ <member><xref linkend="sql-alterdatabase"/></member>
+ <member><xref linkend="sql-set"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createrule"></member>
- <member><xref linkend="sql-droprule"></member>
+ <member><xref linkend="sql-createrule"/></member>
+ <member><xref linkend="sql-droprule"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createschema"></member>
- <member><xref linkend="sql-dropschema"></member>
+ <member><xref linkend="sql-createschema"/></member>
+ <member><xref linkend="sql-dropschema"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createsequence"></member>
- <member><xref linkend="sql-dropsequence"></member>
+ <member><xref linkend="sql-createsequence"/></member>
+ <member><xref linkend="sql-dropsequence"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createserver"></member>
- <member><xref linkend="sql-dropserver"></member>
+ <member><xref linkend="sql-createserver"/></member>
+ <member><xref linkend="sql-dropserver"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createstatistics"></member>
- <member><xref linkend="sql-dropstatistics"></member>
+ <member><xref linkend="sql-createstatistics"/></member>
+ <member><xref linkend="sql-dropstatistics"/></member>
</simplelist>
</refsect1>
<para>
<command>ALTER SUBSCRIPTION</command> can change most of the subscription
properties that can be specified
- in <xref linkend="sql-createsubscription">.
+ in <xref linkend="sql-createsubscription"/>.
</para>
<para>
<listitem>
<para>
This clause alters the connection property originally set by
- <xref linkend="sql-createsubscription">. See there for more
+ <xref linkend="sql-createsubscription"/>. See there for more
information.
</para>
</listitem>
<listitem>
<para>
Changes list of subscribed publications. See
- <xref linkend="sql-createsubscription"> for more information.
+ <xref linkend="sql-createsubscription"/> for more information.
By default this command will also act like <literal>REFRESH
PUBLICATION</literal>.
</para>
<listitem>
<para>
This clause alters parameters originally set by
- <xref linkend="sql-createsubscription">. See there for more
+ <xref linkend="sql-createsubscription"/>. See there for more
information. The allowed options are <literal>slot_name</literal> and
<literal>synchronous_commit</literal>
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createsubscription"></member>
- <member><xref linkend="sql-dropsubscription"></member>
- <member><xref linkend="sql-createpublication"></member>
- <member><xref linkend="sql-alterpublication"></member>
+ <member><xref linkend="sql-createsubscription"/></member>
+ <member><xref linkend="sql-dropsubscription"/></member>
+ <member><xref linkend="sql-createpublication"/></member>
+ <member><xref linkend="sql-alterpublication"/></member>
</simplelist>
</refsect1>
</refentry>
<listitem>
<para>
Name of a settable configuration parameter. Available parameters are
- documented in <xref linkend="runtime-config">.
+ documented in <xref linkend="runtime-config"/>.
</para>
</listitem>
</varlistentry>
<title>Notes</title>
<para>
- This command can't be used to set <xref linkend="guc-data-directory">,
+ This command can't be used to set <xref linkend="guc-data-directory"/>,
nor parameters that are not allowed in <filename>postgresql.conf</filename>
(e.g., <link linkend="runtime-config-preset">preset options</link>).
</para>
<para>
- See <xref linkend="config-setting"> for other ways to set the parameters.
+ See <xref linkend="config-setting"/> for other ways to set the parameters.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-set"></member>
- <member><xref linkend="sql-show"></member>
+ <member><xref linkend="sql-set"/></member>
+ <member><xref linkend="sql-show"/></member>
</simplelist>
</refsect1>
<listitem>
<para>
This form adds a new column to the table, using the same syntax as
- <xref linkend="sql-createtable">. If <literal>IF NOT EXISTS</literal>
+ <xref linkend="sql-createtable"/>. If <literal>IF NOT EXISTS</literal>
is specified and a column already exists with this name,
no error is thrown.
</para>
<para>
These forms change whether a column is an identity column or change the
generation attribute of an existing identity column.
- See <xref linkend="sql-createtable"> for details.
+ See <xref linkend="sql-createtable"/> for details.
</para>
<para>
<para>
These forms alter the sequence that underlies an existing identity
column. <replaceable>sequence_option</replaceable> is an option
- supported by <xref linkend="sql-altersequence"> such
+ supported by <xref linkend="sql-altersequence"/> such
as <literal>INCREMENT BY</literal>.
</para>
</listitem>
<para>
This form
sets the per-column statistics-gathering target for subsequent
- <xref linkend="sql-analyze"> operations.
+ <xref linkend="sql-analyze"/> operations.
The target can be set in the range 0 to 10000; alternatively, set it
to -1 to revert to using the system default statistics
- target (<xref linkend="guc-default-statistics-target">).
+ target (<xref linkend="guc-default-statistics-target"/>).
For more information on the use of statistics by the
<productname>PostgreSQL</productname> query planner, refer to
- <xref linkend="planner-stats">.
+ <xref linkend="planner-stats"/>.
</para>
<para>
<literal>SET STATISTICS</literal> acquires a
defined per-attribute options are <literal>n_distinct</literal> and
<literal>n_distinct_inherited</literal>, which override the
number-of-distinct-values estimates made by subsequent
- <xref linkend="sql-analyze">
+ <xref linkend="sql-analyze"/>
operations. <literal>n_distinct</literal> affects the statistics for the table
itself, while <literal>n_distinct_inherited</literal> affects the statistics
gathered for the table plus its inheritance children. When set to a
until query planning time. Specify a value of 0 to revert to estimating
the number of distinct values normally. For more information on the use
of statistics by the <productname>PostgreSQL</productname> query
- planner, refer to <xref linkend="planner-stats">.
+ planner, refer to <xref linkend="planner-stats"/>.
</para>
<para>
Changing per-attribute options acquires a
at the penalty of increased storage space. Note that
<literal>SET STORAGE</literal> doesn't itself change anything in the table,
it just sets the strategy to be pursued during future table updates.
- See <xref linkend="storage-toast"> for more information.
+ See <xref linkend="storage-toast"/> for more information.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
This form adds a new constraint to a table using the same syntax as
- <xref linkend="sql-createtable">, plus the option <literal>NOT
+ <xref linkend="sql-createtable"/>, plus the option <literal>NOT
VALID</literal>, which is currently only allowed for foreign key
and CHECK constraints.
If the constraint is marked <literal>NOT VALID</literal>, the
of course the integrity of the constraint cannot be guaranteed if the
triggers are not executed.
The trigger firing mechanism is also affected by the configuration
- variable <xref linkend="guc-session-replication-role">. Simply enabled
+ variable <xref linkend="guc-session-replication-role"/>. Simply enabled
triggers will fire when the replication role is <quote>origin</quote>
(the default) or <quote>local</quote>. Triggers configured as <literal>ENABLE
REPLICA</literal> will only fire if the session is in <quote>replica</quote>
even if row level security is disabled - in this case, the policies will
NOT be applied and the policies will be ignored.
See also
- <xref linkend="sql-createpolicy">.
+ <xref linkend="sql-createpolicy"/>.
</para>
</listitem>
</varlistentry>
disabled (the default) then row level security will not be applied when
the user is the table owner.
See also
- <xref linkend="sql-createpolicy">.
+ <xref linkend="sql-createpolicy"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
This form selects the default index for future
- <xref linkend="sql-cluster">
+ <xref linkend="sql-cluster"/>
operations. It does not actually re-cluster the table.
</para>
<para>
<listitem>
<para>
This form removes the most recently used
- <xref linkend="sql-cluster">
+ <xref linkend="sql-cluster"/>
index specification from the table. This affects
future cluster operations that don't specify an index.
</para>
<listitem>
<para>
This form adds an <literal>oid</literal> system column to the
- table (see <xref linkend="ddl-system-columns">).
+ table (see <xref linkend="ddl-system-columns"/>).
It does nothing if the table already has OIDs.
</para>
<literal>information_schema</literal> relations are not considered part
of the system catalogs and will be moved.
See also
- <xref linkend="sql-createtablespace">.
+ <xref linkend="sql-createtablespace"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
This form changes the table from unlogged to logged or vice-versa
- (see <xref linkend="sql-createtable-unlogged">). It cannot be applied
+ (see <xref linkend="sql-createtable-unlogged"/>). It cannot be applied
to a temporary table.
</para>
</listitem>
<para>
This form changes one or more storage parameters for the table. See
<xref linkend="sql-createtable-storage-parameters"
- endterm="sql-createtable-storage-parameters-title">
+ endterm="sql-createtable-storage-parameters-title"/>
for details on the available parameters. Note that the table contents
will not be modified immediately by this command; depending on the
parameter you might need to rewrite the table to get the desired effects.
That can be done with <link linkend="sql-vacuum">VACUUM
- FULL</link>, <xref linkend="sql-cluster"> or one of the forms
+ FULL</link>, <xref linkend="sql-cluster"/> or one of the forms
of <command>ALTER TABLE</command> that forces a table rewrite.
For planner related parameters, changes will take effect from the next
time the table is locked so currently executing queries will not be
<para>
A partition using <literal>FOR VALUES</literal> uses same syntax for
<replaceable class="parameter">partition_bound_spec</replaceable> as
- <xref linkend="sql-createtable">. The partition bound specification
+ <xref linkend="sql-createtable"/>. The partition bound specification
must correspond to the partitioning strategy and partition key of the
target table. The table to be attached must have all the same columns
as the target table and no more; moreover, the column types must also
<para>
If the new partition is a foreign table, nothing is done to verify
that all the rows in the foreign table obey the partition constraint.
- (See the discussion in <xref linkend="sql-createforeigntable"> about
+ (See the discussion in <xref linkend="sql-createforeigntable"/> about
constraints on the foreign table.)
</para>
Automatically drop objects that depend on the dropped column
or constraint (for example, views referencing the column),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The partition bound specification for a new partition. Refer to
- <xref linkend="sql-createtable"> for more details on the syntax of the same.
+ <xref linkend="sql-createtable"/> for more details on the syntax of the same.
</para>
</listitem>
</varlistentry>
The rewriting forms of <command>ALTER TABLE</command> are not MVCC-safe.
After a table rewrite, the table will appear empty to concurrent
transactions, if they are using a snapshot taken before the rewrite
- occurred. See <xref linkend="mvcc-caveats"> for more details.
+ occurred. See <xref linkend="mvcc-caveats"/> for more details.
</para>
<para>
</para>
<para>
- Refer to <xref linkend="sql-createtable"> for a further description of valid
- parameters. <xref linkend="ddl"> has further information on
+ Refer to <xref linkend="sql-createtable"/> for a further description of valid
+ parameters. <xref linkend="ddl"/> has further information on
inheritance.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtable"></member>
+ <member><xref linkend="sql-createtable"/></member>
</simplelist>
</refsect1>
</refentry>
Setting either value for a particular tablespace will override the
planner's usual estimate of the cost of reading pages from tables in
that tablespace, as established by the configuration parameters of the
- same name (see <xref linkend="guc-seq-page-cost">,
- <xref linkend="guc-random-page-cost">,
- <xref linkend="guc-effective-io-concurrency">). This may be useful if
+ same name (see <xref linkend="guc-seq-page-cost"/>,
+ <xref linkend="guc-random-page-cost"/>,
+ <xref linkend="guc-effective-io-concurrency"/>). This may be useful if
one tablespace is located on a disk which is faster or slower than the
remainder of the I/O subsystem.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtablespace"></member>
- <member><xref linkend="sql-droptablespace"></member>
+ <member><xref linkend="sql-createtablespace"/></member>
+ <member><xref linkend="sql-droptablespace"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The ability to temporarily enable or disable a trigger is provided by
- <xref linkend="sql-altertable">, not by
+ <xref linkend="sql-altertable"/>, not by
<command>ALTER TRIGGER</command>, because <command>ALTER TRIGGER</command> has no
convenient way to express the option of enabling or disabling all of
a table's triggers at once.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertable"></member>
+ <member><xref linkend="sql-altertable"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtsconfig"></member>
- <member><xref linkend="sql-droptsconfig"></member>
+ <member><xref linkend="sql-createtsconfig"/></member>
+ <member><xref linkend="sql-droptsconfig"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtsdictionary"></member>
- <member><xref linkend="sql-droptsdictionary"></member>
+ <member><xref linkend="sql-createtsdictionary"/></member>
+ <member><xref linkend="sql-droptsdictionary"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtsparser"></member>
- <member><xref linkend="sql-droptsparser"></member>
+ <member><xref linkend="sql-createtsparser"/></member>
+ <member><xref linkend="sql-droptsparser"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtstemplate"></member>
- <member><xref linkend="sql-droptstemplate"></member>
+ <member><xref linkend="sql-createtstemplate"/></member>
+ <member><xref linkend="sql-droptstemplate"/></member>
</simplelist>
</refsect1>
</refentry>
<listitem>
<para>
This form adds a new attribute to a composite type, using the same syntax as
- <xref linkend="sql-createtype">.
+ <xref linkend="sql-createtype"/>.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtype"></member>
- <member><xref linkend="sql-droptype"></member>
+ <member><xref linkend="sql-createtype"/></member>
+ <member><xref linkend="sql-droptype"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<command>ALTER USER</command> is now an alias for
- <xref linkend="sql-alterrole">.
+ <xref linkend="sql-alterrole"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterrole"></member>
+ <member><xref linkend="sql-alterrole"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createusermapping"></member>
- <member><xref linkend="sql-dropusermapping"></member>
+ <member><xref linkend="sql-createusermapping"/></member>
+ <member><xref linkend="sql-dropusermapping"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createview"></member>
- <member><xref linkend="sql-dropview"></member>
+ <member><xref linkend="sql-createview"/></member>
+ <member><xref linkend="sql-dropview"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
In the default <productname>PostgreSQL</productname> configuration,
- the autovacuum daemon (see <xref linkend="autovacuum">)
+ the autovacuum daemon (see <xref linkend="autovacuum"/>)
takes care of automatic analyzing of tables when they are first loaded
with data, and as they change throughout regular operation.
When autovacuum is disabled,
just after making major changes in the contents of a table. Accurate
statistics will help the planner to choose the most appropriate query
plan, and thereby improve the speed of query processing. A common
- strategy for read-mostly databases is to run <xref linkend="sql-vacuum">
+ strategy for read-mostly databases is to run <xref linkend="sql-vacuum"/>
and <command>ANALYZE</command> once a day during a low-usage time of day.
(This will not be sufficient if there is heavy update activity.)
</para>
in a unique-key column, there are no common values) or if the
column data type does not support the appropriate operators. There
is more information about the statistics in <xref
- linkend="maintenance">.
+ linkend="maintenance"/>.
</para>
<para>
will change slightly each time <command>ANALYZE</command> is run,
even if the actual table contents did not change. This might result
in small changes in the planner's estimated costs shown by
- <xref linkend="sql-explain">.
+ <xref linkend="sql-explain"/>.
In rare situations, this non-determinism will cause the planner's
choices of query plans to change after <command>ANALYZE</command> is run.
To avoid this, raise the amount of statistics collected by
<para>
The extent of analysis can be controlled by adjusting the
- <xref linkend="guc-default-statistics-target"> configuration variable, or
+ <xref linkend="guc-default-statistics-target"/> configuration variable, or
on a column-by-column basis by setting the per-column statistics
target with <command>ALTER TABLE ... ALTER COLUMN ... SET
- STATISTICS</command> (see <xref linkend="sql-altertable">).
+ STATISTICS</command> (see <xref linkend="sql-altertable"/>).
The target value sets the
maximum number of entries in the most-common-value list and the
maximum number of bins in the histogram. The default target value
bad query plans, a more accurate value can be determined manually and then
installed with
<command>ALTER TABLE ... ALTER COLUMN ... SET (n_distinct = ...)</command>
- (see <xref linkend="sql-altertable">).
+ (see <xref linkend="sql-altertable"/>).
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-vacuum"></member>
- <member><xref linkend="app-vacuumdb"></member>
- <member><xref linkend="runtime-config-resource-vacuum-cost"></member>
- <member><xref linkend="autovacuum"></member>
+ <member><xref linkend="sql-vacuum"/></member>
+ <member><xref linkend="app-vacuumdb"/></member>
+ <member><xref linkend="runtime-config-resource-vacuum-cost"/></member>
+ <member><xref linkend="autovacuum"/></member>
</simplelist>
</refsect1>
</refentry>
<command>BEGIN</command> initiates a transaction block, that is,
all statements after a <command>BEGIN</command> command will be
executed in a single transaction until an explicit <xref
- linkend="sql-commit"> or <xref
- linkend="sql-rollback"> is given.
+ linkend="sql-commit"/> or <xref
+ linkend="sql-rollback"/> is given.
By default (without <command>BEGIN</command>),
<productname>PostgreSQL</productname> executes
transactions in <quote>autocommit</quote> mode, that is, each
<para>
If the isolation level, read/write mode, or deferrable mode is specified, the new
transaction has those characteristics, as if
- <xref linkend="sql-set-transaction">
+ <xref linkend="sql-set-transaction"/>
was executed.
</para>
</refsect1>
</variablelist>
<para>
- Refer to <xref linkend="sql-set-transaction"> for information on the meaning
+ Refer to <xref linkend="sql-set-transaction"/> for information on the meaning
of the other parameters to this statement.
</para>
</refsect1>
<title>Notes</title>
<para>
- <xref linkend="sql-start-transaction"> has the same functionality
+ <xref linkend="sql-start-transaction"/> has the same functionality
as <command>BEGIN</command>.
</para>
<para>
- Use <xref linkend="sql-commit"> or
- <xref linkend="sql-rollback">
+ Use <xref linkend="sql-commit"/> or
+ <xref linkend="sql-rollback"/>
to terminate a transaction block.
</para>
Issuing <command>BEGIN</command> when already inside a transaction block will
provoke a warning message. The state of the transaction is not affected.
To nest transactions within a transaction block, use savepoints
- (see <xref linkend="sql-savepoint">).
+ (see <xref linkend="sql-savepoint"/>).
</para>
<para>
<para>
<command>BEGIN</command> is a <productname>PostgreSQL</productname>
language extension. It is equivalent to the SQL-standard command
- <xref linkend="sql-start-transaction">, whose reference page
+ <xref linkend="sql-start-transaction"/>, whose reference page
contains additional compatibility information.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-rollback"></member>
- <member><xref linkend="sql-start-transaction"></member>
- <member><xref linkend="sql-savepoint"></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-rollback"/></member>
+ <member><xref linkend="sql-start-transaction"/></member>
+ <member><xref linkend="sql-savepoint"/></member>
</simplelist>
</refsect1>
</refentry>
A checkpoint is a point in the write-ahead log sequence at which
all data files have been updated to reflect the information in the
log. All data files will be flushed to disk. Refer to
- <xref linkend="wal-configuration"> for more details about what happens
+ <xref linkend="wal-configuration"/> for more details about what happens
during a checkpoint.
</para>
The <command>CHECKPOINT</command> command forces an immediate
checkpoint when the command is issued, without waiting for a
regular checkpoint scheduled by the system (controlled by the settings in
- <xref linkend="runtime-config-wal-checkpoints">).
+ <xref linkend="runtime-config-wal-checkpoints"/>).
<command>CHECKPOINT</command> is not intended for use during normal
operation.
</para>
<para>
If executed during recovery, the <command>CHECKPOINT</command> command
- will force a restartpoint (see <xref linkend="wal-configuration">)
+ will force a restartpoint (see <xref linkend="wal-configuration"/>)
rather than writing a new checkpoint.
</para>
<productname>PostgreSQL</productname> does not have an explicit
<command>OPEN</command> cursor statement; a cursor is considered
open when it is declared. Use the
- <xref linkend="sql-declare">
+ <xref linkend="sql-declare"/>
statement to declare a cursor.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-declare"></member>
- <member><xref linkend="sql-fetch"></member>
- <member><xref linkend="sql-move"></member>
+ <member><xref linkend="sql-declare"/></member>
+ <member><xref linkend="sql-fetch"/></member>
+ <member><xref linkend="sql-move"/></member>
</simplelist>
</refsect1>
</refentry>
<command>CLUSTER <replaceable class="parameter">table_name</replaceable></command>
reclusters the table using the same index as before. You can also
use the <literal>CLUSTER</literal> or <literal>SET WITHOUT CLUSTER</literal>
- forms of <xref linkend="sql-altertable"> to set the index to be used for
+ forms of <xref linkend="sql-altertable"/> to set the index to be used for
future cluster operations, or to clear any previous setting.
</para>
as double the table size, plus the index sizes. This method is often
faster than the index scan method, but if the disk space requirement is
intolerable, you can disable this choice by temporarily setting <xref
- linkend="guc-enable-sort"> to <literal>off</literal>.
+ linkend="guc-enable-sort"/> to <literal>off</literal>.
</para>
<para>
- It is advisable to set <xref linkend="guc-maintenance-work-mem"> to
+ It is advisable to set <xref linkend="guc-maintenance-work-mem"/> to
a reasonably large value (but not more than the amount of RAM you can
dedicate to the <command>CLUSTER</command> operation) before clustering.
</para>
<para>
Because the planner records statistics about the ordering of
- tables, it is advisable to run <xref linkend="sql-analyze">
+ tables, it is advisable to run <xref linkend="sql-analyze"/>
on the newly clustered table.
Otherwise, the planner might make poor choices of query plans.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-clusterdb"></member>
+ <member><xref linkend="app-clusterdb"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<application>clusterdb</application> is a wrapper around the SQL
- command <xref linkend="sql-cluster">.
+ command <xref linkend="sql-cluster"/>.
There is no effective difference between clustering databases via
this utility and via other methods for accessing the server.
</para>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-cluster">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-cluster"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-cluster"></member>
+ <member><xref linkend="sql-cluster"/></member>
</simplelist>
</refsect1>
the same built-in functions that <application>psql</application> uses, namely
<function>obj_description</function>, <function>col_description</function>,
and <function>shobj_description</function>
- (see <xref linkend="functions-info-comment-table">).
+ (see <xref linkend="functions-info-comment-table"/>).
</para>
</refsect1>
<title>Notes</title>
<para>
- Use <xref linkend="sql-rollback"> to
+ Use <xref linkend="sql-rollback"/> to
abort a transaction.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-rollback"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-rollback"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-prepare-transaction"></member>
- <member><xref linkend="sql-rollback-prepared"></member>
+ <member><xref linkend="sql-prepare-transaction"/></member>
+ <member><xref linkend="sql-rollback-prepared"/></member>
</simplelist>
</refsect1>
<term><replaceable class="parameter">query</replaceable></term>
<listitem>
<para>
- A <xref linkend="sql-select">, <xref linkend="sql-values">,
- <xref linkend="sql-insert">, <xref linkend="sql-update"> or
- <xref linkend="sql-delete"> command whose results are to be
+ A <xref linkend="sql-select"/>, <xref linkend="sql-values"/>,
+ <xref linkend="sql-insert"/>, <xref linkend="sql-update"/> or
+ <xref linkend="sql-delete"/> command whose results are to be
copied. Note that parentheses are required around the query.
</para>
<para>
for <literal>INDEX</literal> access methods, it must
be <type>index_am_handler</type>. The C-level API that the handler
function must implement varies depending on the type of access method.
- The index access method API is described in <xref linkend="indexam">.
+ The index access method API is described in <xref linkend="indexam"/>.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-drop-access-method"></member>
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-createopfamily"></member>
+ <member><xref linkend="sql-drop-access-method"/></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-createopfamily"/></member>
</simplelist>
</refsect1>
<command>CREATE AGGREGATE</command> defines a new aggregate
function. Some basic and commonly-used aggregate functions are
included with the distribution; they are documented in <xref
- linkend="functions-aggregate">. If one defines new types or needs
+ linkend="functions-aggregate"/>. If one defines new types or needs
an aggregate function not already provided, then <command>CREATE
AGGREGATE</command> can be used to provide the desired features.
</para>
the name and input data type(s) of every ordinary function in the same
schema.
This behavior is identical to overloading of ordinary function names
- (see <xref linkend="sql-createfunction">).
+ (see <xref linkend="sql-createfunction"/>).
</para>
<para>
<para>
An aggregate can optionally support <firstterm>moving-aggregate mode</firstterm>,
- as described in <xref linkend="xaggr-moving-aggregates">. This requires
+ as described in <xref linkend="xaggr-moving-aggregates"/>. This requires
specifying the <literal>MSFUNC</literal>, <literal>MINVFUNC</literal>,
and <literal>MSTYPE</literal> parameters, and optionally
the <literal>MSPACE</literal>, <literal>MFINALFUNC</literal>,
<para>
An aggregate can optionally support <firstterm>partial aggregation</firstterm>,
- as described in <xref linkend="xaggr-partial-aggregates">.
+ as described in <xref linkend="xaggr-partial-aggregates"/>.
This requires specifying the <literal>COMBINEFUNC</literal> parameter.
If the <replaceable class="parameter">state_data_type</replaceable>
is <type>internal</type>, it's usually also appropriate to provide the
The planner uses this value to estimate the memory required for a
grouped aggregate query. The planner will consider using hash
aggregation for such a query only if the hash table is estimated to fit
- in <xref linkend="guc-work-mem">; therefore, large values of this
+ in <xref linkend="guc-work-mem"/>; therefore, large values of this
parameter discourage use of hash aggregation.
</para>
</listitem>
that does not modify its arguments. <literal>READ_ONLY</literal> indicates
it does not; the other two values indicate that it may change the
transition state value. See <xref linkend="sql-createaggregate-notes"
- endterm="sql-createaggregate-notes-title"> below for more detail. The
+ endterm="sql-createaggregate-notes-title"/> below for more detail. The
default is <literal>READ_ONLY</literal>, except for ordered-set aggregates,
for which the default is <literal>READ_WRITE</literal>.
</para>
<para>
The meanings of <literal>PARALLEL SAFE</literal>, <literal>PARALLEL
RESTRICTED</literal>, and <literal>PARALLEL UNSAFE</literal> are the same as
- in <xref linkend="sql-createfunction">. An aggregate will not be
+ in <xref linkend="sql-createfunction"/>. An aggregate will not be
considered for parallelization if it is marked <literal>PARALLEL
UNSAFE</literal> (which is the default!) or <literal>PARALLEL RESTRICTED</literal>.
Note that the parallel-safety markings of the aggregate's support
<title>Examples</title>
<para>
- See <xref linkend="xaggr">.
+ See <xref linkend="xaggr"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteraggregate"></member>
- <member><xref linkend="sql-dropaggregate"></member>
+ <member><xref linkend="sql-alteraggregate"/></member>
+ <member><xref linkend="sql-dropaggregate"/></member>
</simplelist>
</refsect1>
</refentry>
ambiguity that cannot be avoided as above. The parser has a fallback
heuristic based on <firstterm>type categories</firstterm> and <firstterm>preferred
types</firstterm> that can help to provide desired behavior in such cases. See
- <xref linkend="sql-createtype"> for
+ <xref linkend="sql-createtype"/> for
more information.
</para>
</note>
<title>Notes</title>
<para>
- Use <xref linkend="sql-dropcast"> to remove user-defined casts.
+ Use <xref linkend="sql-dropcast"/> to remove user-defined casts.
</para>
<para>
<title>See Also</title>
<para>
- <xref linkend="sql-createfunction">,
- <xref linkend="sql-createtype">,
- <xref linkend="sql-dropcast">
+ <xref linkend="sql-createfunction"/>,
+ <xref linkend="sql-createtype"/>,
+ <xref linkend="sql-dropcast"/>
</para>
</refsect1>
</para>
<para>
- See also <xref linkend="sql-altercollation"> for how to handle
+ See also <xref linkend="sql-altercollation"/> for how to handle
collation version mismatches.
</para>
</listitem>
</para>
<para>
- See <xref linkend="collation-create"> for more information on how to create collations.
+ See <xref linkend="collation-create"/> for more information on how to create collations.
</para>
<para>
When using the <literal>libc</literal> collation provider, the locale must
be applicable to the current database encoding.
- See <xref linkend="sql-createdatabase"> for the precise rules.
+ See <xref linkend="sql-createdatabase"/> for the precise rules.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altercollation"></member>
- <member><xref linkend="sql-dropcollation"></member>
+ <member><xref linkend="sql-altercollation"/></member>
+ <member><xref linkend="sql-dropcollation"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterconversion"></member>
- <member><xref linkend="sql-createfunction"></member>
- <member><xref linkend="sql-dropconversion"></member>
+ <member><xref linkend="sql-alterconversion"/></member>
+ <member><xref linkend="sql-createfunction"/></member>
+ <member><xref linkend="sql-dropconversion"/></member>
</simplelist>
</refsect1>
<para>
To create a database, you must be a superuser or have the special
<literal>CREATEDB</literal> privilege.
- See <xref linkend="sql-createrole">.
+ See <xref linkend="sql-createrole"/>.
</para>
<para>
to use the default encoding (namely, the encoding of the
template database). The character sets supported by the
<productname>PostgreSQL</productname> server are described in
- <xref linkend="multibyte-charset-supported">. See below for
+ <xref linkend="multibyte-charset-supported"/>. See below for
additional restrictions.
</para>
</listitem>
template database's tablespace. This
tablespace will be the default tablespace used for objects
created in this database. See
- <xref linkend="sql-createtablespace">
+ <xref linkend="sql-createtablespace"/>
for more information.
</para>
</listitem>
</para>
<para>
- Use <xref linkend="sql-dropdatabase"> to remove a database.
+ Use <xref linkend="sql-dropdatabase"/> to remove a database.
</para>
<para>
- The program <xref linkend="app-createdb"> is a
+ The program <xref linkend="app-createdb"/> is a
wrapper program around this command, provided for convenience.
</para>
<para>
Database-level configuration parameters (set via <xref
- linkend="sql-alterdatabase">) are not copied from the template
+ linkend="sql-alterdatabase"/>) are not copied from the template
database.
</para>
DATABASE</command> will fail if any other connection exists when it starts;
otherwise, new connections to the template database are locked out
until <command>CREATE DATABASE</command> completes.
- See <xref linkend="manage-ag-templatedbs"> for more information.
+ See <xref linkend="manage-ag-templatedbs"/> for more information.
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterdatabase"></member>
- <member><xref linkend="sql-dropdatabase"></member>
+ <member><xref linkend="sql-alterdatabase"/></member>
+ <member><xref linkend="sql-dropdatabase"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterdomain"></member>
- <member><xref linkend="sql-dropdomain"></member>
+ <member><xref linkend="sql-alterdomain"/></member>
+ <member><xref linkend="sql-dropdomain"/></member>
</simplelist>
</refsect1>
Whenever the designated event occurs and the <literal>WHEN</literal> condition
associated with the trigger, if any, is satisfied, the trigger function
will be executed. For a general introduction to event triggers, see
- <xref linkend="event-triggers">. The user who creates an event trigger
+ <xref linkend="event-triggers"/>. The user who creates an event trigger
becomes its owner.
</para>
</refsect1>
<listitem>
<para>
The name of the event that triggers a call to the given function.
- See <xref linkend="event-trigger-definition"> for more information
+ See <xref linkend="event-trigger-definition"/> for more information
on event names.
</para>
</listitem>
<para>
Event triggers are disabled in single-user mode (see <xref
- linkend="app-postgres">). If an erroneous event trigger disables the
+ linkend="app-postgres"/>). If an erroneous event trigger disables the
database so much that you can't even drop the trigger, restart in
single-user mode and you'll be able to do that.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altereventtrigger"></member>
- <member><xref linkend="sql-dropeventtrigger"></member>
- <member><xref linkend="sql-createfunction"></member>
+ <member><xref linkend="sql-altereventtrigger"/></member>
+ <member><xref linkend="sql-dropeventtrigger"/></member>
+ <member><xref linkend="sql-createfunction"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
For information about writing new extensions, see
- <xref linkend="extend-extensions">.
+ <xref linkend="extend-extensions"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterextension"></member>
- <member><xref linkend="sql-dropextension"></member>
+ <member><xref linkend="sql-alterextension"/></member>
+ <member><xref linkend="sql-dropextension"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterforeigndatawrapper"></member>
- <member><xref linkend="sql-dropforeigndatawrapper"></member>
- <member><xref linkend="sql-createserver"></member>
- <member><xref linkend="sql-createusermapping"></member>
- <member><xref linkend="sql-createforeigntable"></member>
+ <member><xref linkend="sql-alterforeigndatawrapper"/></member>
+ <member><xref linkend="sql-dropforeigndatawrapper"/></member>
+ <member><xref linkend="sql-createserver"/></member>
+ <member><xref linkend="sql-createusermapping"/></member>
+ <member><xref linkend="sql-createforeigntable"/></member>
</simplelist>
</refsect1>
The data type of the column. This can include array
specifiers. For more information on the data types supported by
<productname>PostgreSQL</productname>, refer to <xref
- linkend="datatype">.
+ linkend="datatype"/>.
</para>
</listitem>
</varlistentry>
tables from which the new foreign table automatically inherits
all columns. Parent tables can be plain tables or foreign tables.
See the similar form of
- <xref linkend="sql-createtable"> for more details.
+ <xref linkend="sql-createtable"/> for more details.
</para>
</listitem>
</varlistentry>
<para>
The name of an existing foreign server to use for the foreign table.
For details on defining a server, see <xref
- linkend="sql-createserver">.
+ linkend="sql-createserver"/>.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterforeigntable"></member>
- <member><xref linkend="sql-dropforeigntable"></member>
- <member><xref linkend="sql-createtable"></member>
- <member><xref linkend="sql-createserver"></member>
- <member><xref linkend="sql-importforeignschema"></member>
+ <member><xref linkend="sql-alterforeigntable"/></member>
+ <member><xref linkend="sql-dropforeigntable"/></member>
+ <member><xref linkend="sql-createtable"/></member>
+ <member><xref linkend="sql-createserver"/></member>
+ <member><xref linkend="sql-importforeignschema"/></member>
</simplelist>
</refsect1>
</refentry>
name of an input argument is just extra documentation, so far as
the function itself is concerned; but you can use input argument names
when calling a function to improve readability (see <xref
- linkend="sql-syntax-calling-funcs">). In any case, the name
+ linkend="sql-syntax-calling-funcs"/>). In any case, the name
of an output argument is significant, because it defines the column
name in the result row type. (If you omit the name for an output
argument, the system will choose a default column name.)
<para>
Lists which transforms a call to the function should apply. Transforms
convert between SQL types and language-specific data types;
- see <xref linkend="sql-createtransform">. Procedural language
+ see <xref linkend="sql-createtransform"/>. Procedural language
implementations usually have hardcoded knowledge of the built-in types,
so those don't need to be listed here. If a procedural language
implementation does not know how to handle a type and no transform is
</para>
<para>
- For additional details see <xref linkend="xfunc-volatility">.
+ For additional details see <xref linkend="xfunc-volatility"/>.
</para>
</listitem>
</varlistentry>
In addition, functions which do not take arguments or which are not
passed any arguments from the security barrier view or table do not have
to be marked as leakproof to be executed before security conditions. See
- <xref linkend="sql-createview"> and <xref linkend="rules-privileges">.
+ <xref linkend="sql-createview"/> and <xref linkend="rules-privileges"/>.
This option can only be set by the superuser.
</para>
</listitem>
<listitem>
<para>
A positive number giving the estimated execution cost for the function,
- in units of <xref linkend="guc-cpu-operator-cost">. If the function
+ in units of <xref linkend="guc-cpu-operator-cost"/>. If the function
returns a set, this is the cost per returned row. If the cost is
not specified, 1 unit is assumed for C-language and internal functions,
and 100 units for functions in all other languages. Larger values
</para>
<para>
- See <xref linkend="sql-set"> and
- <xref linkend="runtime-config">
+ See <xref linkend="sql-set"/> and
+ <xref linkend="runtime-config"/>
for more information about allowed parameter names and values.
</para>
</listitem>
<para>
It is often helpful to use dollar quoting (see <xref
- linkend="sql-syntax-dollar-quoting">) to write the function definition
+ linkend="sql-syntax-dollar-quoting"/>) to write the function definition
string, rather than the normal single quote syntax. Without dollar
quoting, any single quotes or backslashes in the function definition must
be escaped by doubling them.
the SQL function. The string <replaceable
class="parameter">obj_file</replaceable> is the name of the shared
library file containing the compiled C function, and is interpreted
- as for the <xref linkend="sql-load"> command. The string
+ as for the <xref linkend="sql-load"/> command. The string
<replaceable class="parameter">link_symbol</replaceable> is the
function's link symbol, that is, the name of the function in the C
language source code. If the link symbol is omitted, it is assumed
</variablelist>
<para>
- Refer to <xref linkend="xfunc"> for further information on writing
+ Refer to <xref linkend="xfunc"/> for further information on writing
functions.
</para>
<para>
Here are some trivial examples to help you get started. For more
- information and examples, see <xref linkend="xfunc">.
+ information and examples, see <xref linkend="xfunc"/>.
<programlisting>
CREATE FUNCTION add(integer, integer) RETURNS integer
AS 'select $1 + $2;'
Because a <literal>SECURITY DEFINER</literal> function is executed
with the privileges of the user that owns it, care is needed to
ensure that the function cannot be misused. For security,
- <xref linkend="guc-search-path"> should be set to exclude any schemas
+ <xref linkend="guc-search-path"/> should be set to exclude any schemas
writable by untrusted users. This prevents
malicious users from creating objects (e.g., tables, functions, and
operators) that mask objects intended to be used by the function.
<para>
Another point to keep in mind is that by default, execute privilege
is granted to <literal>PUBLIC</literal> for newly created functions
- (see <xref linkend="sql-grant"> for more
+ (see <xref linkend="sql-grant"/> for more
information). Frequently you will wish to restrict use of a security
definer function to only some users. To do that, you must revoke
the default <literal>PUBLIC</literal> privileges and then grant execute
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterfunction"></member>
- <member><xref linkend="sql-dropfunction"></member>
- <member><xref linkend="sql-grant"></member>
- <member><xref linkend="sql-load"></member>
- <member><xref linkend="sql-revoke"></member>
+ <member><xref linkend="sql-alterfunction"/></member>
+ <member><xref linkend="sql-dropfunction"/></member>
+ <member><xref linkend="sql-grant"/></member>
+ <member><xref linkend="sql-load"/></member>
+ <member><xref linkend="sql-revoke"/></member>
</simplelist>
</refsect1>
<para>
<command>CREATE GROUP</command> is now an alias for
- <xref linkend="sql-createrole">.
+ <xref linkend="sql-createrole"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createrole"></member>
+ <member><xref linkend="sql-createrole"/></member>
</simplelist>
</refsect1>
</refentry>
can improve performance by creating an index on just that portion.
Another possible application is to use <literal>WHERE</literal> with
<literal>UNIQUE</literal> to enforce uniqueness over a subset of a
- table. See <xref linkend="indexes-partial"> for more discussion.
+ table. See <xref linkend="indexes-partial"/> for more discussion.
</para>
<para>
locks out writes (but not reads) on the table until it's done.
There are several caveats to be aware of when using this option
— see <xref linkend="sql-createindex-concurrently"
- endterm="sql-createindex-concurrently-title">.
+ endterm="sql-createindex-concurrently-title"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The name of an index-method-specific storage parameter. See
- <xref linkend="sql-createindex-storage-parameters" endterm="sql-createindex-storage-parameters-title">
+ <xref linkend="sql-createindex-storage-parameters" endterm="sql-createindex-storage-parameters-title"/>
for details.
</para>
</listitem>
<listitem>
<para>
The tablespace in which to create the index. If not specified,
- <xref linkend="guc-default-tablespace"> is consulted, or
- <xref linkend="guc-temp-tablespaces"> for indexes on temporary
+ <xref linkend="guc-default-tablespace"/> is consulted, or
+ <xref linkend="guc-temp-tablespaces"/> for indexes on temporary
tables.
</para>
</listitem>
<listitem>
<para>
Determines whether the buffering build technique described in
- <xref linkend="gist-buffering-build"> is used to build the index. With
+ <xref linkend="gist-buffering-build"/> is used to build the index. With
<literal>OFF</literal> it is disabled, with <literal>ON</literal> it is enabled, and
with <literal>AUTO</literal> it is initially disabled, but turned on
- on-the-fly once the index size reaches <xref linkend="guc-effective-cache-size">. The default is <literal>AUTO</literal>.
+ on-the-fly once the index size reaches <xref linkend="guc-effective-cache-size"/>. The default is <literal>AUTO</literal>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
This setting controls usage of the fast update technique described in
- <xref linkend="gin-fast-update">. It is a Boolean parameter:
+ <xref linkend="gin-fast-update"/>. It is a Boolean parameter:
<literal>ON</literal> enables fast update, <literal>OFF</literal> disables it.
(Alternative spellings of <literal>ON</literal> and <literal>OFF</literal> are
- allowed as described in <xref linkend="config-setting">.) The
+ allowed as described in <xref linkend="config-setting"/>.) The
default is <literal>ON</literal>.
</para>
<term><literal>gin_pending_list_limit</literal></term>
<listitem>
<para>
- Custom <xref linkend="guc-gin-pending-list-limit"> parameter.
+ Custom <xref linkend="guc-gin-pending-list-limit"/> parameter.
This value is specified in kilobytes.
</para>
</listitem>
<listitem>
<para>
Defines the number of table blocks that make up one block range for
- each entry of a <acronym>BRIN</acronym> index (see <xref linkend="brin-intro">
+ each entry of a <acronym>BRIN</acronym> index (see <xref linkend="brin-intro"/>
for more details). The default is <literal>128</literal>.
</para>
</listitem>
two more transactions. Before each table scan, the index build must
wait for existing transactions that have modified the table to terminate.
After the second scan, the index build must wait for any transactions
- that have a snapshot (see <xref linkend="mvcc">) predating the second
+ that have a snapshot (see <xref linkend="mvcc"/>) predating the second
scan to terminate. Then finally the index can be marked ready for use,
and the <command>CREATE INDEX</command> command terminates.
Even then, however, the index may not be immediately usable for queries:
<title>Notes</title>
<para>
- See <xref linkend="indexes"> for information about when indexes can
+ See <xref linkend="indexes"/> for information about when indexes can
be used, when they are not used, and in which particular situations
they can be useful.
</para>
type either by absolute value or by real part. We could do this by
defining two operator classes for the data type and then selecting
the proper class when making an index. More information about
- operator classes is in <xref linkend="indexes-opclass"> and in <xref
- linkend="xindex">.
+ operator classes is in <xref linkend="indexes-opclass"/> and in <xref
+ linkend="xindex"/>.
</para>
<para>
<para>
For most index methods, the speed of creating an index is
- dependent on the setting of <xref linkend="guc-maintenance-work-mem">.
+ dependent on the setting of <xref linkend="guc-maintenance-work-mem"/>.
Larger values will reduce the time needed for index creation, so long
as you don't make it larger than the amount of memory really available,
which would drive the machine into swapping.
</para>
<para>
- Use <xref linkend="sql-dropindex">
+ Use <xref linkend="sql-dropindex"/>
to remove an index.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterindex"></member>
- <member><xref linkend="sql-dropindex"></member>
+ <member><xref linkend="sql-alterindex"/></member>
+ <member><xref linkend="sql-dropindex"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
As of <productname>PostgreSQL</productname> 9.1, most procedural
languages have been made into <quote>extensions</quote>, and should
- therefore be installed with <xref linkend="sql-createextension">
+ therefore be installed with <xref linkend="sql-createextension"/>
not <command>CREATE LANGUAGE</command>. Direct use of
<command>CREATE LANGUAGE</command> should now be confined to
extension installation scripts. If you have a <quote>bare</quote>
<para>
<command>CREATE LANGUAGE</command> effectively associates the
language name with handler function(s) that are responsible for executing
- functions written in the language. Refer to <xref linkend="plhandler">
+ functions written in the language. Refer to <xref linkend="plhandler"/>
for more information about language handlers.
</para>
<para><replaceable class="parameter">inline_handler</replaceable> is the
name of a previously registered function that will be called
to execute an anonymous code block
- (<xref linkend="sql-do"> command)
+ (<xref linkend="sql-do"/> command)
in this language.
If no <replaceable class="parameter">inline_handler</replaceable>
function is specified, the language does not support anonymous code
<title>Notes</title>
<para>
- Use <xref linkend="sql-droplanguage"> to drop procedural languages.
+ Use <xref linkend="sql-droplanguage"/> to drop procedural languages.
</para>
<para>
The system catalog <classname>pg_language</classname> (see <xref
- linkend="catalog-pg-language">) records information about the
+ linkend="catalog-pg-language"/>) records information about the
currently installed languages. Also, the <application>psql</application>
command <command>\dL</command> lists the installed languages.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterlanguage"></member>
- <member><xref linkend="sql-createfunction"></member>
- <member><xref linkend="sql-droplanguage"></member>
- <member><xref linkend="sql-grant"></member>
- <member><xref linkend="sql-revoke"></member>
+ <member><xref linkend="sql-alterlanguage"/></member>
+ <member><xref linkend="sql-createfunction"/></member>
+ <member><xref linkend="sql-droplanguage"/></member>
+ <member><xref linkend="sql-grant"/></member>
+ <member><xref linkend="sql-revoke"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
This clause specifies optional storage parameters for the new
materialized view; see <xref linkend="sql-createtable-storage-parameters"
- endterm="sql-createtable-storage-parameters-title"> for more
+ endterm="sql-createtable-storage-parameters-title"/> for more
information. All parameters supported for <literal>CREATE
TABLE</literal> are also supported for <literal>CREATE MATERIALIZED
VIEW</literal> with the exception of <literal>OIDS</literal>.
- See <xref linkend="sql-createtable"> for more information.
+ See <xref linkend="sql-createtable"/> for more information.
</para>
</listitem>
</varlistentry>
<para>
The <replaceable class="parameter">tablespace_name</replaceable> is the name
of the tablespace in which the new materialized view is to be created.
- If not specified, <xref linkend="guc-default-tablespace"> is consulted.
+ If not specified, <xref linkend="guc-default-tablespace"/> is consulted.
</para>
</listitem>
</varlistentry>
<term><replaceable>query</replaceable></term>
<listitem>
<para>
- A <xref linkend="sql-select">, <link linkend="sql-table">TABLE</link>,
- or <xref linkend="sql-values"> command. This query will run within a
+ A <xref linkend="sql-select"/>, <link linkend="sql-table">TABLE</link>,
+ or <xref linkend="sql-values"/> command. This query will run within a
security-restricted operation; in particular, calls to functions that
themselves create temporary tables will fail.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altermaterializedview"></member>
- <member><xref linkend="sql-createtableas"></member>
- <member><xref linkend="sql-createview"></member>
- <member><xref linkend="sql-dropmaterializedview"></member>
- <member><xref linkend="sql-refreshmaterializedview"></member>
+ <member><xref linkend="sql-altermaterializedview"/></member>
+ <member><xref linkend="sql-createtableas"/></member>
+ <member><xref linkend="sql-createview"/></member>
+ <member><xref linkend="sql-dropmaterializedview"/></member>
+ <member><xref linkend="sql-refreshmaterializedview"/></member>
</simplelist>
</refsect1>
</para>
<para>
- Refer to <xref linkend="xindex"> for further information.
+ Refer to <xref linkend="xindex"/> for further information.
</para>
</refsect1>
<para>
The following example command defines a GiST index operator class
for the data type <literal>_int4</literal> (array of <type>int4</type>). See the
- <xref linkend="intarray"> module for the complete example.
+ <xref linkend="intarray"/> module for the complete example.
</para>
<programlisting>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteropclass"></member>
- <member><xref linkend="sql-dropopclass"></member>
- <member><xref linkend="sql-createopfamily"></member>
- <member><xref linkend="sql-alteropfamily"></member>
+ <member><xref linkend="sql-alteropclass"/></member>
+ <member><xref linkend="sql-dropopclass"/></member>
+ <member><xref linkend="sql-createopfamily"/></member>
+ <member><xref linkend="sql-alteropfamily"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The other clauses specify optional operator optimization clauses.
- Their meaning is detailed in <xref linkend="xoper-optimization">.
+ Their meaning is detailed in <xref linkend="xoper-optimization"/>.
</para>
<para>
<title>Notes</title>
<para>
- Refer to <xref linkend="xoper"> for further information.
+ Refer to <xref linkend="xoper"/> for further information.
</para>
<para>
It is not possible to specify an operator's lexical precedence in
<command>CREATE OPERATOR</command>, because the parser's precedence behavior
- is hard-wired. See <xref linkend="sql-precedence"> for precedence details.
+ is hard-wired. See <xref linkend="sql-precedence"/> for precedence details.
</para>
<para>
</para>
<para>
- Use <xref linkend="sql-dropoperator"> to delete user-defined operators
- from a database. Use <xref linkend="sql-alteroperator"> to modify operators in a
+ Use <xref linkend="sql-dropoperator"/> to delete user-defined operators
+ from a database. Use <xref linkend="sql-alteroperator"/> to modify operators in a
database.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteroperator"></member>
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-dropoperator"></member>
+ <member><xref linkend="sql-alteroperator"/></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-dropoperator"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- Refer to <xref linkend="xindex"> for further information.
+ Refer to <xref linkend="xindex"/> for further information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteropfamily"></member>
- <member><xref linkend="sql-dropopfamily"></member>
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-alteropclass"></member>
- <member><xref linkend="sql-dropopclass"></member>
+ <member><xref linkend="sql-alteropfamily"/></member>
+ <member><xref linkend="sql-dropopfamily"/></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-alteropclass"/></member>
+ <member><xref linkend="sql-dropopclass"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
Additional discussion and practical examples can be found
- in <xref linkend="ddl-rowsecurity">.
+ in <xref linkend="ddl-rowsecurity"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterpolicy"></member>
- <member><xref linkend="sql-droppolicy"></member>
- <member><xref linkend="sql-altertable"></member>
+ <member><xref linkend="sql-alterpolicy"/></member>
+ <member><xref linkend="sql-droppolicy"/></member>
+ <member><xref linkend="sql-altertable"/></member>
</simplelist>
</refsect1>
<para>
A publication is essentially a group of tables whose data changes are
intended to be replicated through logical replication. See
- <xref linkend="logical-replication-publication"> for details about how
+ <xref linkend="logical-replication-publication"/> for details about how
publications fit into the logical replication setup.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterpublication"></member>
- <member><xref linkend="sql-droppublication"></member>
+ <member><xref linkend="sql-alterpublication"/></member>
+ <member><xref linkend="sql-droppublication"/></member>
</simplelist>
</refsect1>
</refentry>
an entity that can own database objects and have database privileges;
a role can be considered a <quote>user</quote>, a <quote>group</quote>, or both
depending on how it is used. Refer to
- <xref linkend="user-manag"> and <xref
- linkend="client-authentication"> for information about managing
+ <xref linkend="user-manag"/> and <xref
+ linkend="client-authentication"/> for information about managing
users and authentication. You must have <literal>CREATEROLE</literal>
privilege or be a database superuser to use this command.
</para>
If not specified,
<literal>NOLOGIN</literal> is the default, except when
<command>CREATE ROLE</command> is invoked through its alternative spelling
- <xref linkend="sql-createuser">.
+ <xref linkend="sql-createuser"/>.
</para>
</listitem>
</varlistentry>
The password is always stored encrypted in the system catalogs. The
<literal>ENCRYPTED</literal> keyword has no effect, but is accepted for
backwards compatibility. The method of encryption is determined
- by the configuration parameter <xref linkend="guc-password-encryption">.
+ by the configuration parameter <xref linkend="guc-password-encryption"/>.
If the presented password string is already in MD5-encrypted or
SCRAM-encrypted format, then it is stored as-is regardless of
<varname>password_encryption</varname> (since the system cannot decrypt
<title>Notes</title>
<para>
- Use <xref linkend="sql-alterrole"> to
- change the attributes of a role, and <xref linkend="sql-droprole">
+ Use <xref linkend="sql-alterrole"/> to
+ change the attributes of a role, and <xref linkend="sql-droprole"/>
to remove a role. All the attributes
specified by <command>CREATE ROLE</command> can be modified by later
<command>ALTER ROLE</command> commands.
<para>
The preferred way to add and remove members of roles that are being
used as groups is to use
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">.
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>.
</para>
<para>
a member of a role with <literal>CREATEDB</literal> privilege does not immediately
grant the ability to create databases, even if <literal>INHERIT</literal> is set;
it would be necessary to become that role via
- <xref linkend="sql-set-role"> before
+ <xref linkend="sql-set-role"/> before
creating a database.
</para>
<para>
<productname>PostgreSQL</productname> includes a program <xref
- linkend="app-createuser"> that has
+ linkend="app-createuser"/> that has
the same functionality as <command>CREATE ROLE</command> (in fact,
it calls this command) but can be run from the command shell.
</para>
with this command. The password will be transmitted to the server
in cleartext, and it might also be logged in the client's command
history or the server log. The command <xref
- linkend="app-createuser">, however, transmits
- the password encrypted. Also, <xref linkend="app-psql">
+ linkend="app-createuser"/>, however, transmits
+ the password encrypted. Also, <xref linkend="app-psql"/>
contains a command
<command>\password</command> that can be used to safely change the
password later.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-set-role"></member>
- <member><xref linkend="sql-alterrole"></member>
- <member><xref linkend="sql-droprole"></member>
- <member><xref linkend="sql-grant"></member>
- <member><xref linkend="sql-revoke"></member>
- <member><xref linkend="app-createuser"></member>
+ <member><xref linkend="sql-set-role"/></member>
+ <member><xref linkend="sql-alterrole"/></member>
+ <member><xref linkend="sql-droprole"/></member>
+ <member><xref linkend="sql-grant"/></member>
+ <member><xref linkend="sql-revoke"/></member>
+ <member><xref linkend="app-createuser"/></member>
</simplelist>
</refsect1>
</refentry>
transformation happens before the execution of the command starts.
If you actually want an operation that fires independently for each
physical row, you probably want to use a trigger, not a rule.
- More information about the rules system is in <xref linkend="rules">.
+ More information about the rules system is in <xref linkend="rules"/>.
</para>
<para>
<note>
<para>
A view that is simple enough to be automatically updatable (see <xref
- linkend="sql-createview">) does not require a user-created rule in
+ linkend="sql-createview"/>) does not require a user-created rule in
order to be updatable. While you can create an explicit rule anyway,
the automatic update transformation will generally outperform an
explicit rule.
<para>
Another alternative worth considering is to use <literal>INSTEAD OF</literal>
- triggers (see <xref linkend="sql-createtrigger">) in place of rules.
+ triggers (see <xref linkend="sql-createtrigger"/>) in place of rules.
</para>
</note>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterrule"></member>
- <member><xref linkend="sql-droprule"></member>
+ <member><xref linkend="sql-alterrule"/></member>
+ <member><xref linkend="sql-droprule"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterschema"></member>
- <member><xref linkend="sql-dropschema"></member>
+ <member><xref linkend="sql-alterschema"/></member>
+ <member><xref linkend="sql-dropschema"/></member>
</simplelist>
</refsect1>
<function>currval</function>, and
<function>setval</function>
to operate on the sequence. These functions are documented in
- <xref linkend="functions-sequence">.
+ <xref linkend="functions-sequence"/>.
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altersequence"></member>
- <member><xref linkend="sql-dropsequence"></member>
+ <member><xref linkend="sql-altersequence"/></member>
+ <member><xref linkend="sql-dropsequence"/></member>
</simplelist>
</refsect1>
<title>Notes</title>
<para>
- When using the <xref linkend="dblink"> module,
+ When using the <xref linkend="dblink"/> module,
a foreign server's name can be used
- as an argument of the <xref linkend="contrib-dblink-connect">
+ as an argument of the <xref linkend="contrib-dblink-connect"/>
function to indicate the connection parameters. It is necessary to have
the <literal>USAGE</literal> privilege on the foreign server to be
able to use it in this way.
<programlisting>
CREATE SERVER myserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'foo', dbname 'foodb', port '5432');
</programlisting>
- See <xref linkend="postgres-fdw"> for more details.
+ See <xref linkend="postgres-fdw"/> for more details.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterserver"></member>
- <member><xref linkend="sql-dropserver"></member>
- <member><xref linkend="sql-createforeigndatawrapper"></member>
- <member><xref linkend="sql-createforeigntable"></member>
- <member><xref linkend="sql-createusermapping"></member>
+ <member><xref linkend="sql-alterserver"/></member>
+ <member><xref linkend="sql-dropserver"/></member>
+ <member><xref linkend="sql-createforeigndatawrapper"/></member>
+ <member><xref linkend="sql-createforeigntable"/></member>
+ <member><xref linkend="sql-createusermapping"/></member>
</simplelist>
</refsect1>
dependency statistics.
If this clause is omitted, all supported statistics kinds are
included in the statistics object.
- For more information, see <xref linkend="planner-stats-extended">
- and <xref linkend="multivariate-statistics-examples">.
+ For more information, see <xref linkend="planner-stats-extended"/>
+ and <xref linkend="multivariate-statistics-examples"/>.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterstatistics"></member>
- <member><xref linkend="sql-dropstatistics"></member>
+ <member><xref linkend="sql-alterstatistics"/></member>
+ <member><xref linkend="sql-dropstatistics"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
Additional info about subscriptions and logical replication as a whole
- can is available at <xref linkend="logical-replication-subscription"> and
- <xref linkend="logical-replication">.
+ can is available at <xref linkend="logical-replication-subscription"/> and
+ <xref linkend="logical-replication"/>.
</para>
</refsect1>
<listitem>
<para>
The connection string to the publisher. For details
- see <xref linkend="libpq-connstring">.
+ see <xref linkend="libpq-connstring"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The value of this parameter overrides the
- <xref linkend="guc-synchronous-commit"> setting. The default
+ <xref linkend="guc-synchronous-commit"/> setting. The default
value is <literal>off</literal>.
</para>
<title>Notes</title>
<para>
- See <xref linkend="logical-replication-security"> for details on
+ See <xref linkend="logical-replication-security"/> for details on
how to configure access control between the subscription and the
publication instance.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altersubscription"></member>
- <member><xref linkend="sql-dropsubscription"></member>
- <member><xref linkend="sql-createpublication"></member>
- <member><xref linkend="sql-alterpublication"></member>
+ <member><xref linkend="sql-altersubscription"/></member>
+ <member><xref linkend="sql-dropsubscription"/></member>
+ <member><xref linkend="sql-createpublication"/></member>
+ <member><xref linkend="sql-alterpublication"/></member>
</simplelist>
</refsect1>
</refentry>
This presently makes no difference in <productname>PostgreSQL</productname>
and is deprecated; see
<xref linkend="sql-createtable-compatibility"
- endterm="sql-createtable-compatibility-title">.
+ endterm="sql-createtable-compatibility-title"/>.
</para>
</listitem>
</varlistentry>
<para>
If specified, the table is created as an unlogged table. Data written
to unlogged tables is not written to the write-ahead log (see <xref
- linkend="wal">), which makes them considerably faster than ordinary
+ linkend="wal"/>), which makes them considerably faster than ordinary
tables. However, they are not crash-safe: an unlogged table is
automatically truncated after a crash or unclean shutdown. The contents
of an unlogged table are also not replicated to standby servers.
are valid values of the corresponding partition key columns for this
partition, whereas those in the <literal>TO</literal> list are
not. Note that this statement must be understood according to the
- rules of row-wise comparison (<xref linkend="row-wise-comparison">).
+ rules of row-wise comparison (<xref linkend="row-wise-comparison"/>).
For example, given <literal>PARTITION BY RANGE (x,y)</literal>, a partition
bound <literal>FROM (1, 2) TO (3, 4)</literal>
allows <literal>x=1</literal> with any <literal>y>=2</literal>,
The data type of the column. This can include array
specifiers. For more information on the data types supported by
<productname>PostgreSQL</productname>, refer to <xref
- linkend="datatype">.
+ linkend="datatype"/>.
</para>
</listitem>
</varlistentry>
specified explicitly, the default operator class of the appropriate
type will be used; if no default operator class exists, an error will
be raised. When hash partitioning is used, the operator class used
- must implement support function 2 (see <xref linkend="xindex-support">
+ must implement support function 2 (see <xref linkend="xindex-support"/>
for details).
</para>
default behavior is to exclude <literal>STORAGE</literal> settings, resulting
in the copied columns in the new table having type-specific default
settings. For more on <literal>STORAGE</literal> settings, see
- <xref linkend="storage-toast">.
+ <xref linkend="storage-toast"/>.
</para>
<para>
Comments for the copied columns, constraints, and indexes
only accepted if the <command>INSERT</command> statement
specifies <literal>OVERRIDING SYSTEM VALUE</literal>. If <literal>BY
DEFAULT</literal> is specified, then the user-specified value takes
- precedence. See <xref linkend="sql-insert"> for details. (In
+ precedence. See <xref linkend="sql-insert"/> for details. (In
the <command>COPY</command> command, user-specified values are always
used regardless of this setting.)
</para>
<para>
The optional <replaceable>sequence_options</replaceable> clause can be
used to override the options of the sequence.
- See <xref linkend="sql-createsequence"> for details.
+ See <xref linkend="sql-createsequence"/> for details.
</para>
</listitem>
</varlistentry>
constraints that are more general than simple equality.
For example, you can specify a constraint that
no two rows in the table contain overlapping circles
- (see <xref linkend="datatype-geometric">) by using the
+ (see <xref linkend="datatype-geometric"/>) by using the
<literal>&&</literal> operator.
</para>
Exclusion constraints are implemented using
an index, so each specified operator must be associated with an
appropriate operator class
- (see <xref linkend="indexes-opclass">) for the index access
+ (see <xref linkend="indexes-opclass"/>) for the index access
method <replaceable>index_method</replaceable>.
The operators are required to be commutative.
Each <replaceable class="parameter">exclude_element</replaceable>
can optionally specify an operator class and/or ordering options;
these are described fully under
- <xref linkend="sql-createindex">.
+ <xref linkend="sql-createindex"/>.
</para>
<para>
The access method must support <literal>amgettuple</literal> (see <xref
- linkend="indexam">); at present this means <acronym>GIN</acronym>
+ linkend="indexam"/>); at present this means <acronym>GIN</acronym>
cannot be used. Although it's allowed, there is little point in using
B-tree or hash indexes with an exclusion constraint, because this
does nothing that an ordinary unique constraint doesn't do better.
constraint that is not deferrable will be checked immediately
after every command. Checking of constraints that are
deferrable can be postponed until the end of the transaction
- (using the <xref linkend="sql-set-constraints"> command).
+ (using the <xref linkend="sql-set-constraints"/> command).
<literal>NOT DEFERRABLE</literal> is the default.
Currently, only <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>,
<literal>EXCLUDE</literal>, and
statement. This is the default. If the constraint is
<literal>INITIALLY DEFERRED</literal>, it is checked only at the
end of the transaction. The constraint check time can be
- altered with the <xref linkend="sql-set-constraints"> command.
+ altered with the <xref linkend="sql-set-constraints"/> command.
</para>
</listitem>
</varlistentry>
<para>
This clause specifies optional storage parameters for a table or index;
see <xref linkend="sql-createtable-storage-parameters"
- endterm="sql-createtable-storage-parameters-title"> for more
+ endterm="sql-createtable-storage-parameters-title"/> for more
information. The <literal>WITH</literal> clause for a
table can also include <literal>OIDS=TRUE</literal> (or just <literal>OIDS</literal>)
to specify that rows of the new table
should have OIDs (object identifiers) assigned to them, or
<literal>OIDS=FALSE</literal> to specify that the rows should not have OIDs.
If <literal>OIDS</literal> is not specified, the default setting depends upon
- the <xref linkend="guc-default-with-oids"> configuration parameter.
+ the <xref linkend="guc-default-with-oids"/> configuration parameter.
(If the new table inherits from any tables that have OIDs, then
<literal>OIDS=TRUE</literal> is forced even if the command says
<literal>OIDS=FALSE</literal>.)
<para>
To remove OIDs from a table after it has been created, use <xref
- linkend="sql-altertable">.
+ linkend="sql-altertable"/>.
</para>
</listitem>
</varlistentry>
<para>
All rows in the temporary table will be deleted at the end
of each transaction block. Essentially, an automatic <xref
- linkend="sql-truncate"> is done
+ linkend="sql-truncate"/> is done
at each commit.
</para>
</listitem>
The <replaceable class="parameter">tablespace_name</replaceable> is the name
of the tablespace in which the new table is to be created.
If not specified,
- <xref linkend="guc-default-tablespace"> is consulted, or
- <xref linkend="guc-temp-tablespaces"> if the table is temporary.
+ <xref linkend="guc-default-tablespace"/> is consulted, or
+ <xref linkend="guc-temp-tablespaces"/> if the table is temporary.
</para>
</listitem>
</varlistentry>
associated with a <literal>UNIQUE</literal>, <literal>PRIMARY
KEY</literal>, or <literal>EXCLUDE</literal> constraint will be created.
If not specified,
- <xref linkend="guc-default-tablespace"> is consulted, or
- <xref linkend="guc-temp-tablespaces"> if the table is temporary.
+ <xref linkend="guc-default-tablespace"/> is consulted, or
+ <xref linkend="guc-temp-tablespaces"/> if the table is temporary.
</para>
</listitem>
</varlistentry>
for tables, and for indexes associated with a <literal>UNIQUE</literal>,
<literal>PRIMARY KEY</literal>, or <literal>EXCLUDE</literal> constraint.
Storage parameters for
- indexes are documented in <xref linkend="sql-createindex">.
+ indexes are documented in <xref linkend="sql-createindex"/>.
The storage parameters currently
available for tables are listed below. For many of these parameters, as
shown, there is an additional parameter with the same name prefixed with
<literal>toast.</literal>, which controls the behavior of the
table's secondary <acronym>TOAST</acronym> table, if any
- (see <xref linkend="storage-toast"> for more information about TOAST).
+ (see <xref linkend="storage-toast"/> for more information about TOAST).
If a table parameter value is set and the
equivalent <literal>toast.</literal> parameter is not, the TOAST table
will use the table's parameter value.
scan of this table. If not set, the system will determine a value based
on the relation size. The actual number of workers chosen by the planner
may be less, for example due to
- the setting of <xref linkend="guc-max-worker-processes">.
+ the setting of <xref linkend="guc-max-worker-processes"/>.
</para>
</listitem>
</varlistentry>
Enables or disables the autovacuum daemon for a particular table.
If true, the autovacuum daemon will perform automatic <command>VACUUM</command>
and/or <command>ANALYZE</command> operations on this table following the rules
- discussed in <xref linkend="autovacuum">.
+ discussed in <xref linkend="autovacuum"/>.
If false, this table will not be autovacuumed, except to prevent
- transaction ID wraparound. See <xref linkend="vacuum-for-wraparound"> for
+ transaction ID wraparound. See <xref linkend="vacuum-for-wraparound"/> for
more about wraparound prevention.
Note that the autovacuum daemon does not run at all (except to prevent
- transaction ID wraparound) if the <xref linkend="guc-autovacuum">
+ transaction ID wraparound) if the <xref linkend="guc-autovacuum"/>
parameter is false; setting individual tables' storage parameters does
not override that. Therefore there is seldom much point in explicitly
setting this storage parameter to <literal>true</literal>, only
<term><literal>autovacuum_vacuum_threshold</literal>, <literal>toast.autovacuum_vacuum_threshold</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-vacuum-threshold">
+ Per-table value for <xref linkend="guc-autovacuum-vacuum-threshold"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_vacuum_scale_factor</literal>, <literal>toast.autovacuum_vacuum_scale_factor</literal> (<type>float4</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-vacuum-scale-factor">
+ Per-table value for <xref linkend="guc-autovacuum-vacuum-scale-factor"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_analyze_threshold</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-analyze-threshold">
+ Per-table value for <xref linkend="guc-autovacuum-analyze-threshold"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_analyze_scale_factor</literal> (<type>float4</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-analyze-scale-factor">
+ Per-table value for <xref linkend="guc-autovacuum-analyze-scale-factor"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_vacuum_cost_delay</literal>, <literal>toast.autovacuum_vacuum_cost_delay</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-vacuum-cost-delay">
+ Per-table value for <xref linkend="guc-autovacuum-vacuum-cost-delay"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_vacuum_cost_limit</literal>, <literal>toast.autovacuum_vacuum_cost_limit</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-vacuum-cost-limit">
+ Per-table value for <xref linkend="guc-autovacuum-vacuum-cost-limit"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_freeze_min_age</literal>, <literal>toast.autovacuum_freeze_min_age</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-vacuum-freeze-min-age">
+ Per-table value for <xref linkend="guc-vacuum-freeze-min-age"/>
parameter. Note that autovacuum will ignore
per-table <literal>autovacuum_freeze_min_age</literal> parameters that are
larger than half the
- system-wide <xref linkend="guc-autovacuum-freeze-max-age"> setting.
+ system-wide <xref linkend="guc-autovacuum-freeze-max-age"/> setting.
</para>
</listitem>
</varlistentry>
<term><literal>autovacuum_freeze_max_age</literal>, <literal>toast.autovacuum_freeze_max_age</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-autovacuum-freeze-max-age">
+ Per-table value for <xref linkend="guc-autovacuum-freeze-max-age"/>
parameter. Note that autovacuum will ignore
per-table <literal>autovacuum_freeze_max_age</literal> parameters that are
larger than the system-wide setting (it can only be set smaller).
<term><literal>autovacuum_freeze_table_age</literal>, <literal>toast.autovacuum_freeze_table_age</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-vacuum-freeze-table-age">
+ Per-table value for <xref linkend="guc-vacuum-freeze-table-age"/>
parameter.
</para>
</listitem>
<term><literal>autovacuum_multixact_freeze_min_age</literal>, <literal>toast.autovacuum_multixact_freeze_min_age</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-vacuum-multixact-freeze-min-age">
+ Per-table value for <xref linkend="guc-vacuum-multixact-freeze-min-age"/>
parameter. Note that autovacuum will ignore
per-table <literal>autovacuum_multixact_freeze_min_age</literal> parameters
that are larger than half the
- system-wide <xref linkend="guc-autovacuum-multixact-freeze-max-age">
+ system-wide <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>
setting.
</para>
</listitem>
<listitem>
<para>
Per-table value
- for <xref linkend="guc-autovacuum-multixact-freeze-max-age"> parameter.
+ for <xref linkend="guc-autovacuum-multixact-freeze-max-age"/> parameter.
Note that autovacuum will ignore
per-table <literal>autovacuum_multixact_freeze_max_age</literal> parameters
that are larger than the system-wide setting (it can only be set
<listitem>
<para>
Per-table value
- for <xref linkend="guc-vacuum-multixact-freeze-table-age"> parameter.
+ for <xref linkend="guc-vacuum-multixact-freeze-table-age"/> parameter.
</para>
</listitem>
</varlistentry>
<term><literal>log_autovacuum_min_duration</literal>, <literal>toast.log_autovacuum_min_duration</literal> (<type>integer</type>)</term>
<listitem>
<para>
- Per-table value for <xref linkend="guc-log-autovacuum-min-duration">
+ Per-table value for <xref linkend="guc-log-autovacuum-min-duration"/>
parameter.
</para>
</listitem>
<para>
Declare the table as an additional catalog table for purposes of
logical replication. See
- <xref linkend="logicaldecoding-capabilities"> for details.
+ <xref linkend="logicaldecoding-capabilities"/> for details.
This parameter cannot be set for TOAST tables.
</para>
</listitem>
index for each unique constraint and primary key constraint to
enforce uniqueness. Thus, it is not necessary to create an
index explicitly for primary key columns. (See <xref
- linkend="sql-createindex"> for more information.)
+ linkend="sql-createindex"/> for more information.)
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertable"></member>
- <member><xref linkend="sql-droptable"></member>
- <member><xref linkend="sql-createtableas"></member>
- <member><xref linkend="sql-createtablespace"></member>
- <member><xref linkend="sql-createtype"></member>
+ <member><xref linkend="sql-altertable"/></member>
+ <member><xref linkend="sql-droptable"/></member>
+ <member><xref linkend="sql-createtableas"/></member>
+ <member><xref linkend="sql-createtablespace"/></member>
+ <member><xref linkend="sql-createtype"/></member>
</simplelist>
</refsect1>
</refentry>
<listitem>
<para>
Ignored for compatibility. Use of these keywords is deprecated;
- refer to <xref linkend="sql-createtable"> for details.
+ refer to <xref linkend="sql-createtable"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
If specified, the table is created as a temporary table.
- Refer to <xref linkend="sql-createtable"> for details.
+ Refer to <xref linkend="sql-createtable"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
If specified, the table is created as an unlogged table.
- Refer to <xref linkend="sql-createtable"> for details.
+ Refer to <xref linkend="sql-createtable"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Do not throw an error if a relation with the same name already exists.
- A notice is issued in this case. Refer to <xref linkend="sql-createtable">
+ A notice is issued in this case. Refer to <xref linkend="sql-createtable"/>
for details.
</para>
</listitem>
<para>
This clause specifies optional storage parameters for the new table;
see <xref linkend="sql-createtable-storage-parameters"
- endterm="sql-createtable-storage-parameters-title"> for more
+ endterm="sql-createtable-storage-parameters-title"/> for more
information. The <literal>WITH</literal> clause
can also include <literal>OIDS=TRUE</literal> (or just <literal>OIDS</literal>)
to specify that rows of the new table
should have OIDs (object identifiers) assigned to them, or
<literal>OIDS=FALSE</literal> to specify that the rows should not have OIDs.
- See <xref linkend="sql-createtable"> for more information.
+ See <xref linkend="sql-createtable"/> for more information.
</para>
</listitem>
</varlistentry>
<para>
All rows in the temporary table will be deleted at the end
of each transaction block. Essentially, an automatic <xref
- linkend="sql-truncate"> is done
+ linkend="sql-truncate"/> is done
at each commit.
</para>
</listitem>
The <replaceable class="parameter">tablespace_name</replaceable> is the name
of the tablespace in which the new table is to be created.
If not specified,
- <xref linkend="guc-default-tablespace"> is consulted, or
- <xref linkend="guc-temp-tablespaces"> if the table is temporary.
+ <xref linkend="guc-default-tablespace"/> is consulted, or
+ <xref linkend="guc-temp-tablespaces"/> if the table is temporary.
</para>
</listitem>
</varlistentry>
<term><replaceable>query</replaceable></term>
<listitem>
<para>
- A <xref linkend="sql-select">, <link
- linkend="sql-table">TABLE</link>, or <xref linkend="sql-values">
- command, or an <xref linkend="sql-execute"> command that runs a
+ A <xref linkend="sql-select"/>, <link
+ linkend="sql-table">TABLE</link>, or <xref linkend="sql-values"/>
+ command, or an <xref linkend="sql-execute"/> command that runs a
prepared <command>SELECT</command>, <command>TABLE</command>, or
<command>VALUES</command> query.
</para>
<para>
This command is functionally similar to <xref
- linkend="sql-selectinto">, but it is
+ linkend="sql-selectinto"/>, but it is
preferred since it is less likely to be confused with other uses of
the <command>SELECT INTO</command> syntax. Furthermore, <command>CREATE
TABLE AS</command> offers a superset of the functionality offered
The <command>CREATE TABLE AS</command> command allows the user to
explicitly specify whether OIDs should be included. If the
presence of OIDs is not explicitly specified,
- the <xref linkend="guc-default-with-oids"> configuration variable is
+ the <xref linkend="guc-default-with-oids"/> configuration variable is
used.
</para>
</refsect1>
<listitem>
<para><productname>PostgreSQL</productname> handles temporary tables in a way
rather different from the standard; see
- <xref linkend="sql-createtable">
+ <xref linkend="sql-createtable"/>
for details.
</para>
</listitem>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-creatematerializedview"></member>
- <member><xref linkend="sql-createtable"></member>
- <member><xref linkend="sql-execute"></member>
- <member><xref linkend="sql-select"></member>
- <member><xref linkend="sql-selectinto"></member>
- <member><xref linkend="sql-values"></member>
+ <member><xref linkend="sql-creatematerializedview"/></member>
+ <member><xref linkend="sql-createtable"/></member>
+ <member><xref linkend="sql-execute"/></member>
+ <member><xref linkend="sql-select"/></member>
+ <member><xref linkend="sql-selectinto"/></member>
+ <member><xref linkend="sql-values"/></member>
</simplelist>
</refsect1>
<warning>
<para>
A tablespace cannot be used independently of the cluster in which it
- is defined; see <xref linkend="manage-ag-tablespaces">.
+ is defined; see <xref linkend="manage-ag-tablespaces"/>.
</para>
</warning>
Setting either value for a particular tablespace will override the
planner's usual estimate of the cost of reading pages from tables in
that tablespace, as established by the configuration parameters of the
- same name (see <xref linkend="guc-seq-page-cost">,
- <xref linkend="guc-random-page-cost">,
- <xref linkend="guc-effective-io-concurrency">). This may be useful if
+ same name (see <xref linkend="guc-seq-page-cost"/>,
+ <xref linkend="guc-random-page-cost"/>,
+ <xref linkend="guc-effective-io-concurrency"/>). This may be useful if
one tablespace is located on a disk which is faster or slower than the
remainder of the I/O subsystem.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createdatabase"></member>
- <member><xref linkend="sql-createtable"></member>
- <member><xref linkend="sql-createindex"></member>
- <member><xref linkend="sql-droptablespace"></member>
- <member><xref linkend="sql-altertablespace"></member>
+ <member><xref linkend="sql-createdatabase"/></member>
+ <member><xref linkend="sql-createtable"/></member>
+ <member><xref linkend="sql-createindex"/></member>
+ <member><xref linkend="sql-droptablespace"/></member>
+ <member><xref linkend="sql-altertablespace"/></member>
</simplelist>
</refsect1>
<title>Notes</title>
<para>
- Use <xref linkend="sql-droptransform"> to remove transforms.
+ Use <xref linkend="sql-droptransform"/> to remove transforms.
</para>
</refsect1>
<title>See Also</title>
<para>
- <xref linkend="sql-createfunction">,
- <xref linkend="sql-createlanguage">,
- <xref linkend="sql-createtype">,
- <xref linkend="sql-droptransform">
+ <xref linkend="sql-createfunction"/>,
+ <xref linkend="sql-createlanguage"/>,
+ <xref linkend="sql-createtype"/>,
+ <xref linkend="sql-droptransform"/>
</para>
</refsect1>
When the <literal>CONSTRAINT</literal> option is specified, this command creates a
<firstterm>constraint trigger</firstterm>. This is the same as a regular trigger
except that the timing of the trigger firing can be adjusted using
- <xref linkend="sql-set-constraints">.
+ <xref linkend="sql-set-constraints"/>.
Constraint triggers must be <literal>AFTER ROW</literal> triggers on plain
tables (not foreign tables). They
can be fired either at the end of the statement causing the triggering
</para>
<para>
- Refer to <xref linkend="triggers"> for more information about triggers.
+ Refer to <xref linkend="triggers"/> for more information about triggers.
</para>
</refsect1>
<listitem>
<para>
The default timing of the trigger.
- See the <xref linkend="sql-createtable"> documentation for details of
+ See the <xref linkend="sql-createtable"/> documentation for details of
these constraint options. This can only be specified for constraint
triggers.
</para>
</para>
<para>
- Use <xref linkend="sql-droptrigger"> to remove a trigger.
+ Use <xref linkend="sql-droptrigger"/> to remove a trigger.
</para>
<para>
</para>
<para>
- <xref linkend="trigger-example"> contains a complete example of a trigger
+ <xref linkend="trigger-example"/> contains a complete example of a trigger
function written in C.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertrigger"></member>
- <member><xref linkend="sql-droptrigger"></member>
- <member><xref linkend="sql-createfunction"></member>
- <member><xref linkend="sql-set-constraints"></member>
+ <member><xref linkend="sql-altertrigger"/></member>
+ <member><xref linkend="sql-droptrigger"/></member>
+ <member><xref linkend="sql-createfunction"/></member>
+ <member><xref linkend="sql-set-constraints"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- Refer to <xref linkend="textsearch"> for further information.
+ Refer to <xref linkend="textsearch"/> for further information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertsconfig"></member>
- <member><xref linkend="sql-droptsconfig"></member>
+ <member><xref linkend="sql-altertsconfig"/></member>
+ <member><xref linkend="sql-droptsconfig"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- Refer to <xref linkend="textsearch"> for further information.
+ Refer to <xref linkend="textsearch"/> for further information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertsdictionary"></member>
- <member><xref linkend="sql-droptsdictionary"></member>
+ <member><xref linkend="sql-altertsdictionary"/></member>
+ <member><xref linkend="sql-droptsdictionary"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- Refer to <xref linkend="textsearch"> for further information.
+ Refer to <xref linkend="textsearch"/> for further information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertsparser"></member>
- <member><xref linkend="sql-droptsparser"></member>
+ <member><xref linkend="sql-altertsparser"/></member>
+ <member><xref linkend="sql-droptsparser"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- Refer to <xref linkend="textsearch"> for further information.
+ Refer to <xref linkend="textsearch"/> for further information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertstemplate"></member>
- <member><xref linkend="sql-droptstemplate"></member>
+ <member><xref linkend="sql-altertstemplate"/></member>
+ <member><xref linkend="sql-droptstemplate"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The second form of <command>CREATE TYPE</command> creates an enumerated
- (enum) type, as described in <xref linkend="datatype-enum">.
+ (enum) type, as described in <xref linkend="datatype-enum"/>.
Enum types take a list of one or more quoted labels, each of which
must be less than <symbol>NAMEDATALEN</symbol> bytes long (64 bytes in a
standard <productname>PostgreSQL</productname> build).
<para>
The third form of <command>CREATE TYPE</command> creates a new
- range type, as described in <xref linkend="rangetypes">.
+ range type, as described in <xref linkend="rangetypes"/>.
</para>
<para>
function must take one argument of the range type being defined, and
return a value of the same type. This is used to convert range values
to a canonical form, when applicable. See <xref
- linkend="rangetypes-defining"> for more information. Creating a
+ linkend="rangetypes-defining"/> for more information. Creating a
<replaceable class="parameter">canonical</replaceable> function
is a bit tricky, since it must be defined before the range type can be
declared. To do this, you must first create a shell type, which is a
and return a <type>double precision</type> value representing the
difference between the two given values. While this is optional,
providing it allows much greater efficiency of GiST indexes on columns of
- the range type. See <xref linkend="rangetypes-defining"> for more
+ the range type. See <xref linkend="rangetypes-defining"/> for more
information.
</para>
</refsect2>
by setting <literal>typlen</literal> to -1.) The internal representation of all
variable-length types must start with a 4-byte integer giving the total
length of this value of the type. (Note that the length field is often
- encoded, as described in <xref linkend="storage-toast">; it's unwise
+ encoded, as described in <xref linkend="storage-toast"/>; it's unwise
to access it directly.)
</para>
All <replaceable class="parameter">storage</replaceable> values other
than <literal>plain</literal> imply that the functions of the data type
can handle values that have been <firstterm>toasted</firstterm>, as described
- in <xref linkend="storage-toast"> and <xref linkend="xtypes-toast">.
+ in <xref linkend="storage-toast"/> and <xref linkend="xtypes-toast"/>.
The specific other value given merely determines the default TOAST
storage strategy for columns of a toastable data type; users can pick
other strategies for individual columns using <literal>ALTER TABLE
category. The parser will prefer casting to preferred types (but only from
other types within the same category) when this rule is helpful in
resolving overloaded functions or operators. For more details see <xref
- linkend="typeconv">. For types that have no implicit casts to or from any
+ linkend="typeconv"/>. For types that have no implicit casts to or from any
other types, it is sufficient to leave these settings at the defaults.
However, for a group of related types that have implicit casts, it is often
helpful to mark them all as belonging to a category and select one or two
The category code (a single ASCII character) for this type.
The default is <literal>'U'</literal> for <quote>user-defined type</quote>.
Other standard category codes can be found in
- <xref linkend="catalog-typcategory-table">. You may also choose
+ <xref linkend="catalog-typcategory-table"/>. You may also choose
other ASCII characters in order to create custom categories.
</para>
</listitem>
<para>
More examples, including suitable input and output functions, are
- in <xref linkend="xtypes">.
+ in <xref linkend="xtypes"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertype"></member>
- <member><xref linkend="sql-createdomain"></member>
- <member><xref linkend="sql-createfunction"></member>
- <member><xref linkend="sql-droptype"></member>
+ <member><xref linkend="sql-altertype"/></member>
+ <member><xref linkend="sql-createdomain"/></member>
+ <member><xref linkend="sql-createfunction"/></member>
+ <member><xref linkend="sql-droptype"/></member>
</simplelist>
</refsect1>
<para>
<command>CREATE USER</command> is now an alias for
- <xref linkend="sql-createrole">.
+ <xref linkend="sql-createrole"/>.
The only difference is that when the command is spelled
<command>CREATE USER</command>, <literal>LOGIN</literal> is assumed
by default, whereas <literal>NOLOGIN</literal> is assumed when
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createrole"></member>
+ <member><xref linkend="sql-createrole"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterusermapping"></member>
- <member><xref linkend="sql-dropusermapping"></member>
- <member><xref linkend="sql-createforeigndatawrapper"></member>
- <member><xref linkend="sql-createserver"></member>
+ <member><xref linkend="sql-alterusermapping"/></member>
+ <member><xref linkend="sql-dropusermapping"/></member>
+ <member><xref linkend="sql-createforeigndatawrapper"/></member>
+ <member><xref linkend="sql-createserver"/></member>
</simplelist>
</refsect1>
<literal>cascaded</literal>, and is equivalent to specifying
<literal>WITH [ CASCADED | LOCAL ] CHECK OPTION</literal> (see below).
This option can be changed on existing views using <xref
- linkend="sql-alterview">.
+ linkend="sql-alterview"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
This should be used if the view is intended to provide row-level
- security. See <xref linkend="rules-privileges"> for full details.
+ security. See <xref linkend="rules-privileges"/> for full details.
</para>
</listitem>
</varlistentry>
<term><replaceable class="parameter">query</replaceable></term>
<listitem>
<para>
- A <xref linkend="sql-select"> or
- <xref linkend="sql-values"> command
+ A <xref linkend="sql-select"/> or
+ <xref linkend="sql-values"/> command
which will provide the columns and rows of the view.
</para>
</listitem>
<title>Notes</title>
<para>
- Use the <xref linkend="sql-dropview">
+ Use the <xref linkend="sql-dropview"/>
statement to drop views.
</para>
Access to tables referenced in the view is determined by permissions of
the view owner. In some cases, this can be used to provide secure but
restricted access to the underlying tables. However, not all views are
- secure against tampering; see <xref linkend="rules-privileges"> for
+ secure against tampering; see <xref linkend="rules-privileges"/> for
details. Functions called in the view are treated the same as if they had
been called directly from the query using the view. Therefore the user of
a view must have permissions to call all functions used by the view.
<literal>security_barrier</literal> property then all the view's <literal>WHERE</literal>
conditions (and any conditions using operators which are marked as <literal>LEAKPROOF</literal>)
will always be evaluated before any conditions that a user of the view has
- added. See <xref linkend="rules-privileges"> for full details. Note that,
+ added. See <xref linkend="rules-privileges"/> for full details. Note that,
due to this, rows which are not ultimately returned (because they do not
pass the user's <literal>WHERE</literal> conditions) may still end up being locked.
<command>EXPLAIN</command> can be used to see which conditions are
creating <literal>INSTEAD OF</literal> triggers on the view, which must
convert attempted inserts, etc. on the view into appropriate actions
on other tables. For more information see <xref
- linkend="sql-createtrigger">. Another possibility is to create rules
- (see <xref linkend="sql-createrule">), but in practice triggers are
+ linkend="sql-createtrigger"/>. Another possibility is to create rules
+ (see <xref linkend="sql-createrule"/>), but in practice triggers are
easier to understand and use correctly.
</para>
view. In addition the view's owner must have the relevant privileges on
the underlying base relations, but the user performing the update does
not need any permissions on the underlying base relations (see
- <xref linkend="rules-privileges">).
+ <xref linkend="rules-privileges"/>).
</para>
</refsect2>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterview"></member>
- <member><xref linkend="sql-dropview"></member>
- <member><xref linkend="sql-creatematerializedview"></member>
+ <member><xref linkend="sql-alterview"/></member>
+ <member><xref linkend="sql-dropview"/></member>
+ <member><xref linkend="sql-creatematerializedview"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<application>createdb</application> is a wrapper around the
- <acronym>SQL</acronym> command <xref linkend="sql-createdatabase">.
+ <acronym>SQL</acronym> command <xref linkend="sql-createdatabase"/>.
There is no effective difference between creating databases via
this utility and via other methods for accessing the server.
</para>
Specifies the character encoding scheme to be used in this
database. The character sets supported by the
<productname>PostgreSQL</productname> server are described in
- <xref linkend="multibyte-charset-supported">.
+ <xref linkend="multibyte-charset-supported"/>.
</para>
</listitem>
</varlistentry>
The options <option>-D</option>, <option>-l</option>, <option>-E</option>,
<option>-O</option>, and
<option>-T</option> correspond to options of the underlying
- SQL command <xref linkend="sql-createdatabase">; see there for more information
+ SQL command <xref linkend="sql-createdatabase"/>; see there for more information
about them.
</para>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-createdatabase">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-createdatabase"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-dropdb"></member>
- <member><xref linkend="sql-createdatabase"></member>
+ <member><xref linkend="app-dropdb"/></member>
+ <member><xref linkend="sql-createdatabase"/></member>
</simplelist>
</refsect1>
<para>
<application>createuser</application> is a wrapper around the
- <acronym>SQL</acronym> command <xref linkend="sql-createrole">.
+ <acronym>SQL</acronym> command <xref linkend="sql-createrole"/>.
There is no effective difference between creating users via
this utility and via other methods for accessing the server.
</para>
<para>
The new user will have the <literal>REPLICATION</literal> privilege,
which is described more fully in the documentation for <xref
- linkend="sql-createrole">.
+ linkend="sql-createrole"/>.
</para>
</listitem>
</varlistentry>
<para>
The new user will not have the <literal>REPLICATION</literal>
privilege, which is described more fully in the documentation for <xref
- linkend="sql-createrole">.
+ linkend="sql-createrole"/>.
</para>
</listitem>
</varlistentry>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-createrole">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-createrole"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-dropuser"></member>
- <member><xref linkend="sql-createrole"></member>
+ <member><xref linkend="app-dropuser"/></member>
+ <member><xref linkend="sql-createrole"/></member>
</simplelist>
</refsect1>
<para>
For more information on prepared statements, see <xref
- linkend="sql-prepare">.
+ linkend="sql-prepare"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-execute"></member>
- <member><xref linkend="sql-prepare"></member>
+ <member><xref linkend="sql-execute"/></member>
+ <member><xref linkend="sql-prepare"/></member>
</simplelist>
</refsect1>
</refentry>
can be used to retrieve
a small number of rows at a time out of a larger query.
After the cursor is created, rows are fetched from it using
- <xref linkend="sql-fetch">.
+ <xref linkend="sql-fetch"/>.
</para>
<note>
This page describes usage of cursors at the SQL command level.
If you are trying to use cursors inside a <application>PL/pgSQL</application>
function, the rules are different —
- see <xref linkend="plpgsql-cursors">.
+ see <xref linkend="plpgsql-cursors"/>.
</para>
</note>
</refsect1>
used to retrieve rows in a nonsequential fashion. The default is to
allow scrolling in some cases; this is not the same as specifying
<literal>SCROLL</literal>. See <xref linkend="sql-declare-notes"
- endterm="sql-declare-notes-title"> for details.
+ endterm="sql-declare-notes-title"/> for details.
</para>
</listitem>
</varlistentry>
<term><replaceable class="parameter">query</replaceable></term>
<listitem>
<para>
- A <xref linkend="sql-select"> or
- <xref linkend="sql-values"> command
+ A <xref linkend="sql-select"/> or
+ <xref linkend="sql-values"/> command
which will provide the rows to be returned by the cursor.
</para>
</listitem>
<productname>PostgreSQL</productname> reports an error if such a
command is used outside a transaction block.
Use
- <xref linkend="sql-begin"> and
- <xref linkend="sql-commit">
- (or <xref linkend="sql-rollback">)
+ <xref linkend="sql-begin"/> and
+ <xref linkend="sql-commit"/>
+ (or <xref linkend="sql-rollback"/>)
to define a transaction block.
</para>
<para>
Scrollable and <literal>WITH HOLD</literal> cursors may give unexpected
results if they invoke any volatile functions (see <xref
- linkend="xfunc-volatility">). When a previously fetched row is
+ linkend="xfunc-volatility"/>). When a previously fetched row is
re-fetched, the functions might be re-executed, perhaps leading to
results different from the first time. One workaround for such cases
is to declare the cursor <literal>WITH HOLD</literal> and commit the
If the cursor's query includes <literal>FOR UPDATE</literal> or <literal>FOR
SHARE</literal>, then returned rows are locked at the time they are first
fetched, in the same way as for a regular
- <xref linkend="sql-select"> command with
+ <xref linkend="sql-select"/> command with
these options.
In addition, the returned rows will be the most up-to-date versions;
therefore these options provide the equivalent of what the SQL standard
<programlisting>
DECLARE liahona CURSOR FOR SELECT * FROM films;
</programlisting>
- See <xref linkend="sql-fetch"> for more
+ See <xref linkend="sql-fetch"/> for more
examples of cursor usage.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-close"></member>
- <member><xref linkend="sql-fetch"></member>
- <member><xref linkend="sql-move"></member>
+ <member><xref linkend="sql-close"/></member>
+ <member><xref linkend="sql-fetch"/></member>
+ <member><xref linkend="sql-move"/></member>
</simplelist>
</refsect1>
</refentry>
<tip>
<para>
- <xref linkend="sql-truncate"> provides a
+ <xref linkend="sql-truncate"/> provides a
faster mechanism to remove all rows from a table.
</para>
</tip>
<para>
The <literal>WITH</literal> clause allows you to specify one or more
subqueries that can be referenced by name in the <command>DELETE</command>
- query. See <xref linkend="queries-with"> and <xref linkend="sql-select">
+ query. See <xref linkend="queries-with"/> and <xref linkend="sql-select"/>
for details.
</para>
</listitem>
A list of table expressions, allowing columns from other tables
to appear in the <literal>WHERE</literal> condition. This is similar
to the list of tables that can be specified in the <xref
- linkend="sql-from" endterm="sql-from-title"> of a
+ linkend="sql-from" endterm="sql-from-title"/> of a
<command>SELECT</command> statement; for example, an alias for
the table name can be specified. Do not repeat the target table
in the <replaceable class="parameter">using_list</replaceable>,
query on the <command>DELETE</command>'s target table.
Note that <literal>WHERE CURRENT OF</literal> cannot be
specified together with a Boolean condition. See
- <xref linkend="sql-declare">
+ <xref linkend="sql-declare"/>
for more information about using cursors with
<literal>WHERE CURRENT OF</literal>.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-truncate"></member>
+ <member><xref linkend="sql-truncate"/></member>
</simplelist>
</refsect1>
</refentry>
including <function>currval()</function>/<function>lastval()</function>
information and any preallocated sequence values that have not
yet been returned by <function>nextval()</function>.
- (See <xref linkend="sql-createsequence"> for a description of
+ (See <xref linkend="sql-createsequence"/> for a description of
preallocated sequence values.)
</para>
</listitem>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createlanguage"></member>
+ <member><xref linkend="sql-createlanguage"/></member>
</simplelist>
</refsect1>
</refentry>
Automatically drop objects that depend on the access method
(such as operator classes, operator families, and indexes),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-create-access-method"></member>
+ <member><xref linkend="sql-create-access-method"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the aggregate function
(such as views using it),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<para>
Alternative syntaxes for referencing ordered-set aggregates
- are described under <xref linkend="sql-alteraggregate">.
+ are described under <xref linkend="sql-alteraggregate"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteraggregate"></member>
- <member><xref linkend="sql-createaggregate"></member>
+ <member><xref linkend="sql-alteraggregate"/></member>
+ <member><xref linkend="sql-createaggregate"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createcast"></member>
+ <member><xref linkend="sql-createcast"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the collation,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altercollation"></member>
- <member><xref linkend="sql-createcollation"></member>
+ <member><xref linkend="sql-altercollation"/></member>
+ <member><xref linkend="sql-createcollation"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterconversion"></member>
- <member><xref linkend="sql-createconversion"></member>
+ <member><xref linkend="sql-alterconversion"/></member>
+ <member><xref linkend="sql-createconversion"/></member>
</simplelist>
</refsect1>
<para>
This command cannot be executed while connected to the target
database. Thus, it might be more convenient to use the program
- <xref linkend="app-dropdb"> instead,
+ <xref linkend="app-dropdb"/> instead,
which is a wrapper around this command.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createdatabase"></member>
+ <member><xref linkend="sql-createdatabase"/></member>
</simplelist>
</refsect1>
</refentry>
Automatically drop objects that depend on the domain (such as
table columns),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createdomain"></member>
- <member><xref linkend="sql-alterdomain"></member>
+ <member><xref linkend="sql-createdomain"/></member>
+ <member><xref linkend="sql-alterdomain"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the trigger,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createeventtrigger"></member>
- <member><xref linkend="sql-altereventtrigger"></member>
+ <member><xref linkend="sql-createeventtrigger"/></member>
+ <member><xref linkend="sql-altereventtrigger"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the extension,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createextension"></member>
- <member><xref linkend="sql-alterextension"></member>
+ <member><xref linkend="sql-createextension"/></member>
+ <member><xref linkend="sql-alterextension"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the foreign-data
wrapper (such as foreign tables and servers),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createforeigndatawrapper"></member>
- <member><xref linkend="sql-alterforeigndatawrapper"></member>
+ <member><xref linkend="sql-createforeigndatawrapper"/></member>
+ <member><xref linkend="sql-alterforeigndatawrapper"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the foreign table (such as
views), and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterforeigntable"></member>
- <member><xref linkend="sql-createforeigntable"></member>
+ <member><xref linkend="sql-alterforeigntable"/></member>
+ <member><xref linkend="sql-createforeigntable"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the function (such as
operators or triggers),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createfunction"></member>
- <member><xref linkend="sql-alterfunction"></member>
+ <member><xref linkend="sql-createfunction"/></member>
+ <member><xref linkend="sql-alterfunction"/></member>
</simplelist>
</refsect1>
<para>
<command>DROP GROUP</command> is now an alias for
- <xref linkend="sql-droprole">.
+ <xref linkend="sql-droprole"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-droprole"></member>
+ <member><xref linkend="sql-droprole"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the index,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createindex"></member>
+ <member><xref linkend="sql-createindex"/></member>
</simplelist>
</refsect1>
<para>
As of <productname>PostgreSQL</productname> 9.1, most procedural
languages have been made into <quote>extensions</quote>, and should
- therefore be removed with <xref linkend="sql-dropextension">
+ therefore be removed with <xref linkend="sql-dropextension"/>
not <command>DROP LANGUAGE</command>.
</para>
</note>
Automatically drop objects that depend on the language (such as
functions in the language),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterlanguage"></member>
- <member><xref linkend="sql-createlanguage"></member>
+ <member><xref linkend="sql-alterlanguage"/></member>
+ <member><xref linkend="sql-createlanguage"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the materialized view (such as
other materialized views, or regular views),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-creatematerializedview"></member>
- <member><xref linkend="sql-altermaterializedview"></member>
- <member><xref linkend="sql-refreshmaterializedview"></member>
+ <member><xref linkend="sql-creatematerializedview"/></member>
+ <member><xref linkend="sql-altermaterializedview"/></member>
+ <member><xref linkend="sql-refreshmaterializedview"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the operator class (such as
indexes), and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteropclass"></member>
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-dropopfamily"></member>
+ <member><xref linkend="sql-alteropclass"/></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-dropopfamily"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the operator (such as views
using it), and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createoperator"></member>
- <member><xref linkend="sql-alteroperator"></member>
+ <member><xref linkend="sql-createoperator"/></member>
+ <member><xref linkend="sql-alteroperator"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the operator family,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alteropfamily"></member>
- <member><xref linkend="sql-createopfamily"></member>
- <member><xref linkend="sql-alteropclass"></member>
- <member><xref linkend="sql-createopclass"></member>
- <member><xref linkend="sql-dropopclass"></member>
+ <member><xref linkend="sql-alteropfamily"/></member>
+ <member><xref linkend="sql-createopfamily"/></member>
+ <member><xref linkend="sql-alteropclass"/></member>
+ <member><xref linkend="sql-createopclass"/></member>
+ <member><xref linkend="sql-dropopclass"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the affected objects,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
</para>
<para>
- The <xref linkend="sql-reassign-owned"> command is an alternative that
+ The <xref linkend="sql-reassign-owned"/> command is an alternative that
reassigns the ownership of all the database objects owned by one or
more roles. However, <command>REASSIGN OWNED</command> does not deal with
privileges for other objects.
</para>
<para>
- See <xref linkend="role-removal"> for more discussion.
+ See <xref linkend="role-removal"/> for more discussion.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-reassign-owned"></member>
- <member><xref linkend="sql-droprole"></member>
+ <member><xref linkend="sql-reassign-owned"/></member>
+ <member><xref linkend="sql-droprole"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createpolicy"></member>
- <member><xref linkend="sql-alterpolicy"></member>
+ <member><xref linkend="sql-createpolicy"/></member>
+ <member><xref linkend="sql-alterpolicy"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createpublication"></member>
- <member><xref linkend="sql-alterpublication"></member>
+ <member><xref linkend="sql-createpublication"/></member>
+ <member><xref linkend="sql-alterpublication"/></member>
</simplelist>
</refsect1>
</refentry>
of the cluster; an error will be raised if so. Before dropping the role,
you must drop all the objects it owns (or reassign their ownership)
and revoke any privileges the role has been granted on other objects.
- The <xref linkend="sql-reassign-owned"> and <xref linkend="sql-drop-owned">
- commands can be useful for this purpose; see <xref linkend="role-removal">
+ The <xref linkend="sql-reassign-owned"/> and <xref linkend="sql-drop-owned"/>
+ commands can be useful for this purpose; see <xref linkend="role-removal"/>
for more discussion.
</para>
<para>
<productname>PostgreSQL</productname> includes a program <xref
- linkend="app-dropuser"> that has the
+ linkend="app-dropuser"/> that has the
same functionality as this command (in fact, it calls this command)
but can be run from the command shell.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createrole"></member>
- <member><xref linkend="sql-alterrole"></member>
- <member><xref linkend="sql-set-role"></member>
+ <member><xref linkend="sql-createrole"/></member>
+ <member><xref linkend="sql-alterrole"/></member>
+ <member><xref linkend="sql-set-role"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the rule,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createrule"></member>
- <member><xref linkend="sql-alterrule"></member>
+ <member><xref linkend="sql-createrule"/></member>
+ <member><xref linkend="sql-alterrule"/></member>
</simplelist>
</refsect1>
Automatically drop objects (tables, functions, etc.) that are
contained in the schema,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterschema"></member>
- <member><xref linkend="sql-createschema"></member>
+ <member><xref linkend="sql-alterschema"/></member>
+ <member><xref linkend="sql-createschema"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the sequence,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createsequence"></member>
- <member><xref linkend="sql-altersequence"></member>
+ <member><xref linkend="sql-createsequence"/></member>
+ <member><xref linkend="sql-altersequence"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the server (such as
user mappings),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createserver"></member>
- <member><xref linkend="sql-alterserver"></member>
+ <member><xref linkend="sql-createserver"/></member>
+ <member><xref linkend="sql-alterserver"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterstatistics"></member>
- <member><xref linkend="sql-createstatistics"></member>
+ <member><xref linkend="sql-alterstatistics"/></member>
+ <member><xref linkend="sql-createstatistics"/></member>
</simplelist>
</refsect1>
actions on a remote host. Note that if the remote replication slot still
exists, it should then be dropped manually; otherwise it will continue to
reserve WAL and might eventually cause the disk to fill up. See
- also <xref linkend="logical-replication-subscription-slot">.
+ also <xref linkend="logical-replication-subscription-slot"/>.
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createsubscription"></member>
- <member><xref linkend="sql-altersubscription"></member>
+ <member><xref linkend="sql-createsubscription"/></member>
+ <member><xref linkend="sql-altersubscription"/></member>
</simplelist>
</refsect1>
</refentry>
<command>DROP TABLE</command> removes tables from the database.
Only the table owner, the schema owner, and superuser can drop a
table. To empty a table of rows
- without destroying the table, use <xref linkend="sql-delete">
- or <xref linkend="sql-truncate">.
+ without destroying the table, use <xref linkend="sql-delete"/>
+ or <xref linkend="sql-truncate"/>.
</para>
<para>
Automatically drop objects that depend on the table (such as
views),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertable"></member>
- <member><xref linkend="sql-createtable"></member>
+ <member><xref linkend="sql-altertable"/></member>
+ <member><xref linkend="sql-createtable"/></member>
</simplelist>
</refsect1>
dropped. It is possible that objects in other databases might still reside
in the tablespace even if no objects in the current database are using
the tablespace. Also, if the tablespace is listed in the <xref
- linkend="guc-temp-tablespaces"> setting of any active session, the
+ linkend="guc-temp-tablespaces"/> setting of any active session, the
<command>DROP</command> might fail due to temporary files residing in the
tablespace.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtablespace"></member>
- <member><xref linkend="sql-altertablespace"></member>
+ <member><xref linkend="sql-createtablespace"/></member>
+ <member><xref linkend="sql-altertablespace"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the transform,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<para>
This form of <command>DROP TRANSFORM</command> is a
<productname>PostgreSQL</productname> extension. See <xref
- linkend="sql-createtransform"> for details.
+ linkend="sql-createtransform"/> for details.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtransform"></member>
+ <member><xref linkend="sql-createtransform"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the trigger,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtrigger"></member>
+ <member><xref linkend="sql-createtrigger"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the text search configuration,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertsconfig"></member>
- <member><xref linkend="sql-createtsconfig"></member>
+ <member><xref linkend="sql-altertsconfig"/></member>
+ <member><xref linkend="sql-createtsconfig"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the text search dictionary,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertsdictionary"></member>
- <member><xref linkend="sql-createtsdictionary"></member>
+ <member><xref linkend="sql-altertsdictionary"/></member>
+ <member><xref linkend="sql-createtsdictionary"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the text search parser,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertsparser"></member>
- <member><xref linkend="sql-createtsparser"></member>
+ <member><xref linkend="sql-altertsparser"/></member>
+ <member><xref linkend="sql-createtsparser"/></member>
</simplelist>
</refsect1>
<para>
Automatically drop objects that depend on the text search template,
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertstemplate"></member>
- <member><xref linkend="sql-createtstemplate"></member>
+ <member><xref linkend="sql-altertstemplate"/></member>
+ <member><xref linkend="sql-createtstemplate"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the type (such as
table columns, functions, and operators),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-altertype"></member>
- <member><xref linkend="sql-createtype"></member>
+ <member><xref linkend="sql-altertype"/></member>
+ <member><xref linkend="sql-createtype"/></member>
</simplelist>
</refsect1>
<para>
<command>DROP USER</command> is simply an alternate spelling of
- <xref linkend="sql-droprole">.
+ <xref linkend="sql-droprole"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-droprole"></member>
+ <member><xref linkend="sql-droprole"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createusermapping"></member>
- <member><xref linkend="sql-alterusermapping"></member>
+ <member><xref linkend="sql-createusermapping"/></member>
+ <member><xref linkend="sql-alterusermapping"/></member>
</simplelist>
</refsect1>
Automatically drop objects that depend on the view (such as
other views),
and in turn all objects that depend on those objects
- (see <xref linkend="ddl-depend">).
+ (see <xref linkend="ddl-depend"/>).
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-alterview"></member>
- <member><xref linkend="sql-createview"></member>
+ <member><xref linkend="sql-alterview"/></member>
+ <member><xref linkend="sql-createview"/></member>
</simplelist>
</refsect1>
<para>
<application>dropdb</application> is a wrapper around the
- <acronym>SQL</acronym> command <xref linkend="sql-dropdatabase">.
+ <acronym>SQL</acronym> command <xref linkend="sql-dropdatabase"/>.
There is no effective difference between dropping databases via
this utility and via other methods for accessing the server.
</para>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-dropdatabase">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-dropdatabase"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-createdb"></member>
- <member><xref linkend="sql-dropdatabase"></member>
+ <member><xref linkend="app-createdb"/></member>
+ <member><xref linkend="sql-dropdatabase"/></member>
</simplelist>
</refsect1>
<para>
<application>dropuser</application> is a wrapper around the
- <acronym>SQL</acronym> command <xref linkend="sql-droprole">.
+ <acronym>SQL</acronym> command <xref linkend="sql-droprole"/>.
There is no effective difference between dropping users via
this utility and via other methods for accessing the server.
</para>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-droprole">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-droprole"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-createuser"></member>
- <member><xref linkend="sql-droprole"></member>
+ <member><xref linkend="app-createuser"/></member>
+ <member><xref linkend="sql-droprole"/></member>
</simplelist>
</refsect1>
<para>
This reference page does not describe the embedded SQL language.
- See <xref linkend="ecpg"> for more information on that topic.
+ See <xref linkend="ecpg"/> for more information on that topic.
</para>
</refsect1>
<para>
The value of either of these directories that is appropriate for
the installation can be found out using <xref
- linkend="app-pgconfig">.
+ linkend="app-pgconfig"/>.
</para>
</refsect1>
made by the transaction become visible to others and are guaranteed
to be durable if a crash occurs. This command is a
<productname>PostgreSQL</productname> extension
- that is equivalent to <xref linkend="sql-commit">.
+ that is equivalent to <xref linkend="sql-commit"/>.
</para>
</refsect1>
<title>Notes</title>
<para>
- Use <xref linkend="sql-rollback"> to
+ Use <xref linkend="sql-rollback"/> to
abort a transaction.
</para>
<para>
<command>END</command> is a <productname>PostgreSQL</productname>
extension that provides functionality equivalent to <xref
- linkend="sql-commit">, which is
+ linkend="sql-commit"/>, which is
specified in the SQL standard.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-rollback"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-rollback"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
For more information on the creation and usage of prepared statements,
- see <xref linkend="sql-prepare">.
+ see <xref linkend="sql-prepare"/>.
</para>
</refsect1>
<title>Examples</title>
<para>
Examples are given in the <xref linkend="sql-prepare-examples"
- endterm="sql-prepare-examples-title"> section of the <xref
- linkend="sql-prepare"> documentation.
+ endterm="sql-prepare-examples-title"/> section of the <xref
+ linkend="sql-prepare"/> documentation.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-deallocate"></member>
- <member><xref linkend="sql-prepare"></member>
+ <member><xref linkend="sql-deallocate"/></member>
+ <member><xref linkend="sql-prepare"/></member>
</simplelist>
</refsect1>
</refentry>
The command's result is a textual description of the plan selected
for the <replaceable class="parameter">statement</replaceable>,
optionally annotated with execution statistics.
- <xref linkend="using-explain"> describes the information provided.
+ <xref linkend="using-explain"/> describes the information provided.
</para>
</refsect1>
the <link linkend="autovacuum">autovacuum daemon</link> will take care
of that automatically. But if a table has recently had substantial
changes in its contents, you might need to do a manual
- <xref linkend="sql-analyze"> rather than wait for autovacuum to catch up
+ <xref linkend="sql-analyze"/> rather than wait for autovacuum to catch up
with the changes.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-analyze"></member>
+ <member><xref linkend="sql-analyze"/></member>
</simplelist>
</refsect1>
</refentry>
This page describes usage of cursors at the SQL command level.
If you are trying to use cursors inside a <application>PL/pgSQL</application>
function, the rules are different —
- see <xref linkend="plpgsql-cursors">.
+ see <xref linkend="plpgsql-cursors"/>.
</para>
</note>
</refsect1>
</para>
<para>
- <xref linkend="sql-declare">
+ <xref linkend="sql-declare"/>
is used to define a cursor. Use
- <xref linkend="sql-move">
+ <xref linkend="sql-move"/>
to change cursor position without retrieving data.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-close"></member>
- <member><xref linkend="sql-declare"></member>
- <member><xref linkend="sql-move"></member>
+ <member><xref linkend="sql-close"/></member>
+ <member><xref linkend="sql-declare"/></member>
+ <member><xref linkend="sql-move"/></member>
</simplelist>
</refsect1>
</refentry>
creates the object; then there is no window in which another user
can use the object.)
Also, these initial default privilege settings can be changed using the
- <xref linkend="sql-alterdefaultprivileges">
+ <xref linkend="sql-alterdefaultprivileges"/>
command.
</para>
<term><literal>SELECT</literal></term>
<listitem>
<para>
- Allows <xref linkend="sql-select"> from
+ Allows <xref linkend="sql-select"/> from
any column, or the specific columns listed, of the specified table,
view, or sequence.
Also allows the use of
- <xref linkend="sql-copy"> TO.
+ <xref linkend="sql-copy"/> TO.
This privilege is also needed to reference existing column values in
- <xref linkend="sql-update"> or
- <xref linkend="sql-delete">.
+ <xref linkend="sql-update"/> or
+ <xref linkend="sql-delete"/>.
For sequences, this privilege also allows the use of the
<function>currval</function> function.
For large objects, this privilege allows the object to be read.
<term><literal>INSERT</literal></term>
<listitem>
<para>
- Allows <xref linkend="sql-insert"> of a new
+ Allows <xref linkend="sql-insert"/> of a new
row into the specified table. If specific columns are listed,
only those columns may be assigned to in the <command>INSERT</command>
command (other columns will therefore receive default values).
- Also allows <xref linkend="sql-copy"> FROM.
+ Also allows <xref linkend="sql-copy"/> FROM.
</para>
</listitem>
</varlistentry>
<term><literal>UPDATE</literal></term>
<listitem>
<para>
- Allows <xref linkend="sql-update"> of any
+ Allows <xref linkend="sql-update"/> of any
column, or the specific columns listed, of the specified table.
(In practice, any nontrivial <command>UPDATE</command> command will require
<literal>SELECT</literal> privilege as well, since it must reference table
<term><literal>DELETE</literal></term>
<listitem>
<para>
- Allows <xref linkend="sql-delete"> of a row
+ Allows <xref linkend="sql-delete"/> of a row
from the specified table.
(In practice, any nontrivial <command>DELETE</command> command will require
<literal>SELECT</literal> privilege as well, since it must reference table
<term><literal>TRUNCATE</literal></term>
<listitem>
<para>
- Allows <xref linkend="sql-truncate"> on
+ Allows <xref linkend="sql-truncate"/> on
the specified table.
</para>
</listitem>
<para>
Allows creation of a foreign key constraint referencing the specified
table, or specified column(s) of the table. (See the
- <xref linkend="sql-createtable"> statement.)
+ <xref linkend="sql-createtable"/> statement.)
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Allows the creation of a trigger on the specified table. (See the
- <xref linkend="sql-createtrigger"> statement.)
+ <xref linkend="sql-createtrigger"/> statement.)
</para>
</listitem>
</varlistentry>
<title>Notes</title>
<para>
- The <xref linkend="sql-revoke"> command is used
+ The <xref linkend="sql-revoke"/> command is used
to revoke access privileges.
</para>
</para>
<para>
- Use <xref linkend="app-psql">'s <command>\dp</command> command
+ Use <xref linkend="app-psql"/>'s <command>\dp</command> command
to obtain information about existing privileges for tables and
columns. For example:
<programlisting>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-revoke"></member>
- <member><xref linkend="sql-alterdefaultprivileges"></member>
+ <member><xref linkend="sql-revoke"/></member>
+ <member><xref linkend="sql-alterdefaultprivileges"/></member>
</simplelist>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createforeigntable"></member>
- <member><xref linkend="sql-createserver"></member>
+ <member><xref linkend="sql-createforeigntable"/></member>
+ <member><xref linkend="sql-createserver"/></member>
</simplelist>
</refsect1>
</refentry>
default for all locale categories, including collation order and
character set classes. All server locale values (<literal>lc_*</literal>) can
be displayed via <command>SHOW ALL</command>.
- More details can be found in <xref linkend="locale">.
+ More details can be found in <xref linkend="locale"/>.
</para>
<para>
To alter the default encoding, use the <option>--encoding</option>.
- More details can be found in <xref linkend="multibyte">.
+ More details can be found in <xref linkend="multibyte"/>.
</para>
</refsect1>
unless you override it there. The default is derived from the locale, or
<literal>SQL_ASCII</literal> if that does not work. The character sets supported by
the <productname>PostgreSQL</productname> server are described
- in <xref linkend="multibyte-charset-supported">.
+ in <xref linkend="multibyte-charset-supported"/>.
</para>
</listitem>
</varlistentry>
Sets the default locale for the database cluster. If this
option is not specified, the locale is inherited from the
environment that <command>initdb</command> runs in. Locale
- support is described in <xref linkend="locale">.
+ support is described in <xref linkend="locale"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Sets the default text search configuration.
- See <xref linkend="guc-default-text-search-config"> for further information.
+ See <xref linkend="guc-default-text-search-config"/> for further information.
</para>
</listitem>
</varlistentry>
<para>
Specifies the default time zone of the created database cluster. The
value should be a full time zone name
- (see <xref linkend="datatype-timezones">).
+ (see <xref linkend="datatype-timezones"/>).
</para>
</listitem>
</varlistentry>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pg-ctl"></member>
- <member><xref linkend="app-postgres"></member>
+ <member><xref linkend="app-pg-ctl"/></member>
+ <member><xref linkend="app-postgres"/></member>
</simplelist>
</refsect1>
<literal>ON CONFLICT</literal> can be used to specify an alternative
action to raising a unique constraint or exclusion constraint
violation error. (See <xref linkend="sql-on-conflict"
- endterm="sql-on-conflict-title"> below.)
+ endterm="sql-on-conflict-title"/> below.)
</para>
<para>
<para>
The <literal>WITH</literal> clause allows you to specify one or more
subqueries that can be referenced by name in the <command>INSERT</command>
- query. See <xref linkend="queries-with"> and <xref linkend="sql-select">
+ query. See <xref linkend="queries-with"/> and <xref linkend="sql-select"/>
for details.
</para>
<para>
<para>
A query (<command>SELECT</command> statement) that supplies the
rows to be inserted. Refer to the
- <xref linkend="sql-select">
+ <xref linkend="sql-select"/>
statement for a description of the syntax.
</para>
</listitem>
<para>
Possible limitations of the <replaceable
class="parameter">query</replaceable> clause are documented under
- <xref linkend="sql-select">.
+ <xref linkend="sql-select"/>.
</para>
</refsect1>
</refentry>
</para>
<para>
- <xref linkend="sql-notify">
+ <xref linkend="sql-notify"/>
contains a more extensive
discussion of the use of <command>LISTEN</command> and
<command>NOTIFY</command>.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-notify"></member>
- <member><xref linkend="sql-unlisten"></member>
+ <member><xref linkend="sql-notify"/></member>
+ <member><xref linkend="sql-unlisten"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The library file name is typically given as just a bare file name,
which is sought in the server's library search path (set
- by <xref linkend="guc-dynamic-library-path">). Alternatively it can be
+ by <xref linkend="guc-dynamic-library-path"/>). Alternatively it can be
given as a full path name. In either case the platform's standard shared
library file name extension may be omitted.
- See <xref linkend="xfunc-c-dynload"> for more information on this topic.
+ See <xref linkend="xfunc-c-dynload"/> for more information on this topic.
</para>
<indexterm>
<title>See Also</title>
<para>
- <xref linkend="sql-createfunction">
+ <xref linkend="sql-createfunction"/>
</para>
</refsect1>
</refentry>
<para>
More information about the lock modes and locking strategies can be
- found in <xref linkend="explicit-locking">.
+ found in <xref linkend="explicit-locking"/>.
</para>
</refsect1>
<listitem>
<para>
The lock mode specifies which locks this lock conflicts with.
- Lock modes are described in <xref linkend="explicit-locking">.
+ Lock modes are described in <xref linkend="explicit-locking"/>.
</para>
<para>
<productname>PostgreSQL</productname> reports an error if <command>LOCK</command>
is used outside a transaction block.
Use
- <xref linkend="sql-begin"> and
- <xref linkend="sql-commit">
- (or <xref linkend="sql-rollback">)
+ <xref linkend="sql-begin"/> and
+ <xref linkend="sql-commit"/>
+ (or <xref linkend="sql-rollback"/>)
to define a transaction block.
</para>
mind that all the lock modes have identical semantics so far as
<command>LOCK TABLE</command> is concerned, differing only in the rules
about which modes conflict with which. For information on how to
- acquire an actual row-level lock, see <xref linkend="locking-rows">
+ acquire an actual row-level lock, see <xref linkend="locking-rows"/>
and the <xref linkend="sql-for-update-share"
- endterm="sql-for-update-share-title"> in the <command>SELECT</command>
+ endterm="sql-for-update-share-title"/> in the <command>SELECT</command>
reference documentation.
</para>
</refsect1>
There is no <command>LOCK TABLE</command> in the SQL standard,
which instead uses <command>SET TRANSACTION</command> to specify
concurrency levels on transactions. <productname>PostgreSQL</productname> supports that too;
- see <xref linkend="sql-set-transaction"> for details.
+ see <xref linkend="sql-set-transaction"/> for details.
</para>
<para>
<para>
The parameters for the <command>MOVE</command> command are identical to
those of the <command>FETCH</command> command; refer to
- <xref linkend="sql-fetch">
+ <xref linkend="sql-fetch"/>
for details on syntax and usage.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-close"></member>
- <member><xref linkend="sql-declare"></member>
- <member><xref linkend="sql-fetch"></member>
+ <member><xref linkend="sql-close"/></member>
+ <member><xref linkend="sql-declare"/></member>
+ <member><xref linkend="sql-fetch"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The function <function>pg_notification_queue_usage</function> returns the
fraction of the queue that is currently occupied by pending notifications.
- See <xref linkend="functions-info"> for more information.
+ See <xref linkend="functions-info"/> for more information.
</para>
<para>
A transaction that has executed <command>NOTIFY</command> cannot be
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-listen"></member>
- <member><xref linkend="sql-unlisten"></member>
+ <member><xref linkend="sql-listen"/></member>
+ <member><xref linkend="sql-unlisten"/></member>
</simplelist>
</refsect1>
</refentry>
<application>pg_basebackup</application> is used to take base backups of
a running <productname>PostgreSQL</productname> database cluster. These
are taken without affecting other clients to the database, and can be used
- both for point-in-time recovery (see <xref linkend="continuous-archiving">)
+ both for point-in-time recovery (see <xref linkend="continuous-archiving"/>)
and as the starting point for a log shipping or streaming replication standby
- servers (see <xref linkend="warm-standby">).
+ servers (see <xref linkend="warm-standby"/>).
</para>
<para>
out of backup mode automatically. Backups are always taken of the entire
database cluster; it is not possible to back up individual databases or
database objects. For individual database backups, a tool such as
- <xref linkend="app-pgdump"> must be used.
+ <xref linkend="app-pgdump"/> must be used.
</para>
<para>
The backup is made over a regular <productname>PostgreSQL</productname>
connection, and uses the replication protocol. The connection must be made
with a superuser or a user having <literal>REPLICATION</literal>
- permissions (see <xref linkend="role-attributes">),
+ permissions (see <xref linkend="role-attributes"/>),
and <filename>pg_hba.conf</filename> must explicitly permit the replication
connection. The server must also be configured
- with <xref linkend="guc-max-wal-senders"> set high enough to leave at least
+ with <xref linkend="guc-max-wal-senders"/> set high enough to leave at least
one session available for the backup and one for WAL streaming (if used).
</para>
<application>pg_basebackup</application> can make a base backup from
not only the master but also the standby. To take a backup from the standby,
set up the standby so that it can accept replication connections (that is, set
- <varname>max_wal_senders</varname> and <xref linkend="guc-hot-standby">,
+ <varname>max_wal_senders</varname> and <xref linkend="guc-hot-standby"/>,
and configure <link linkend="auth-pg-hba-conf">host-based authentication</link>).
- You will also need to enable <xref linkend="guc-full-page-writes"> on the master.
+ You will also need to enable <xref linkend="guc-full-page-writes"/> on the master.
</para>
<para>
<para>
The write-ahead log files are collected at the end of the backup.
Therefore, it is necessary for the
- <xref linkend="guc-wal-keep-segments"> parameter to be set high
+ <xref linkend="guc-wal-keep-segments"/> parameter to be set high
enough that the log is not removed before the end of the backup.
If the log has been rotated when it's time to transfer it, the
backup will fail and be unusable.
open a second connection to the server and start streaming the
write-ahead log in parallel while running the backup. Therefore,
it will use up two connections configured by the
- <xref linkend="guc-max-wal-senders"> parameter. As long as the
+ <xref linkend="guc-max-wal-senders"/> parameter. As long as the
client can keep up with write-ahead log received, using this mode
requires no extra write-ahead logs to be saved on the master.
</para>
<term><option>--checkpoint=<replaceable class="parameter">fast|spread</replaceable></option></term>
<listitem>
<para>
- Sets checkpoint mode to fast (immediate) or spread (default) (see <xref linkend="backup-lowlevel-base-backup">).
+ Sets checkpoint mode to fast (immediate) or spread (default) (see <xref linkend="backup-lowlevel-base-backup"/>).
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Specifies parameters used to connect to the server, as a connection
- string. See <xref linkend="libpq-connstring"> for more information.
+ string. See <xref linkend="libpq-connstring"/> for more information.
</para>
<para>
The option is called <literal>--dbname</literal> for consistency with other
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
symbolic links used for tablespaces are preserved. Symbolic links pointing
to certain directories known to PostgreSQL are copied as empty directories.
Other symbolic links and special device files are skipped.
- See <xref linkend="protocol-replication"> for the precise details.
+ See <xref linkend="protocol-replication"/> for the precise details.
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pgdump"></member>
+ <member><xref linkend="app-pgdump"/></member>
</simplelist>
</refsect1>
<application>pg_ctl</application> is a utility for initializing a
<productname>PostgreSQL</productname> database cluster, starting,
stopping, or restarting the <productname>PostgreSQL</productname>
- database server (<xref linkend="app-postgres">), or displaying the
+ database server (<xref linkend="app-postgres"/>), or displaying the
status of a running server. Although the server can be started
manually, <application>pg_ctl</application> encapsulates tasks such
as redirecting log output and properly detaching from the terminal
<productname>PostgreSQL</productname> database cluster, that is,
a collection of databases that will be managed by a single
server instance. This mode invokes the <command>initdb</command>
- command. See <xref linkend="app-initdb"> for details.
+ command. See <xref linkend="app-initdb"/> for details.
</para>
<para>
default is <literal>PostgreSQL</literal>. Note that this only controls
messages sent from <application>pg_ctl</application> itself; once
started, the server will use the event source specified
- by its <xref linkend="guc-event-source"> parameter. Should the server
+ by its <xref linkend="guc-event-source"/> parameter. Should the server
fail very early in startup, before that parameter has been set,
it might also log using the default event
source name <literal>PostgreSQL</literal>.
<command>pg_ctl</command>, like most other <productname>PostgreSQL</productname>
utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
<para>
For additional variables that affect the server,
- see <xref linkend="app-postgres">.
+ see <xref linkend="app-postgres"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-initdb"></member>
- <member><xref linkend="app-postgres"></member>
+ <member><xref linkend="app-initdb"/></member>
+ <member><xref linkend="app-postgres"/></member>
</simplelist>
</refsect1>
<para>
<application>pg_dump</application> only dumps a single database. To backup
global objects that are common to all databases in a cluster, such as roles
- and tablespaces, use <xref linkend="app-pg-dumpall">.
+ and tablespaces, use <xref linkend="app-pg-dumpall"/>.
</para>
<para>
dumps are plain-text files containing the SQL commands required
to reconstruct the database to the state it was in at the time it was
saved. To restore from such a script, feed it to <xref
- linkend="app-psql">. Script files
+ linkend="app-psql"/>. Script files
can be used to reconstruct the database even on other machines and
other architectures; with some modifications, even on other SQL
database products.
<para>
The alternative archive file formats must be used with
- <xref linkend="app-pgrestore"> to rebuild the database. They
+ <xref linkend="app-pgrestore"/> to rebuild the database. They
allow <application>pg_restore</application> to be selective about
what is restored, or even to reorder the items prior to being
restored.
can write their data at the same time.
</para>
<para><application>pg_dump</application> will open <replaceable class="parameter">njobs</replaceable>
- + 1 connections to the database, so make sure your <xref linkend="guc-max-connections">
+ + 1 connections to the database, so make sure your <xref linkend="guc-max-connections"/>
setting is high enough to accommodate all connections.
</para>
<para>
<replaceable class="parameter">schema</replaceable> parameter is
interpreted as a pattern according to the same rules used by
<application>psql</application>'s <literal>\d</literal> commands (see <xref
- linkend="app-psql-patterns" endterm="app-psql-patterns-title">),
+ linkend="app-psql-patterns" endterm="app-psql-patterns-title"/>),
so multiple schemas can also be selected by writing wildcard characters
in the pattern. When using wildcards, be careful to quote the pattern
if needed to prevent the shell from expanding the wildcards; see
- <xref linkend="pg-dump-examples" endterm="pg-dump-examples-title">.
+ <xref linkend="pg-dump-examples" endterm="pg-dump-examples-title"/>.
</para>
<note>
<replaceable class="parameter">table</replaceable> parameter is
interpreted as a pattern according to the same rules used by
<application>psql</application>'s <literal>\d</literal> commands (see <xref
- linkend="app-psql-patterns" endterm="app-psql-patterns-title">),
+ linkend="app-psql-patterns" endterm="app-psql-patterns-title"/>),
so multiple tables can also be selected by writing wildcard characters
in the pattern. When using wildcards, be careful to quote the pattern
if needed to prevent the shell from expanding the wildcards; see
- <xref linkend="pg-dump-examples" endterm="pg-dump-examples-title">.
+ <xref linkend="pg-dump-examples" endterm="pg-dump-examples-title"/>.
</para>
<para>
<para>
This option is relevant only when dumping the contents of a table
which has row security. By default, <application>pg_dump</application> will set
- <xref linkend="guc-row-security"> to off, to ensure
+ <xref linkend="guc-row-security"/> to off, to ensure
that all data is dumped from the table. If the user does not have
sufficient privileges to bypass row security, then an error is thrown.
This parameter instructs <application>pg_dump</application> to set
- <xref linkend="guc-row-security"> to on instead, allowing the user
+ <xref linkend="guc-row-security"/> to on instead, allowing the user
to dump the parts of the contents of the table that they have access to.
</para>
states; but do this by waiting for a point in the transaction stream
at which no anomalies can be present, so that there isn't a risk of
the dump failing or causing other transactions to roll back with a
- <literal>serialization_failure</literal>. See <xref linkend="mvcc">
+ <literal>serialization_failure</literal>. See <xref linkend="mvcc"/>
for more information about transaction isolation and concurrency
control.
</para>
<para>
Use the specified synchronized snapshot when making a dump of the
database (see
- <xref linkend="functions-snapshot-synchronization-table"> for more
+ <xref linkend="functions-snapshot-synchronization-table"/> for more
details).
</para>
<para>
This option is useful when needing to synchronize the dump with
- a logical replication slot (see <xref linkend="logicaldecoding">)
+ a logical replication slot (see <xref linkend="logicaldecoding"/>)
or with a concurrent session.
</para>
<para>
with a valid <acronym>URI</acronym> prefix
(<literal>postgresql://</literal>
or <literal>postgres://</literal>), it is treated as a
- <parameter>conninfo</parameter> string. See <xref linkend="libpq-connect"> for more information.
+ <parameter>conninfo</parameter> string. See <xref linkend="libpq-connect"/> for more information.
</para>
</listitem>
</varlistentry>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<command>SELECT</command> statements. If you have problems running
<application>pg_dump</application>, make sure you are able to
select information from the database using, for example, <xref
- linkend="app-psql">. Also, any default connection settings and environment
+ linkend="app-psql"/>. Also, any default connection settings and environment
variables used by the <application>libpq</application> front-end
library will apply.
</para>
does not contain the statistics used by the optimizer to make
query planning decisions. Therefore, it is wise to run
<command>ANALYZE</command> after restoring from a dump file
- to ensure optimal performance; see <xref linkend="vacuum-for-statistics">
- and <xref linkend="autovacuum"> for more information.
+ to ensure optimal performance; see <xref linkend="vacuum-for-statistics"/>
+ and <xref linkend="autovacuum"/> for more information.
The dump file also does not
contain any <command>ALTER DATABASE ... SET</command> commands;
- these settings are dumped by <xref linkend="app-pg-dumpall">,
+ these settings are dumped by <xref linkend="app-pg-dumpall"/>,
along with database users and other installation-wide settings.
</para>
To specify an upper-case or mixed-case name in <option>-t</option> and related
switches, you need to double-quote the name; else it will be folded to
lower case (see <xref
- linkend="app-psql-patterns" endterm="app-psql-patterns-title">). But
+ linkend="app-psql-patterns" endterm="app-psql-patterns-title"/>). But
double quotes are special to the shell, so in turn they must be quoted.
Thus, to dump a single table with a mixed-case name, you need something
like
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pg-dumpall"></member>
- <member><xref linkend="app-pgrestore"></member>
- <member><xref linkend="app-psql"></member>
+ <member><xref linkend="app-pg-dumpall"/></member>
+ <member><xref linkend="app-pgrestore"/></member>
+ <member><xref linkend="app-psql"/></member>
</simplelist>
</refsect1>
(<quote>dumping</quote>) all <productname>PostgreSQL</productname> databases
of a cluster into one script file. The script file contains
<acronym>SQL</acronym> commands that can be used as input to <xref
- linkend="app-psql"> to restore the databases. It does this by
- calling <xref linkend="app-pgdump"> for each database in a cluster.
+ linkend="app-psql"/> to restore the databases. It does this by
+ calling <xref linkend="app-pgdump"/> for each database in a cluster.
<application>pg_dumpall</application> also dumps global objects
that are common to all databases.
(<application>pg_dump</application> does not save these objects.)
database). If you use password authentication it will ask for
a password each time. It is convenient to have a
<filename>~/.pgpass</filename> file in such cases. See <xref
- linkend="libpq-pgpass"> for more information.
+ linkend="libpq-pgpass"/> for more information.
</para>
</refsect1>
<listitem>
<para>
Specifies parameters used to connect to the server, as a connection
- string. See <xref linkend="libpq-connstring"> for more information.
+ string. See <xref linkend="libpq-connstring"/> for more information.
</para>
<para>
The option is called <literal>--dbname</literal> for consistency with other
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>See Also</title>
<para>
- Check <xref linkend="app-pgdump"> for details on possible
+ Check <xref linkend="app-pgdump"/> for details on possible
error conditions.
</para>
</refsect1>
(<literal>postgresql://</literal>
or <literal>postgres://</literal>), it is treated as a
<parameter>conninfo</parameter> string. See <xref
- linkend="libpq-connstring"> for more information.
+ linkend="libpq-connstring"/> for more information.
</para>
</listitem>
</varlistentry>
<command>pg_isready</command>, like most other <productname>PostgreSQL</productname>
utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
log is streamed using the streaming replication protocol, and is written
to a local directory of files. This directory can be used as the archive
location for doing a restore using point-in-time recovery (see
- <xref linkend="continuous-archiving">).
+ <xref linkend="continuous-archiving"/>).
</para>
<para>
<application>pg_receivewal</application> streams the write-ahead
log in real time as it's being generated on the server, and does not wait
- for segments to complete like <xref linkend="guc-archive-command"> does.
+ for segments to complete like <xref linkend="guc-archive-command"/> does.
For this reason, it is not necessary to set
- <xref linkend="guc-archive-timeout"> when using
+ <xref linkend="guc-archive-timeout"/> when using
<application>pg_receivewal</application>.
</para>
<productname>PostgreSQL</productname> connection and uses the replication
protocol. The connection must be made with a superuser or a user
having <literal>REPLICATION</literal> permissions (see
- <xref linkend="role-attributes">), and <filename>pg_hba.conf</filename>
+ <xref linkend="role-attributes"/>), and <filename>pg_hba.conf</filename>
must permit the replication connection. The server must also be
- configured with <xref linkend="guc-max-wal-senders"> set high enough to
+ configured with <xref linkend="guc-max-wal-senders"/> set high enough to
leave at least one session available for the stream.
</para>
<listitem>
<para>
Require <application>pg_receivewal</application> to use an existing
- replication slot (see <xref linkend="streaming-replication-slots">).
+ replication slot (see <xref linkend="streaming-replication-slots"/>).
When this option is used, <application>pg_receivewal</application> will report
a flush position to the server, indicating when each segment has been
synchronized to disk so that the server can remove that segment if it
<listitem>
<para>
Specifies parameters used to connect to the server, as a connection
- string. See <xref linkend="libpq-connstring"> for more information.
+ string. See <xref linkend="libpq-connstring"/> for more information.
</para>
<para>
The option is called <literal>--dbname</literal> for consistency with other
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<para>
When using <application>pg_receivewal</application> instead of
- <xref linkend="guc-archive-command"> as the main WAL backup method, it is
+ <xref linkend="guc-archive-command"/> as the main WAL backup method, it is
strongly recommended to use replication slots. Otherwise, the server is
free to recycle or remove write-ahead log files before they are backed up,
because it does not have any information, either
- from <xref linkend="guc-archive-command"> or the replication slots, about
+ from <xref linkend="guc-archive-command"/> or the replication slots, about
how far the WAL stream has been archived. Note, however, that a
replication slot will fill up the server's disk space if the receiver does
not keep up with fetching the WAL data.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pgbasebackup"></member>
+ <member><xref linkend="app-pgbasebackup"/></member>
</simplelist>
</refsect1>
<para>
It creates a replication-mode connection, so it is subject to the same
- constraints as <xref linkend="app-pgreceivewal">, plus those for logical
- replication (see <xref linkend="logicaldecoding">).
+ constraints as <xref linkend="app-pgreceivewal"/>, plus those for logical
+ replication (see <xref linkend="logicaldecoding"/>).
</para>
<para>
<para>
In <option>--start</option> mode, start replication from the given
LSN. For details on the effect of this, see the documentation
- in <xref linkend="logicaldecoding">
- and <xref linkend="protocol-replication">. Ignored in other modes.
+ in <xref linkend="logicaldecoding"/>
+ and <xref linkend="protocol-replication"/>. Ignored in other modes.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
When creating a slot, use the specified logical decoding output
- plugin. See <xref linkend="logicaldecoding">. This option has no
+ plugin. See <xref linkend="logicaldecoding"/>. This option has no
effect if the slot already exists.
</para>
</listitem>
<listitem>
<para>
This option has the same effect as the option of the same name
- in <xref linkend="app-pgreceivewal">. See the description there.
+ in <xref linkend="app-pgreceivewal"/>. See the description there.
</para>
</listitem>
</varlistentry>
<para>
The database to connect to. See the description of the actions for
what this means in detail. This can be a <application>libpq</application> connection string;
- see <xref linkend="libpq-connstring"> for more information. Defaults
+ see <xref linkend="libpq-connstring"/> for more information. Defaults
to user name.
</para>
</listitem>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Examples</title>
<para>
- See <xref linkend="logicaldecoding-example"> for an example.
+ See <xref linkend="logicaldecoding-example"/> for an example.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pgreceivewal"></member>
+ <member><xref linkend="app-pgreceivewal"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pgcontroldata"></member>
+ <member><xref linkend="app-pgcontroldata"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<application>pg_restore</application> is a utility for restoring a
<productname>PostgreSQL</productname> database from an archive
- created by <xref linkend="app-pgdump"> in one of the non-plain-text
+ created by <xref linkend="app-pgdump"/> in one of the non-plain-text
formats. It will issue the commands necessary to reconstruct the
database to the state it was in at the time it was saved. The
archive files also allow <application>pg_restore</application> to
<para>
This option is relevant only when restoring the contents of a table
which has row security. By default, <application>pg_restore</application> will set
- <xref linkend="guc-row-security"> to off, to ensure
+ <xref linkend="guc-row-security"/> to off, to ensure
that all data is restored in to the table. If the user does not have
sufficient privileges to bypass row security, then an error is thrown.
This parameter instructs <application>pg_restore</application> to set
- <xref linkend="guc-row-security"> to on instead, allowing the user to attempt to restore
+ <xref linkend="guc-row-security"/> to on instead, allowing the user to attempt to restore
the contents of the table with row security enabled. This might still
fail if the user does not have the right to insert the rows from the
dump into the table.
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">). However, it does not read
+ (see <xref linkend="libpq-envars"/>). However, it does not read
<envar>PGDATABASE</envar> when a database name is not supplied.
</para>
internally executes <acronym>SQL</acronym> statements. If you have
problems running <application>pg_restore</application>, make sure
you are able to select information from the database using, for
- example, <xref linkend="app-psql">. Also, any default connection
+ example, <xref linkend="app-psql"/>. Also, any default connection
settings and environment variables used by the
<application>libpq</application> front-end library will apply.
</para>
</para>
<para>
- See also the <xref linkend="app-pgdump"> documentation for details on
+ See also the <xref linkend="app-pgdump"/> documentation for details on
limitations of <application>pg_dump</application>.
</para>
<para>
Once restored, it is wise to run <command>ANALYZE</command> on each
restored table so the optimizer has useful statistics; see
- <xref linkend="vacuum-for-statistics"> and
- <xref linkend="autovacuum"> for more information.
+ <xref linkend="vacuum-for-statistics"/> and
+ <xref linkend="autovacuum"/> for more information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-pgdump"></member>
- <member><xref linkend="app-pg-dumpall"></member>
- <member><xref linkend="app-psql"></member>
+ <member><xref linkend="app-pgdump"/></member>
+ <member><xref linkend="app-pg-dumpall"/></member>
+ <member><xref linkend="app-psql"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<application>pg_rewind</application> requires that the target server either has
- the <xref linkend="guc-wal-log-hints"> option enabled
+ the <xref linkend="guc-wal-log-hints"/> option enabled
in <filename>postgresql.conf</filename> or data checksums enabled when
the cluster was initialized with <application>initdb</application>. Neither of these
- are currently on by default. <xref linkend="guc-full-page-writes">
+ are currently on by default. <xref linkend="guc-full-page-writes"/>
must also be set to <literal>on</literal>, but is enabled by default.
</para>
</refsect1>
<para>
When <option>--source-server</option> option is used,
<application>pg_rewind</application> also uses the environment variables
- supported by <application>libpq</application> (see <xref linkend="libpq-envars">).
+ supported by <application>libpq</application> (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="wal-internals"></member>
+ <member><xref linkend="wal-internals"/></member>
</simplelist>
</refsect1>
<para>
<application>pg_archivecleanup</application> is designed to be used as an
<literal>archive_cleanup_command</literal> to clean up WAL file archives when
- running as a standby server (see <xref linkend="warm-standby">).
+ running as a standby server (see <xref linkend="warm-standby"/>).
<application>pg_archivecleanup</application> can also be used as a standalone program to
clean WAL file archives.
</para>
files should be removed.
</para>
<para>
- When used within <xref linkend="archive-cleanup-command">, all WAL files
+ When used within <xref linkend="archive-cleanup-command"/>, all WAL files
logically preceding the value of the <literal>%r</literal> argument will be removed
from <replaceable>archivelocation</replaceable>. This minimizes the number of files
that need to be retained, while preserving crash-restart capability. Use of
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="pgstandby"></member>
+ <member><xref linkend="pgstandby"/></member>
</simplelist>
</refsect1>
</refentry>
<para><literal>prepared</literal>: use extended query protocol with prepared statements.</para>
</listitem>
</itemizedlist>
- The default is simple query protocol. (See <xref linkend="protocol">
+ The default is simple query protocol. (See <xref linkend="protocol"/>
for more information.)
</para>
</listitem>
explained above, or by the meta commands explained below.
In addition to any variables preset by <option>-D</option> command-line options,
there are a few variables that are preset automatically, listed in
- <xref linkend="pgbench-automatic-variables">. A value specified for these
+ <xref linkend="pgbench-automatic-variables"/>. A value specified for these
variables using <option>-D</option> takes precedence over the automatic presets.
Once set, a variable's
value can be inserted into a SQL command by writing
<title>Built-In Functions</title>
<para>
- The functions listed in <xref linkend="pgbench-functions"> are built
+ The functions listed in <xref linkend="pgbench-functions"/> are built
into <application>pgbench</application> and may be used in expressions appearing in
<link linkend="pgbench-metacommand-set"><literal>\set</literal></link>.
</para>
<para>
<application>pg_test_fsync</application> is intended to give you a reasonable
- idea of what the fastest <xref linkend="guc-wal-sync-method"> is on your
+ idea of what the fastest <xref linkend="guc-wal-sync-method"/> is on your
specific system,
as well as supplying diagnostic information in the event of an identified I/O
problem. However, differences shown by
are not speed-limited by their write-ahead logs.
<application>pg_test_fsync</application> reports average file sync operation
time in microseconds for each <literal>wal_sync_method</literal>, which can also be used to
- inform efforts to optimize the value of <xref linkend="guc-commit-delay">.
+ inform efforts to optimize the value of <xref linkend="guc-commit-delay"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-postgres"></member>
+ <member><xref linkend="app-postgres"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-explain"></member>
+ <member><xref linkend="sql-explain"/></member>
</simplelist>
</refsect1>
</refentry>
<command>pg_upgrade</command> will connect to the old and new servers several
times, so you might want to set authentication to <literal>peer</literal>
in <filename>pg_hba.conf</filename> or use a <filename>~/.pgpass</filename> file
- (see <xref linkend="libpq-pgpass">).
+ (see <xref linkend="libpq-pgpass"/>).
</para>
</step>
<para>
If you are upgrading standby servers using methods outlined in section <xref
- linkend="pgupgrade-step-replicas">, verify that the old standby
+ linkend="pgupgrade-step-replicas"/>, verify that the old standby
servers are caught up by running <application>pg_controldata</application>
against the old primary and standby clusters. Verify that the
<quote>Latest checkpoint location</quote> values match in all clusters.
<para>
If an error occurs while restoring the database schema, <command>pg_upgrade</command> will
- exit and you will have to revert to the old cluster as outlined in <xref linkend="pgupgrade-step-revert">
+ exit and you will have to revert to the old cluster as outlined in <xref linkend="pgupgrade-step-revert"/>
below. To try <command>pg_upgrade</command> again, you will need to modify the old
cluster so the pg_upgrade schema restore succeeds. If the problem is a
<filename>contrib</filename> module, you might need to uninstall the <filename>contrib</filename> module from
<para>
If you used link mode and have Streaming Replication (see <xref
- linkend="streaming-replication">) or Log-Shipping (see <xref
- linkend="warm-standby">) standby servers, you can follow these steps to
+ linkend="streaming-replication"/>) or Log-Shipping (see <xref
+ linkend="warm-standby"/>) standby servers, you can follow these steps to
quickly upgrade them. You will not be running <application>pg_upgrade</application> on
the standby servers, but rather <application>rsync</application> on the primary.
Do not start any servers yet.
is necessary because <command>rsync</command> only has file modification-time
granularity of one second.) You might want to exclude some
files, e.g. <filename>postmaster.pid</filename>, as documented in <xref
- linkend="backup-lowlevel-base-backup">. If your file system supports
+ linkend="backup-lowlevel-base-backup"/>. If your file system supports
file system snapshots or copy-on-write file copies, you can use that
to make a backup of the old cluster and tablespaces, though the snapshot
and copies must be created simultaneously or while the database server
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-initdb"></member>
- <member><xref linkend="app-pg-ctl"></member>
- <member><xref linkend="app-pgdump"></member>
- <member><xref linkend="app-postgres"></member>
+ <member><xref linkend="app-initdb"/></member>
+ <member><xref linkend="app-pg-ctl"/></member>
+ <member><xref linkend="app-pgdump"/></member>
+ <member><xref linkend="app-postgres"/></member>
</simplelist>
</refsect1>
</refentry>
<option>-D</option> option or the <envar>PGDATA</envar> environment
variable; there is no default. Typically, <option>-D</option> or
<envar>PGDATA</envar> points directly to the data area directory
- created by <xref linkend="app-initdb">. Other possible file layouts are
- discussed in <xref linkend="runtime-config-file-locations">.
+ created by <xref linkend="app-initdb"/>. Other possible file layouts are
+ discussed in <xref linkend="runtime-config-file-locations"/>.
</para>
<para>
<para>
The <command>postgres</command> command can also be called in
single-user mode. The primary use for this mode is during
- bootstrapping by <xref linkend="app-initdb">. Sometimes it is used
+ bootstrapping by <xref linkend="app-initdb"/>. Sometimes it is used
for debugging or disaster recovery; note that running a single-user
server is not truly suitable for debugging the server, since no
realistic interprocess communication and locking will happen.
<para>
<command>postgres</command> accepts the following command-line
arguments. For a detailed discussion of the options consult <xref
- linkend="runtime-config">. You can save typing most of these
+ linkend="runtime-config"/>. You can save typing most of these
options by setting up a configuration file. Some (safe) options
can also be set from the connecting client in an
application-dependent way to apply only for that session. For
processes. The default value of this parameter is chosen
automatically by <application>initdb</application>.
Specifying this option is equivalent to setting the
- <xref linkend="guc-shared-buffers"> configuration parameter.
+ <xref linkend="guc-shared-buffers"/> configuration parameter.
</para>
</listitem>
</varlistentry>
<para>
Sets a named run-time parameter. The configuration parameters
supported by <productname>PostgreSQL</productname> are
- described in <xref linkend="runtime-config">. Most of the
+ described in <xref linkend="runtime-config"/>. Most of the
other command line options are in fact short forms of such a
parameter assignment. <option>-c</option> can appear multiple times
to set multiple parameters.
<para>
This option is meant for other programs that interact with a server
- instance, such as <xref linkend="app-pg-ctl">, to query configuration
+ instance, such as <xref linkend="app-pg-ctl"/>, to query configuration
parameter values. User-facing applications should instead use <xref
- linkend="sql-show"> or the <structname>pg_settings</structname> view.
+ linkend="sql-show"/> or the <structname>pg_settings</structname> view.
</para>
</listitem>
</varlistentry>
<para>
Specifies the file system location of the database
configuration files. See
- <xref linkend="runtime-config-file-locations"> for details.
+ <xref linkend="runtime-config-file-locations"/> for details.
</para>
</listitem>
</varlistentry>
Sets the default date style to <quote>European</quote>, that is
<literal>DMY</literal> ordering of input date fields. This also causes
the day to be printed before the month in certain date output formats.
- See <xref linkend="datatype-datetime"> for more information.
+ See <xref linkend="datatype-datetime"/> for more information.
</para>
</listitem>
</varlistentry>
Disables <function>fsync</function> calls for improved
performance, at the risk of data corruption in the event of a
system crash. Specifying this option is equivalent to
- disabling the <xref linkend="guc-fsync"> configuration
+ disabling the <xref linkend="guc-fsync"/> configuration
parameter. Read the detailed documentation before using this!
</para>
</listitem>
server. Defaults to listening only on
<systemitem class="systemname">localhost</systemitem>.
Specifying this option is equivalent to setting the <xref
- linkend="guc-listen-addresses"> configuration parameter.
+ linkend="guc-listen-addresses"/> configuration parameter.
</para>
</listitem>
</varlistentry>
</para>
<para>
This option is deprecated since it does not allow access to the
- full functionality of <xref linkend="guc-listen-addresses">.
+ full functionality of <xref linkend="guc-listen-addresses"/>.
It's usually better to set <varname>listen_addresses</varname> directly.
</para>
</listitem>
The default value is normally
<filename>/tmp</filename>, but that can be changed at build time.
Specifying this option is equivalent to setting the <xref
- linkend="guc-unix-socket-directories"> configuration parameter.
+ linkend="guc-unix-socket-directories"/> configuration parameter.
</para>
</listitem>
</varlistentry>
<productname>PostgreSQL</productname> must have been compiled with
support for <acronym>SSL</acronym> for this option to be
available. For more information on using <acronym>SSL</acronym>,
- refer to <xref linkend="ssl-tcp">.
+ refer to <xref linkend="ssl-tcp"/>.
</para>
</listitem>
</varlistentry>
server will accept. The default value of this parameter is chosen
automatically by <application>initdb</application>.
Specifying this option is equivalent to setting the
- <xref linkend="guc-max-connections"> configuration parameter.
+ <xref linkend="guc-max-connections"/> configuration parameter.
</para>
</listitem>
</varlistentry>
Specifies the amount of memory to be used by internal sorts and hashes
before resorting to temporary disk files. See the description of the
<varname>work_mem</varname> configuration parameter in <xref
- linkend="runtime-config-resource-memory">.
+ linkend="runtime-config-resource-memory"/>.
</para>
</listitem>
</varlistentry>
<para>
The following options only apply to the single-user mode
(see <xref linkend="app-postgres-single-user"
- endterm="app-postgres-single-user-title">).
+ endterm="app-postgres-single-user-title"/>).
</para>
<variablelist>
<listitem>
<para>
- Default value of the <xref linkend="guc-datestyle"> run-time
+ Default value of the <xref linkend="guc-datestyle"/> run-time
parameter. (The use of this environment variable is deprecated.)
</para>
</listitem>
A failure message mentioning <literal>semget</literal> or
<literal>shmget</literal> probably indicates you need to configure your
kernel to provide adequate shared memory and semaphores. For more
- discussion see <xref linkend="kernel-resources">. You might be able
+ discussion see <xref linkend="kernel-resources"/>. You might be able
to postpone reconfiguring your kernel by decreasing <xref
- linkend="guc-shared-buffers"> to reduce the shared memory
+ linkend="guc-shared-buffers"/> to reduce the shared memory
consumption of <productname>PostgreSQL</productname>, and/or by reducing
- <xref linkend="guc-max-connections"> to reduce the semaphore
+ <xref linkend="guc-max-connections"/> to reduce the semaphore
consumption.
</para>
<title>Notes</title>
<para>
- The utility command <xref linkend="app-pg-ctl"> can be used to
+ The utility command <xref linkend="app-pg-ctl"/> can be used to
start and shut down the <command>postgres</command> server
safely and comfortably.
</para>
to the process running that command. To terminate a backend process
cleanly, send <literal>SIGTERM</literal> to that process. See
also <function>pg_cancel_backend</function> and <function>pg_terminate_backend</function>
- in <xref linkend="functions-admin-signal"> for the SQL-callable equivalents
+ in <xref linkend="functions-admin-signal"/> for the SQL-callable equivalents
of these two actions.
</para>
<title>See Also</title>
<para>
- <xref linkend="app-initdb">,
- <xref linkend="app-pg-ctl">
+ <xref linkend="app-initdb"/>,
+ <xref linkend="app-pg-ctl"/>
</para>
</refsect1>
</refentry>
<title>See Also</title>
<para>
- <xref linkend="app-postgres">
+ <xref linkend="app-postgres"/>
</para>
</refsect1>
</refentry>
in which the parameter is used (if possible). When executing the
statement, specify the actual values for these parameters in the
<command>EXECUTE</command> statement. Refer to <xref
- linkend="sql-execute"> for more
+ linkend="sql-execute"/> for more
information about that.
</para>
also means that a single prepared statement cannot be used by
multiple simultaneous database clients; however, each client can create
their own prepared statement to use. Prepared statements can be
- manually cleaned up using the <xref linkend="sql-deallocate"> command.
+ manually cleaned up using the <xref linkend="sql-deallocate"/> command.
</para>
<para>
<para>
To examine the query plan <productname>PostgreSQL</productname> is using
- for a prepared statement, use <xref linkend="sql-explain">, e.g.
+ for a prepared statement, use <xref linkend="sql-explain"/>, e.g.
<command>EXPLAIN EXECUTE</command>.
If a generic plan is in use, it will contain parameter symbols
<literal>$<replaceable>n</replaceable></literal>, while a custom plan will have the
<para>
For more information on query planning and the statistics collected
by <productname>PostgreSQL</productname> for that purpose, see
- the <xref linkend="sql-analyze">
+ the <xref linkend="sql-analyze"/>
documentation.
</para>
force re-analysis and re-planning of the statement before using it
whenever database objects used in the statement have undergone
definitional (DDL) changes since the previous use of the prepared
- statement. Also, if the value of <xref linkend="guc-search-path"> changes
+ statement. Also, if the value of <xref linkend="guc-search-path"/> changes
from one use to the next, the statement will be re-parsed using the new
<varname>search_path</varname>. (This latter behavior is new as of
<productname>PostgreSQL</productname> 9.3.) These rules make use of a
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-deallocate"></member>
- <member><xref linkend="sql-execute"></member>
+ <member><xref linkend="sql-deallocate"/></member>
+ <member><xref linkend="sql-execute"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
Once prepared, a transaction can later be committed or rolled back
- with <xref linkend="sql-commit-prepared">
- or <xref linkend="sql-rollback-prepared">,
+ with <xref linkend="sql-commit-prepared"/>
+ or <xref linkend="sql-rollback-prepared"/>,
respectively. Those commands can be issued from any session, not
only the one that executed the original transaction.
</para>
<para>
This command must be used inside a transaction block. Use <xref
- linkend="sql-begin"> to start one.
+ linkend="sql-begin"/> to start one.
</para>
<para>
This will interfere with the ability of <command>VACUUM</command> to reclaim
storage, and in extreme cases could cause the database to shut down
to prevent transaction ID wraparound (see <xref
- linkend="vacuum-for-wraparound">). Keep in mind also that the transaction
+ linkend="vacuum-for-wraparound"/>). Keep in mind also that the transaction
continues to hold whatever locks it held. The intended usage of the
feature is that a prepared transaction will normally be committed or
rolled back as soon as an external transaction manager has verified that
If you have not set up an external transaction manager to track prepared
transactions and ensure they get closed out promptly, it is best to keep
the prepared-transaction feature disabled by setting
- <xref linkend="guc-max-prepared-transactions"> to zero. This will
+ <xref linkend="guc-max-prepared-transactions"/> to zero. This will
prevent accidental creation of prepared transactions that might then
be forgotten and eventually cause problems.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-commit-prepared"></member>
- <member><xref linkend="sql-rollback-prepared"></member>
+ <member><xref linkend="sql-commit-prepared"/></member>
+ <member><xref linkend="sql-rollback-prepared"/></member>
</simplelist>
</refsect1>
if the string contains multiple <acronym>SQL</acronym> commands,
unless there are explicit <command>BEGIN</command>/<command>COMMIT</command>
commands included in the string to divide it into multiple
- transactions. (See <xref linkend="protocol-flow-multi-statement">
+ transactions. (See <xref linkend="protocol-flow-multi-statement"/>
for more details about how the server handles multi-query strings.)
Also, <application>psql</application> only prints the
result of the last <acronym>SQL</acronym> command in the string.
(<literal>postgresql://</literal>
or <literal>postgres://</literal>), it is treated as a
<parameter>conninfo</parameter> string. See <xref
- linkend="libpq-connstring"> for more information.
+ linkend="libpq-connstring"/> for more information.
</para>
</listitem>
</varlistentry>
<envar>PGDATABASE</envar>, <envar>PGHOST</envar>,
<envar>PGPORT</envar> and/or <envar>PGUSER</envar> to appropriate
values. (For additional environment variables, see <xref
- linkend="libpq-envars">.) It is also convenient to have a
+ linkend="libpq-envars"/>.) It is also convenient to have a
<filename>~/.pgpass</filename> file to avoid regularly having to type in
- passwords. See <xref linkend="libpq-pgpass"> for more information.
+ passwords. See <xref linkend="libpq-pgpass"/> for more information.
</para>
<para>
$ <userinput>psql postgresql://dbmaster:5433/mydb?sslmode=require</userinput>
</programlisting>
This way you can also use <acronym>LDAP</acronym> for connection
- parameter lookup as described in <xref linkend="libpq-ldap">.
- See <xref linkend="libpq-paramkeywords"> for more information on all the
+ parameter lookup as described in <xref linkend="libpq-ldap"/>.
+ See <xref linkend="libpq-paramkeywords"/> for more information on all the
available connection options.
</para>
<para>
Whenever a command is executed, <application>psql</application> also polls
for asynchronous notification events generated by
- <xref linkend="sql-listen"> and
- <xref linkend="sql-notify">.
+ <xref linkend="sql-listen"/> and
+ <xref linkend="sql-notify"/>.
</para>
<para>
If an unquoted colon (<literal>:</literal>) followed by a
<application>psql</application> variable name appears within an argument, it is
replaced by the variable's value, as described in <xref
- linkend="app-psql-interpolation" endterm="app-psql-interpolation-title">.
+ linkend="app-psql-interpolation" endterm="app-psql-interpolation-title"/>.
The forms <literal>:'<replaceable>variable_name</replaceable>'</literal> and
<literal>:"<replaceable>variable_name</replaceable>"</literal> described there
work as well.
Establishes a new connection to a <productname>PostgreSQL</productname>
server. The connection parameters to use can be specified either
using a positional syntax, or using <replaceable>conninfo</replaceable> connection
- strings as detailed in <xref linkend="libpq-connstring">.
+ strings as detailed in <xref linkend="libpq-connstring"/>.
</para>
<para>
<listitem>
<para>
Performs a frontend (client) copy. This is an operation that
- runs an <acronym>SQL</acronym> <xref linkend="sql-copy">
+ runs an <acronym>SQL</acronym> <xref linkend="sql-copy"/>
command, but instead of the server
reading or writing the specified file,
<application>psql</application> reads or writes the file and
<para>
The syntax of this command is similar to that of the
- <acronym>SQL</acronym> <xref linkend="sql-copy">
+ <acronym>SQL</acronym> <xref linkend="sql-copy"/>
command. All options other than the data source/destination are
- as specified for <xref linkend="sql-copy">.
+ as specified for <xref linkend="sql-copy"/>.
Because of this, special parsing rules apply to the <command>\copy</command>
meta-command. Unlike most other meta-commands, the entire remainder
of the line is always taken to be the arguments of <command>\copy</command>,
also shown. For foreign tables, the associated foreign
server is shown as well.
(<quote>Matching the pattern</quote> is defined in
- <xref linkend="app-psql-patterns" endterm="app-psql-patterns-title">
+ <xref linkend="app-psql-patterns" endterm="app-psql-patterns-title"/>
below.)
</para>
<para>
Descriptions for objects can be created with the <xref
- linkend="sql-comment">
+ linkend="sql-comment"/>
<acronym>SQL</acronym> command.
</para>
</listitem>
</para>
<para>
- The <xref linkend="sql-alterdefaultprivileges"> command is used to set
+ The <xref linkend="sql-alterdefaultprivileges"/> command is used to set
default access privileges. The meaning of the
privilege display is explained under
- <xref linkend="sql-grant">.
+ <xref linkend="sql-grant"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
- The <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke">
+ The <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/>
commands are used to set access privileges. The meaning of the
privilege display is explained under
- <xref linkend="sql-grant">.
+ <xref linkend="sql-grant"/>.
</para>
</listitem>
</varlistentry>
</para>
<para>
- The <xref linkend="sql-alterrole"> and
- <xref linkend="sql-alterdatabase">
+ The <xref linkend="sql-alterrole"/> and
+ <xref linkend="sql-alterdatabase"/>
commands are used to define per-role and per-database configuration
settings.
</para>
<tip>
<para>
See under <xref linkend="app-psql-environment"
- endterm="app-psql-environment-title"> for how to configure and
+ endterm="app-psql-environment-title"/> for how to configure and
customize your editor.
</para>
</tip>
<tip>
<para>
See under <xref linkend="app-psql-environment"
- endterm="app-psql-environment-title"> for how to configure and
+ endterm="app-psql-environment-title"/> for how to configure and
customize your editor.
</para>
</tip>
<para>
Sends the current query buffer to the server and stores the
query's output into <application>psql</application> variables (see <xref
- linkend="app-psql-variables" endterm="app-psql-variables-title">).
+ linkend="app-psql-variables" endterm="app-psql-variables-title"/>).
The query to be executed must return exactly one row. Each column of
the row is stored into a separate variable, named the same as the
column. For example:
<para>
Illustrations of how these different formats look can be seen in
the <xref linkend="app-psql-examples"
- endterm="app-psql-examples-title"> section.
+ endterm="app-psql-examples-title"/> section.
</para>
<tip>
Valid variable names can contain letters, digits, and
underscores. See the section <xref
linkend="app-psql-variables"
- endterm="app-psql-variables-title"> below for details.
+ endterm="app-psql-variables-title"/> below for details.
Variable names are case-sensitive.
</para>
control <application>psql</application>'s behavior or are
automatically set to reflect connection state. These variables are
documented in <xref linkend="app-psql-variables"
- endterm="app-psql-variables-title">, below.
+ endterm="app-psql-variables-title"/>, below.
</para>
<note>
<para>
This command is unrelated to the <acronym>SQL</acronym>
- command <xref linkend="sql-set">.
+ command <xref linkend="sql-set"/>.
</para>
</note>
</listitem>
cannot be unset; instead, an <literal>\unset</literal> command is interpreted
as setting them to their default values.
See <xref linkend="app-psql-variables"
- endterm="app-psql-variables-title">, below.
+ endterm="app-psql-variables-title"/>, below.
</para>
</listitem>
</varlistentry>
The server executes such a request as a single transaction,
unless there are explicit <command>BEGIN</command>/<command>COMMIT</command>
commands included in the string to divide it into multiple
- transactions. (See <xref linkend="protocol-flow-multi-statement">
+ transactions. (See <xref linkend="protocol-flow-multi-statement"/>
for more details about how the server handles multi-query strings.)
<application>psql</application> prints only the last query result
it receives for each request; in this example, although all
Advanced users can use regular-expression notations such as character
classes, for example <literal>[0-9]</literal> to match any digit. All regular
expression special characters work as specified in
- <xref linkend="functions-posix-regexp">, except for <literal>.</literal> which
+ <xref linkend="functions-posix-regexp"/>, except for <literal>.</literal> which
is taken as a separator as mentioned above, <literal>*</literal> which is
translated to the regular-expression notation <literal>.*</literal>,
<literal>?</literal> which is translated to <literal>.</literal>, and
</programlisting>
This works in both regular SQL commands and meta-commands; there is
more detail in <xref linkend="app-psql-interpolation"
- endterm="app-psql-interpolation-title">, below.
+ endterm="app-psql-interpolation-title"/>, below.
</para>
<para>
These specify what the prompts <application>psql</application>
issues should look like. See <xref
linkend="app-psql-prompting"
- endterm="app-psql-prompting-title"> below.
+ endterm="app-psql-prompting-title"/> below.
</para>
</listitem>
</varlistentry>
<term><varname>SQLSTATE</varname></term>
<listitem>
<para>
- The error code (see <xref linkend="errcodes-appendix">) associated
+ The error code (see <xref linkend="errcodes-appendix"/>) associated
with the last SQL query's failure, or <literal>00000</literal> if it
succeeded.
</para>
The value of the <application>psql</application> variable
<replaceable class="parameter">name</replaceable>. See the
section <xref linkend="app-psql-variables"
- endterm="app-psql-variables-title"> for details.
+ endterm="app-psql-variables-title"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
- Default connection parameters (see <xref linkend="libpq-envars">).
+ Default connection parameters (see <xref linkend="libpq-envars"/>).
</para>
</listitem>
</varlistentry>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
</para>
<para>
- The <xref linkend="sql-drop-owned"> command is an alternative that
+ The <xref linkend="sql-drop-owned"/> command is an alternative that
simply drops all the database objects owned by one or more roles.
</para>
</para>
<para>
- See <xref linkend="role-removal"> for more discussion.
+ See <xref linkend="role-removal"/> for more discussion.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-drop-owned"></member>
- <member><xref linkend="sql-droprole"></member>
- <member><xref linkend="sql-alterdatabase"></member>
+ <member><xref linkend="sql-drop-owned"/></member>
+ <member><xref linkend="sql-droprole"/></member>
+ <member><xref linkend="sql-alterdatabase"/></member>
</simplelist>
</refsect1>
<para>
While the default index for future
- <xref linkend="sql-cluster">
+ <xref linkend="sql-cluster"/>
operations is retained, <command>REFRESH MATERIALIZED VIEW</command> does not
order the generated rows based on this property. If you want the data
to be ordered upon generation, you must use an <literal>ORDER BY</literal>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-creatematerializedview"></member>
- <member><xref linkend="sql-altermaterializedview"></member>
- <member><xref linkend="sql-dropmaterializedview"></member>
+ <member><xref linkend="sql-creatematerializedview"/></member>
+ <member><xref linkend="sql-altermaterializedview"/></member>
+ <member><xref linkend="sql-dropmaterializedview"/></member>
</simplelist>
</refsect1>
patterns. <command>REINDEX</command> provides a way to reduce
the space consumption of the index by writing a new version of
the index without the dead pages. See <xref
- linkend="routine-reindex"> for more information.
+ linkend="routine-reindex"/> for more information.
</para>
</listitem>
doubt, use <command>REINDEX SYSTEM</command> to select
reconstruction of all system indexes in the database. Then quit
the single-user server session and restart the regular server.
- See the <xref linkend="app-postgres"> reference page for more
+ See the <xref linkend="app-postgres"/> reference page for more
information about how to interact with the single-user server
interface.
</para>
<para>
<application>reindexdb</application> is a wrapper around the SQL
- command <xref linkend="sql-reindex">.
+ command <xref linkend="sql-reindex"/>.
There is no effective difference between reindexing databases via
this utility and via other methods for accessing the server.
</para>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-reindex">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-reindex"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
times to the <productname>PostgreSQL</productname> server, asking
for a password each time. It is convenient to have a
<filename>~/.pgpass</filename> file in such cases. See <xref
- linkend="libpq-pgpass"> for more information.
+ linkend="libpq-pgpass"/> for more information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-reindex"></member>
+ <member><xref linkend="sql-reindex"/></member>
</simplelist>
</refsect1>
Destroying a savepoint makes it unavailable as a rollback point,
but it has no other user visible behavior. It does not undo the
effects of commands executed after the savepoint was established.
- (To do that, see <xref linkend="sql-rollback-to">.)
+ (To do that, see <xref linkend="sql-rollback-to"/>.)
Destroying a savepoint when
it is no longer needed allows the system to reclaim some resources
earlier than transaction end.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-rollback"></member>
- <member><xref linkend="sql-rollback-to"></member>
- <member><xref linkend="sql-savepoint"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-rollback"/></member>
+ <member><xref linkend="sql-rollback-to"/></member>
+ <member><xref linkend="sql-savepoint"/></member>
</simplelist>
</refsect1>
</refentry>
<synopsis>
SET <replaceable class="parameter">configuration_parameter</replaceable> TO DEFAULT
</synopsis>
- Refer to <xref linkend="sql-set"> for
+ Refer to <xref linkend="sql-set"/> for
details.
</para>
from defining it as <quote>the value that the parameter had at session
start</quote>, because if the value came from the configuration file, it
will be reset to whatever is specified by the configuration file now.
- See <xref linkend="runtime-config"> for details.
+ See <xref linkend="runtime-config"/> for details.
</para>
<para>
<listitem>
<para>
Name of a settable run-time parameter. Available parameters are
- documented in <xref linkend="runtime-config"> and on the
- <xref linkend="sql-set"> reference page.
+ documented in <xref linkend="runtime-config"/> and on the
+ <xref linkend="sql-set"/> reference page.
</para>
</listitem>
</varlistentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-set"></member>
- <member><xref linkend="sql-show"></member>
+ <member><xref linkend="sql-set"/></member>
+ <member><xref linkend="sql-show"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- See the description of the <xref linkend="sql-grant"> command for
+ See the description of the <xref linkend="sql-grant"/> command for
the meaning of the privilege types.
</para>
<title>Notes</title>
<para>
- Use <xref linkend="app-psql">'s <command>\dp</command> command to
+ Use <xref linkend="app-psql"/>'s <command>\dp</command> command to
display the privileges granted on existing tables and columns. See <xref
- linkend="sql-grant"> for information about the
+ linkend="sql-grant"/> for information about the
format. For non-table objects there are other <command>\d</command> commands
that can display their privileges.
</para>
<title>Compatibility</title>
<para>
- The compatibility notes of the <xref linkend="sql-grant"> command
+ The compatibility notes of the <xref linkend="sql-grant"/> command
apply analogously to <command>REVOKE</command>.
The keyword <literal>RESTRICT</literal> or <literal>CASCADE</literal>
is required according to the standard, but <productname>PostgreSQL</productname>
<title>See Also</title>
<simpara>
- <xref linkend="sql-grant">
+ <xref linkend="sql-grant"/>
</simpara>
</refsect1>
<title>Notes</title>
<para>
- Use <xref linkend="sql-commit"> to
+ Use <xref linkend="sql-commit"/> to
successfully terminate a transaction.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-rollback-to"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-rollback-to"/></member>
</simplelist>
</refsect1>
</refentry>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-prepare-transaction"></member>
- <member><xref linkend="sql-commit-prepared"></member>
+ <member><xref linkend="sql-prepare-transaction"/></member>
+ <member><xref linkend="sql-commit-prepared"/></member>
</simplelist>
</refsect1>
<title>Notes</title>
<para>
- Use <xref linkend="sql-release-savepoint"> to destroy a savepoint
+ Use <xref linkend="sql-release-savepoint"/> to destroy a savepoint
without discarding the effects of commands executed after it was
established.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-release-savepoint"></member>
- <member><xref linkend="sql-rollback"></member>
- <member><xref linkend="sql-savepoint"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-release-savepoint"/></member>
+ <member><xref linkend="sql-rollback"/></member>
+ <member><xref linkend="sql-savepoint"/></member>
</simplelist>
</refsect1>
</refentry>
<title>Notes</title>
<para>
- Use <xref linkend="sql-rollback-to"> to
- rollback to a savepoint. Use <xref linkend="sql-release-savepoint">
+ Use <xref linkend="sql-rollback-to"/> to
+ rollback to a savepoint. Use <xref linkend="sql-release-savepoint"/>
to destroy a savepoint, keeping
the effects of commands executed after it was established.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-release-savepoint"></member>
- <member><xref linkend="sql-rollback"></member>
- <member><xref linkend="sql-rollback-to"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-release-savepoint"/></member>
+ <member><xref linkend="sql-rollback"/></member>
+ <member><xref linkend="sql-rollback-to"/></member>
</simplelist>
</refsect1>
</refentry>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sepgsql"></member>
+ <member><xref linkend="sepgsql"/></member>
<member><filename>src/test/modules/dummy_seclabel</filename></member>
</simplelist>
</refsect1>
in the <literal>FROM</literal> list. A <literal>WITH</literal> query
that is referenced more than once in <literal>FROM</literal> is
computed only once.
- (See <xref linkend="sql-with" endterm="sql-with-title"> below.)
+ (See <xref linkend="sql-with" endterm="sql-with-title"/> below.)
</para>
</listitem>
(Each element in the <literal>FROM</literal> list is a real or
virtual table.) If more than one element is specified in the
<literal>FROM</literal> list, they are cross-joined together.
- (See <xref linkend="sql-from" endterm="sql-from-title"> below.)
+ (See <xref linkend="sql-from" endterm="sql-from-title"/> below.)
</para>
</listitem>
If the <literal>WHERE</literal> clause is specified, all rows
that do not satisfy the condition are eliminated from the
output. (See <xref linkend="sql-where"
- endterm="sql-where-title"> below.)
+ endterm="sql-where-title"/> below.)
</para>
</listitem>
values, and the results of aggregate functions are computed.
If the <literal>HAVING</literal> clause is present, it
eliminates groups that do not satisfy the given condition. (See
- <xref linkend="sql-groupby" endterm="sql-groupby-title"> and
- <xref linkend="sql-having" endterm="sql-having-title"> below.)
+ <xref linkend="sql-groupby" endterm="sql-groupby-title"/> and
+ <xref linkend="sql-having" endterm="sql-having-title"/> below.)
</para>
</listitem>
The actual output rows are computed using the
<command>SELECT</command> output expressions for each selected
row or row group. (See
- <xref linkend="sql-select-list" endterm="sql-select-list-title">
+ <xref linkend="sql-select-list" endterm="sql-select-list-title"/>
below.)
</para>
</listitem>
match on all the specified expressions. <literal>SELECT ALL</literal>
(the default) will return all candidate rows, including
duplicates. (See <xref linkend="sql-distinct"
- endterm="sql-distinct-title"> below.)
+ endterm="sql-distinct-title"/> below.)
</para>
</listitem>
eliminating duplicate rows. Notice that <literal>DISTINCT</literal> is
the default behavior here, even though <literal>ALL</literal> is
the default for <command>SELECT</command> itself. (See
- <xref linkend="sql-union" endterm="sql-union-title">, <xref
- linkend="sql-intersect" endterm="sql-intersect-title">, and
- <xref linkend="sql-except" endterm="sql-except-title"> below.)
+ <xref linkend="sql-union" endterm="sql-union-title"/>, <xref
+ linkend="sql-intersect" endterm="sql-intersect-title"/>, and
+ <xref linkend="sql-except" endterm="sql-except-title"/> below.)
</para>
</listitem>
returned rows are sorted in the specified order. If
<literal>ORDER BY</literal> is not given, the rows are returned
in whatever order the system finds fastest to produce. (See
- <xref linkend="sql-orderby" endterm="sql-orderby-title"> below.)
+ <xref linkend="sql-orderby" endterm="sql-orderby-title"/> below.)
</para>
</listitem>
If the <literal>LIMIT</literal> (or <literal>FETCH FIRST</literal>) or <literal>OFFSET</literal>
clause is specified, the <command>SELECT</command> statement
only returns a subset of the result rows. (See <xref
- linkend="sql-limit" endterm="sql-limit-title"> below.)
+ linkend="sql-limit" endterm="sql-limit-title"/> below.)
</para>
</listitem>
is specified, the
<command>SELECT</command> statement locks the selected rows
against concurrent updates. (See <xref linkend="sql-for-update-share"
- endterm="sql-for-update-share-title"> below.)
+ endterm="sql-for-update-share-title"/> below.)
</para>
</listitem>
</orderedlist>
is permitted per query. Recursive data-modifying statements are not
supported, but you can use the results of a recursive
<command>SELECT</command> query in
- a data-modifying statement. See <xref linkend="queries-with"> for
+ a data-modifying statement. See <xref linkend="queries-with"/> for
an example.
</para>
</para>
<para>
- See <xref linkend="queries-with"> for additional information.
+ See <xref linkend="queries-with"/> for additional information.
</para>
</refsect2>
sub-<command>SELECT</command> must be surrounded by
parentheses, and an alias <emphasis>must</emphasis> be
provided for it. A
- <xref linkend="sql-values"> command
+ <xref linkend="sql-values"/> command
can also be used here.
</para>
</listitem>
equivalent to constructing a <literal>UNION ALL</literal> between
subqueries with the individual grouping sets as their
<literal>GROUP BY</literal> clauses. For further details on the handling
- of grouping sets see <xref linkend="queries-grouping-sets">.
+ of grouping sets see <xref linkend="queries-grouping-sets"/>.
</para>
<para>
the selected rows.)
The set of rows fed to each aggregate function can be further filtered by
attaching a <literal>FILTER</literal> clause to the aggregate function
- call; see <xref linkend="syntax-aggregates"> for more information. When
+ call; see <xref linkend="syntax-aggregates"/> for more information. When
a <literal>FILTER</literal> clause is present, only those rows matching it
are included in the input to that aggregate function.
</para>
evaluating any <quote>scalar</quote> expressions in the <literal>HAVING</literal>
clause or <literal>SELECT</literal> list. This means that, for example,
a <literal>CASE</literal> expression cannot be used to skip evaluation of
- an aggregate function; see <xref linkend="syntax-express-eval">.
+ an aggregate function; see <xref linkend="syntax-express-eval"/>.
</para>
<para>
<para>
The elements of the <literal>PARTITION BY</literal> list are interpreted in
much the same fashion as elements of a
- <xref linkend="sql-groupby" endterm="sql-groupby-title">, except that
+ <xref linkend="sql-groupby" endterm="sql-groupby-title"/>, except that
they are always simple expressions and never the name or number of an
output column.
Another difference is that these expressions can contain aggregate
<para>
Similarly, the elements of the <literal>ORDER BY</literal> list are interpreted
in much the same fashion as elements of an
- <xref linkend="sql-orderby" endterm="sql-orderby-title">, except that
+ <xref linkend="sql-orderby" endterm="sql-orderby-title"/>, except that
the expressions are always taken as simple expressions and never the name
or number of an output column.
</para>
<para>
The purpose of a <literal>WINDOW</literal> clause is to specify the
behavior of <firstterm>window functions</firstterm> appearing in the query's
- <xref linkend="sql-select-list" endterm="sql-select-list-title"> or
- <xref linkend="sql-orderby" endterm="sql-orderby-title">. These functions
+ <xref linkend="sql-select-list" endterm="sql-select-list-title"/> or
+ <xref linkend="sql-orderby" endterm="sql-orderby-title"/>. These functions
can reference the <literal>WINDOW</literal> clause entries by name
in their <literal>OVER</literal> clauses. A <literal>WINDOW</literal> clause
entry does not have to be referenced anywhere, however; if it is not
<para>
Window functions are described in detail in
- <xref linkend="tutorial-window">,
- <xref linkend="syntax-window-functions">, and
- <xref linkend="queries-window">.
+ <xref linkend="tutorial-window"/>,
+ <xref linkend="syntax-window-functions"/>, and
+ <xref linkend="queries-window"/>.
</para>
</refsect2>
after the column's expression. (You can omit <literal>AS</literal>,
but only if the desired output name does not match any
<productname>PostgreSQL</productname> keyword (see <xref
- linkend="sql-keywords-appendix">). For protection against possible
+ linkend="sql-keywords-appendix"/>). For protection against possible
future keyword additions, it is recommended that you always either
write <literal>AS</literal> or double-quote the output name.)
If you do not specify a column name, a name is chosen automatically
a <literal>COLLATE</literal> clause in the
<replaceable class="parameter">expression</replaceable>, for example
<literal>ORDER BY mycolumn COLLATE "en_US"</literal>.
- For more information see <xref linkend="sql-syntax-collate-exprs"> and
- <xref linkend="collation">.
+ For more information see <xref linkend="sql-syntax-collate-exprs"/> and
+ <xref linkend="collation"/>.
</para>
</refsect2>
<para>
For more information on each row-level lock mode, refer to
- <xref linkend="locking-rows">.
+ <xref linkend="locking-rows"/>.
</para>
<para>
Note that <literal>NOWAIT</literal> and <literal>SKIP LOCKED</literal> apply only
to the row-level lock(s) — the required <literal>ROW SHARE</literal>
table-level lock is still taken in the ordinary way (see
- <xref linkend="mvcc">). You can use
- <xref linkend="sql-lock">
+ <xref linkend="mvcc"/>). You can use
+ <xref linkend="sql-lock"/>
with the <literal>NOWAIT</literal> option first,
if you need to acquire the table-level lock without waiting.
</para>
an initial condition, followed by <literal>UNION</literal>,
followed by the recursive part of the query. Be sure that the
recursive part of the query will eventually return no tuples, or
- else the query will loop indefinitely. (See <xref linkend="queries-with">
+ else the query will loop indefinitely. (See <xref linkend="queries-with"/>
for more examples.)
</para>
used by <productname>MySQL</productname>. The SQL:2008 standard
has introduced the clauses <literal>OFFSET ... FETCH {FIRST|NEXT}
...</literal> for the same functionality, as shown above
- in <xref linkend="sql-limit" endterm="sql-limit-title">. This
+ in <xref linkend="sql-limit" endterm="sql-limit-title"/>. This
syntax is also used by <productname>IBM DB2</productname>.
(Applications written for <productname>Oracle</productname>
frequently use a workaround involving the automatically
<listitem>
<para>
If specified, the table is created as a temporary table. Refer
- to <xref linkend="sql-createtable"> for details.
+ to <xref linkend="sql-createtable"/> for details.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
If specified, the table is created as an unlogged table. Refer
- to <xref linkend="sql-createtable"> for details.
+ to <xref linkend="sql-createtable"/> for details.
</para>
</listitem>
</varlistentry>
<para>
All other parameters are described in detail under <xref
- linkend="sql-select">.
+ linkend="sql-select"/>.
</para>
</refsect1>
<title>Notes</title>
<para>
- <xref linkend="sql-createtableas"> is functionally similar to
+ <xref linkend="sql-createtableas"/> is functionally similar to
<command>SELECT INTO</command>. <command>CREATE TABLE AS</command>
is the recommended syntax, since this form of <command>SELECT
INTO</command> is not available in <application>ECPG</application>
<para>
To add OIDs to the table created by <command>SELECT INTO</command>,
- enable the <xref linkend="guc-default-with-oids"> configuration
+ enable the <xref linkend="guc-default-with-oids"/> configuration
variable. Alternatively, <command>CREATE TABLE AS</command> can be
used with the <literal>WITH OIDS</literal> clause.
</para>
The SQL standard uses <command>SELECT INTO</command> to
represent selecting values into scalar variables of a host program,
rather than creating a new table. This indeed is the usage found
- in <application>ECPG</application> (see <xref linkend="ecpg">) and
- <application>PL/pgSQL</application> (see <xref linkend="plpgsql">).
+ in <application>ECPG</application> (see <xref linkend="ecpg"/>) and
+ <application>PL/pgSQL</application> (see <xref linkend="plpgsql"/>).
The <productname>PostgreSQL</productname> usage of <command>SELECT
INTO</command> to represent table creation is historical. It is
best to use <command>CREATE TABLE AS</command> for this purpose in
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createtableas"></member>
+ <member><xref linkend="sql-createtableas"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The <command>SET</command> command changes run-time configuration
parameters. Many of the run-time parameters listed in
- <xref linkend="runtime-config"> can be changed on-the-fly with
+ <xref linkend="runtime-config"/> can be changed on-the-fly with
<command>SET</command>.
(But some require superuser privileges to change, and others cannot
be changed after server or session start.)
<para>
If <command>SET LOCAL</command> is used within a function that has a
<literal>SET</literal> option for the same variable (see
- <xref linkend="sql-createfunction">),
+ <xref linkend="sql-createfunction"/>),
the effects of the <command>SET LOCAL</command> command disappear at
function exit; that is, the value in effect when the function was called is
restored anyway. This allows <command>SET LOCAL</command> to be used for
<listitem>
<para>
Name of a settable run-time parameter. Available parameters are
- documented in <xref linkend="runtime-config"> and below.
+ documented in <xref linkend="runtime-config"/> and below.
</para>
</listitem>
</varlistentry>
<para>
Besides the configuration parameters documented in <xref
- linkend="runtime-config">, there are a few that can only be
+ linkend="runtime-config"/>, there are a few that can only be
adjusted using the <command>SET</command> command or that have a
special syntax:
</para>
<para>
- See <xref linkend="datatype-timezones"> for more information
+ See <xref linkend="datatype-timezones"/> for more information
about time zones.
</para>
</listitem>
<para>
The function <function>set_config</function> provides equivalent
- functionality; see <xref linkend="functions-admin">.
+ functionality; see <xref linkend="functions-admin"/>.
Also, it is possible to UPDATE the
<link linkend="view-pg-settings"><structname>pg_settings</structname></link>
system view to perform the equivalent of <command>SET</command>.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-reset"></member>
- <member><xref linkend="sql-show"></member>
+ <member><xref linkend="sql-reset"/></member>
+ <member><xref linkend="sql-show"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The <literal>SESSION</literal> and <literal>LOCAL</literal> modifiers act the same
- as for the regular <xref linkend="sql-set">
+ as for the regular <xref linkend="sql-set"/>
command.
</para>
<para>
<command>SET ROLE</command> has effects comparable to
- <xref linkend="sql-set-session-authorization">, but the privilege
+ <xref linkend="sql-set-session-authorization"/>, but the privilege
checks involved are quite different. Also,
<command>SET SESSION AUTHORIZATION</command> determines which roles are
allowable for later <command>SET ROLE</command> commands, whereas changing
<para>
<command>SET ROLE</command> does not process session variables as specified by
- the role's <xref linkend="sql-alterrole"> settings; this only happens during
+ the role's <xref linkend="sql-alterrole"/> settings; this only happens during
login.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-set-session-authorization"></member>
+ <member><xref linkend="sql-set-session-authorization"/></member>
</simplelist>
</refsect1>
</refentry>
identifier is normally equal to the session user identifier, but
might change temporarily in the context of <literal>SECURITY DEFINER</literal>
functions and similar mechanisms; it can also be changed by
- <xref linkend="sql-set-role">.
+ <xref linkend="sql-set-role"/>.
The current user identifier is relevant for permission checking.
</para>
<para>
The <literal>SESSION</literal> and <literal>LOCAL</literal> modifiers act the same
- as for the regular <xref linkend="sql-set">
+ as for the regular <xref linkend="sql-set"/>
command.
</para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-set-role"></member>
+ <member><xref linkend="sql-set-role"/></member>
</simplelist>
</refsect1>
</refentry>
<command>INSERT</command>, <command>DELETE</command>,
<command>UPDATE</command>, <command>FETCH</command>, or
<command>COPY</command>) of a transaction has been executed. See
- <xref linkend="mvcc"> for more information about transaction
+ <xref linkend="mvcc"/> for more information about transaction
isolation and concurrency control.
</para>
transaction to run with the same <firstterm>snapshot</firstterm> as an existing
transaction. The pre-existing transaction must have exported its snapshot
with the <literal>pg_export_snapshot</literal> function (see <xref
- linkend="functions-snapshot-synchronization">). That function returns a
+ linkend="functions-snapshot-synchronization"/>). That function returns a
snapshot identifier, which must be given to <literal>SET TRANSACTION
SNAPSHOT</literal> to specify which snapshot is to be imported. The
identifier must be written as a string literal in this command, for example
<para>
The session default transaction modes can also be set by setting the
- configuration parameters <xref linkend="guc-default-transaction-isolation">,
- <xref linkend="guc-default-transaction-read-only">, and
- <xref linkend="guc-default-transaction-deferrable">.
+ configuration parameters <xref linkend="guc-default-transaction-isolation"/>,
+ <xref linkend="guc-default-transaction-read-only"/>, and
+ <xref linkend="guc-default-transaction-deferrable"/>.
(In fact <command>SET SESSION CHARACTERISTICS</command> is just a
verbose equivalent for setting these variables with <command>SET</command>.)
This means the defaults can be set in the configuration file, via
- <command>ALTER DATABASE</command>, etc. Consult <xref linkend="runtime-config">
+ <command>ALTER DATABASE</command>, etc. Consult <xref linkend="runtime-config"/>
for more information.
</para>
</refsect1>
<application>libpq</application> or a <application>libpq</application>-based
application), or through command-line flags when starting the
<command>postgres</command> server. See <xref
- linkend="runtime-config"> for details.
+ linkend="runtime-config"/> for details.
</para>
</refsect1>
<listitem>
<para>
The name of a run-time parameter. Available parameters are
- documented in <xref linkend="runtime-config"> and on the <xref
- linkend="sql-set"> reference page. In
+ documented in <xref linkend="runtime-config"/> and on the <xref
+ linkend="sql-set"/> reference page. In
addition, there are a few parameters that can be shown but not
set:
<para>
The function <function>current_setting</function> produces
- equivalent output; see <xref linkend="functions-admin">.
+ equivalent output; see <xref linkend="functions-admin"/>.
Also, the
<link linkend="view-pg-settings"><structname>pg_settings</structname></link>
system view produces the same information.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-set"></member>
- <member><xref linkend="sql-reset"></member>
+ <member><xref linkend="sql-set"/></member>
+ <member><xref linkend="sql-reset"/></member>
</simplelist>
</refsect1>
<para>
This command begins a new transaction block. If the isolation level,
read/write mode, or deferrable mode is specified, the new transaction has those
- characteristics, as if <xref linkend="sql-set-transaction"> was executed. This is the same
- as the <xref linkend="sql-begin"> command.
+ characteristics, as if <xref linkend="sql-set-transaction"/> was executed. This is the same
+ as the <xref linkend="sql-begin"/> command.
</para>
</refsect1>
<title>Parameters</title>
<para>
- Refer to <xref linkend="sql-set-transaction"> for information on the meaning
+ Refer to <xref linkend="sql-set-transaction"/> for information on the meaning
of the parameters to this statement.
</para>
</refsect1>
</para>
<para>
- See also the compatibility section of <xref linkend="sql-set-transaction">.
+ See also the compatibility section of <xref linkend="sql-set-transaction"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-begin"></member>
- <member><xref linkend="sql-commit"></member>
- <member><xref linkend="sql-rollback"></member>
- <member><xref linkend="sql-savepoint"></member>
- <member><xref linkend="sql-set-transaction"></member>
+ <member><xref linkend="sql-begin"/></member>
+ <member><xref linkend="sql-commit"/></member>
+ <member><xref linkend="sql-rollback"/></member>
+ <member><xref linkend="sql-savepoint"/></member>
+ <member><xref linkend="sql-set-transaction"/></member>
</simplelist>
</refsect1>
</refentry>
<command>TRUNCATE</command> is not MVCC-safe. After truncation, the table will
appear empty to concurrent transactions, if they are using a snapshot
taken before the truncation occurred.
- See <xref linkend="mvcc-caveats"> for more details.
+ See <xref linkend="mvcc-caveats"/> for more details.
</para>
<para>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-delete"></member>
+ <member><xref linkend="sql-delete"/></member>
</simplelist>
</refsect1>
</refentry>
</para>
<para>
- <xref linkend="sql-notify">
+ <xref linkend="sql-notify"/>
contains a more extensive
discussion of the use of <command>LISTEN</command> and
<command>NOTIFY</command>.
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-listen"></member>
- <member><xref linkend="sql-notify"></member>
+ <member><xref linkend="sql-listen"/></member>
+ <member><xref linkend="sql-notify"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
The <literal>WITH</literal> clause allows you to specify one or more
subqueries that can be referenced by name in the <command>UPDATE</command>
- query. See <xref linkend="queries-with"> and <xref linkend="sql-select">
+ query. See <xref linkend="queries-with"/> and <xref linkend="sql-select"/>
for details.
</para>
</listitem>
to appear in the <literal>WHERE</literal> condition and the update
expressions. This is similar to the list of tables that can be
specified in the <xref linkend="sql-from"
- endterm="sql-from-title"> of a <command>SELECT</command>
+ endterm="sql-from-title"/> of a <command>SELECT</command>
statement. Note that the target table must not appear in the
<replaceable>from_list</replaceable>, unless you intend a self-join (in which
case it must appear with an alias in the <replaceable>from_list</replaceable>).
query on the <command>UPDATE</command>'s target table.
Note that <literal>WHERE CURRENT OF</literal> cannot be
specified together with a Boolean condition. See
- <xref linkend="sql-declare">
+ <xref linkend="sql-declare"/>
for more information about using cursors with
<literal>WHERE CURRENT OF</literal>.
</para>
<command>VACUUM ANALYZE</command> performs a <command>VACUUM</command>
and then an <command>ANALYZE</command> for each selected table. This
is a handy combination form for routine maintenance scripts. See
- <xref linkend="sql-analyze">
+ <xref linkend="sql-analyze"/>
for more details about its processing.
</para>
Selects aggressive <quote>freezing</quote> of tuples.
Specifying <literal>FREEZE</literal> is equivalent to performing
<command>VACUUM</command> with the
- <xref linkend="guc-vacuum-freeze-min-age"> and
- <xref linkend="guc-vacuum-freeze-table-age"> parameters
+ <xref linkend="guc-vacuum-freeze-min-age"/> and
+ <xref linkend="guc-vacuum-freeze-table-age"/> parameters
set to zero. Aggressive freezing is always performed when the
table is rewritten, so this option is redundant when <literal>FULL</literal>
is specified.
For tables with <acronym>GIN</acronym> indexes, <command>VACUUM</command> (in
any form) also completes any pending index insertions, by moving pending
index entries to the appropriate places in the main <acronym>GIN</acronym> index
- structure. See <xref linkend="gin-fast-update"> for details.
+ structure. See <xref linkend="gin-fast-update"/> for details.
</para>
<para>
<command>VACUUM</command> causes a substantial increase in I/O traffic,
which might cause poor performance for other active sessions. Therefore,
it is sometimes advisable to use the cost-based vacuum delay feature.
- See <xref linkend="runtime-config-resource-vacuum-cost"> for details.
+ See <xref linkend="runtime-config-resource-vacuum-cost"/> for details.
</para>
<para>
<productname>PostgreSQL</productname> includes an <quote>autovacuum</quote>
facility which can automate routine vacuum maintenance. For more
information about automatic and manual vacuuming, see
- <xref linkend="routine-vacuuming">.
+ <xref linkend="routine-vacuuming"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="app-vacuumdb"></member>
- <member><xref linkend="runtime-config-resource-vacuum-cost"></member>
- <member><xref linkend="autovacuum"></member>
+ <member><xref linkend="app-vacuumdb"/></member>
+ <member><xref linkend="runtime-config-resource-vacuum-cost"/></member>
+ <member><xref linkend="autovacuum"/></member>
</simplelist>
</refsect1>
</refentry>
<para>
<application>vacuumdb</application> is a wrapper around the SQL
- command <xref linkend="sql-vacuum">.
+ command <xref linkend="sql-vacuum"/>.
There is no effective difference between vacuuming and analyzing
databases via this utility and via other methods for accessing the
server.
<para>
<application>vacuumdb</application> will open
<replaceable class="parameter">njobs</replaceable> connections to the
- database, so make sure your <xref linkend="guc-max-connections">
+ database, so make sure your <xref linkend="guc-max-connections"/>
setting is high enough to accommodate all connections.
</para>
<para>
<para>
This utility, like most other <productname>PostgreSQL</productname> utilities,
also uses the environment variables supported by <application>libpq</application>
- (see <xref linkend="libpq-envars">).
+ (see <xref linkend="libpq-envars"/>).
</para>
</refsect1>
<title>Diagnostics</title>
<para>
- In case of difficulty, see <xref linkend="sql-vacuum">
- and <xref linkend="app-psql"> for
+ In case of difficulty, see <xref linkend="sql-vacuum"/>
+ and <xref linkend="app-psql"/> for
discussions of potential problems and error messages.
The database server must be running at the
targeted host. Also, any default connection settings and environment
times to the <productname>PostgreSQL</productname> server, asking
for a password each time. It is convenient to have a
<filename>~/.pgpass</filename> file in such cases. See <xref
- linkend="libpq-pgpass"> for more information.
+ linkend="libpq-pgpass"/> for more information.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-vacuum"></member>
+ <member><xref linkend="sql-vacuum"/></member>
</simplelist>
</refsect1>
number of elements. The data types of the resulting table's columns are
determined by combining the explicit or inferred types of the expressions
appearing in that column, using the same rules as for <literal>UNION</literal>
- (see <xref linkend="typeconv-union-case">).
+ (see <xref linkend="typeconv-union-case"/>).
</para>
<para>
rows. This expression can refer to the columns of the
<command>VALUES</command> result as <literal>column1</literal>, <literal>column2</literal>,
etc. For more details see
- <xref linkend="sql-orderby" endterm="sql-orderby-title">.
+ <xref linkend="sql-orderby" endterm="sql-orderby-title"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
A sorting operator. For details see
- <xref linkend="sql-orderby" endterm="sql-orderby-title">.
+ <xref linkend="sql-orderby" endterm="sql-orderby-title"/>.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The maximum number of rows to return. For details see
- <xref linkend="sql-limit" endterm="sql-limit-title">.
+ <xref linkend="sql-limit" endterm="sql-limit-title"/>.
</para>
</listitem>
</varlistentry>
<para>
The number of rows to skip before starting to return rows.
For details see
- <xref linkend="sql-limit" endterm="sql-limit-title">.
+ <xref linkend="sql-limit" endterm="sql-limit-title"/>.
</para>
</listitem>
</varlistentry>
<para><command>VALUES</command> conforms to the SQL standard.
<literal>LIMIT</literal> and <literal>OFFSET</literal> are
<productname>PostgreSQL</productname> extensions; see also
- under <xref linkend="sql-select">.
+ under <xref linkend="sql-select"/>.
</para>
</refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-insert"></member>
- <member><xref linkend="sql-select"></member>
+ <member><xref linkend="sql-insert"/></member>
+ <member><xref linkend="sql-select"/></member>
</simplelist>
</refsect1>
</refentry>
<productname>PostgreSQL</productname> server applications and
support utilities. These commands can only be run usefully on the
host where the database server resides. Other utility programs
- are listed in <xref linkend="reference-client">.
+ are listed in <xref linkend="reference-client"/>.
</para>
</partintro>
</computeroutput>
</screen>
or otherwise a note about which tests failed. See <xref
- linkend="regress-evaluation"> below before assuming that a
+ linkend="regress-evaluation"/> below before assuming that a
<quote>failure</quote> represents a serious problem.
</para>
<title>Running the Tests Against an Existing Installation</title>
<para>
- To run the tests after installation (see <xref linkend="installation">),
+ To run the tests after installation (see <xref linkend="installation"/>),
initialize a data area and start the
- server as explained in <xref linkend="runtime">, then type:
+ server as explained in <xref linkend="runtime"/>, then type:
<screen>
make installcheck
</screen>
<listitem>
<para>
Tests of client programs under <filename>src/bin</filename>. See
- also <xref linkend="regress-tap">.
+ also <xref linkend="regress-tap"/>.
</para>
</listitem>
</itemizedlist>
for a given test, but inspection of the output convinces you that
the result is valid, you can add a new comparison file to silence
the failure report in future test runs. See
- <xref linkend="regress-variant"> for details.
+ <xref linkend="regress-variant"/> for details.
</para>
<sect2>
If the <literal>errors</literal> test results in a server crash
at the <literal>select infinite_recurse()</literal> command, it means that
the platform's limit on process stack size is smaller than the
- <xref linkend="guc-max-stack-depth"> parameter indicates. This
+ <xref linkend="guc-max-stack-depth"/> parameter indicates. This
can be fixed by running the server under a higher stack
size limit (4MB is recommended with the default value of
<varname>max_stack_depth</varname>). If you are unable to do that, an
<para>
This release contains a variety of fixes from 10.0.
For information about new features in major release 10, see
- <xref linkend="release-10">.
+ <xref linkend="release-10"/>.
</para>
<sect2>
<title>Migration to Version 10</title>
<para>
- A dump/restore using <xref linkend="app-pg-dumpall">, or use of <xref
- linkend="pgupgrade">, is required for those wishing to migrate data
+ A dump/restore using <xref linkend="app-pg-dumpall"/>, or use of <xref
+ linkend="pgupgrade"/>, is required for those wishing to migrate data
from any previous release.
</para>
functions' periods. In addition, set-returning functions are now
disallowed within <literal>CASE</literal> and <literal>COALESCE</literal> constructs.
For more information
- see <xref linkend="xfunc-sql-functions-returning-set">.
+ see <xref linkend="xfunc-sql-functions-returning-set"/>.
</para>
</listitem>
2017-01-04 [9a4d51077] Make wal streaming the default mode for pg_basebackup
-->
<para>
- Make <application><xref linkend="app-pgbasebackup"></application> stream the
+ Make <application><xref linkend="app-pgbasebackup"/></application> stream the
<acronym>WAL</acronym> needed to restore the backup by default (Magnus
Hagander)
</para>
2017-01-14 [05cd12ed5] pg_ctl: Change default to wait for all actions
-->
<para>
- Make all <application><xref linkend="app-pg-ctl"></application> actions wait
+ Make all <application><xref linkend="app-pg-ctl"/></application> actions wait
for completion by default (Peter Eisentraut)
</para>
2017-03-27 [3371e4d9b] Change default of log_directory to 'log'
-->
<para>
- Change the default value of the <xref linkend="guc-log-directory">
+ Change the default value of the <xref linkend="guc-log-directory"/>
server parameter from <filename>pg_log</filename> to <filename>log</filename>
(Andreas Karlsson)
</para>
2017-07-31 [c0a15e07c] Always use 2048 bit DH parameters for OpenSSL ephemeral
-->
<para>
- Add configuration option <xref linkend="guc-ssl-dh-params-file"> to
+ Add configuration option <xref linkend="guc-ssl-dh-params-file"/> to
specify file name for custom OpenSSL DH parameters (Heikki Linnakangas)
</para>
DH parameters longer than 1024 bits, and hence will not be able to
connect over SSL. If it's necessary to support such old clients, you
can use custom 1024-bit DH parameters instead of the compiled-in
- defaults. See <xref linkend="guc-ssl-dh-params-file">.
+ defaults. See <xref linkend="guc-ssl-dh-params-file"/>.
</para>
</listitem>
</para>
<para>
- The <xref linkend="guc-password-encryption"> server parameter
+ The <xref linkend="guc-password-encryption"/> server parameter
no longer supports <literal>off</literal> or <literal>plain</literal>.
The <literal>UNENCRYPTED</literal> option is no longer supported in
<command>CREATE/ALTER USER ... PASSWORD</command>. Similarly, the
2017-02-15 [51ee6f316] Replace min_parallel_relation_size with two new GUCs.
-->
<para>
- Add <xref linkend="guc-min-parallel-table-scan-size">
- and <xref linkend="guc-min-parallel-index-scan-size"> server
+ Add <xref linkend="guc-min-parallel-table-scan-size"/>
+ and <xref linkend="guc-min-parallel-index-scan-size"/> server
parameters to control parallel queries (Amit Kapila, Robert Haas)
</para>
-->
<para>
Don't downcase unquoted text
- within <xref linkend="guc-shared-preload-libraries"> and related
+ within <xref linkend="guc-shared-preload-libraries"/> and related
server parameters (QL Zhuo)
</para>
<para>
This functionality has been replaced by new server
- parameters <xref linkend="guc-pltcl-start-proc">
- and <xref linkend="guc-pltclu-start-proc">, which are easier to use
+ parameters <xref linkend="guc-pltcl-start-proc"/>
+ and <xref linkend="guc-pltclu-start-proc"/>, which are easier to use
and more similar to features available in other PLs.
</para>
</listitem>
2016-12-05 [2b959d495] Reduce the default for max_worker_processes back to 8.
-->
<para>
- Add <xref linkend="guc-max-parallel-workers"> server parameter
+ Add <xref linkend="guc-max-parallel-workers"/> server parameter
to limit the number of worker processes that can be used for
query parallelism (Julien Rouhaud)
</para>
<para>
This parameter can be set lower than <xref
- linkend="guc-max-worker-processes"> to reserve worker processes
+ linkend="guc-max-worker-processes"/> to reserve worker processes
for purposes other than parallel queries.
</para>
</listitem>
<para>
For example, changing a table's <xref
- linkend="guc-effective-io-concurrency"> setting can now be done
+ linkend="guc-effective-io-concurrency"/> setting can now be done
with a more lightweight lock.
</para>
</listitem>
<para>
Lock promotion can now be controlled through two new server
parameters, <xref
- linkend="guc-max-pred-locks-per-relation"> and
- <xref linkend="guc-max-pred-locks-per-page">.
+ linkend="guc-max-pred-locks-per-relation"/> and
+ <xref linkend="guc-max-pred-locks-per-page"/>.
</para>
</listitem>
2016-10-17 [7d3235ba4] By default, set log_line_prefix = '%m [%p] '.
-->
<para>
- Change the default value of <xref linkend="guc-log-line-prefix">
+ Change the default value of <xref linkend="guc-log-line-prefix"/>
to include current timestamp (with milliseconds) and the process ID
in each line of postmaster log output (Christoph Berg)
</para>
<para>
Reduce message verbosity of lower-numbered debug levels
controlled by
- <xref linkend="guc-log-min-messages"> (Robert Haas)
+ <xref linkend="guc-log-min-messages"/> (Robert Haas)
</para>
<para>
This also changes the verbosity of <xref
- linkend="guc-client-min-messages"> debug levels.
+ linkend="guc-client-min-messages"/> debug levels.
</para>
</listitem>
2016-09-28 [babe05bc2] Turn password_encryption GUC into an enum.
-->
<para>
- Change the <xref linkend="guc-password-encryption"> server parameter
+ Change the <xref linkend="guc-password-encryption"/> server parameter
from <type>boolean</type> to <type>enum</type> (Michael Paquier)
</para>
-->
<para>
Make the maximum value of <xref
- linkend="guc-bgwriter-lru-maxpages"> effectively unlimited
+ linkend="guc-bgwriter-lru-maxpages"/> effectively unlimited
(Jim Nasby)
</para>
</listitem>
2017-03-14 [bb4a39637] hash: Support WAL consistency checking.
-->
<para>
- Add <xref linkend="guc-wal-consistency-checking"> server parameter
+ Add <xref linkend="guc-wal-consistency-checking"/> server parameter
to add details to <acronym>WAL</acronym> that can be sanity-checked on
the standby (Kuntal Ghosh, Robert Haas)
</para>
<para>
A larger <acronym>WAL</acronym> segment size allows for fewer
- <xref linkend="guc-archive-command"> invocations and fewer
+ <xref linkend="guc-archive-command"/> invocations and fewer
<acronym>WAL</acronym> files to manage.
</para>
</listitem>
<para>
Allow waiting for commit acknowledgement from standby
servers irrespective of the order they appear in <xref
- linkend="guc-synchronous-standby-names"> (Masahiko Sawada)
+ linkend="guc-synchronous-standby-names"/> (Masahiko Sawada)
</para>
<para>
<para>
Specifically, the defaults were changed for <xref
- linkend="guc-wal-level">, <xref linkend="guc-max-wal-senders">,
- <xref linkend="guc-max-replication-slots">, and <xref
- linkend="guc-hot-standby"> to make them suitable for these usages
+ linkend="guc-wal-level"/>, <xref linkend="guc-max-wal-senders"/>,
+ <xref linkend="guc-max-replication-slots"/>, and <xref
+ linkend="guc-hot-standby"/> to make them suitable for these usages
out-of-the-box.
</para>
</listitem>
<para>
Previously <filename>pg_hba.conf</filename>'s replication connection
lines were commented out by default. This is particularly useful for
- <application><xref linkend="app-pgbasebackup"></application>.
+ <application><xref linkend="app-pgbasebackup"/></application>.
</para>
</listitem>
<para>
This information is also included in <xref
- linkend="guc-log-autovacuum-min-duration"> output.
+ linkend="guc-log-autovacuum-min-duration"/> output.
</para>
</listitem>
2017-03-07 [0d2b1f305] Invent start_proc parameters for PL/Tcl.
-->
<para>
- Add server parameters <xref linkend="guc-pltcl-start-proc">
- and <xref linkend="guc-pltclu-start-proc">, to allow initialization
+ Add server parameters <xref linkend="guc-pltcl-start-proc"/>
+ and <xref linkend="guc-pltclu-start-proc"/>, to allow initialization
functions to be called on PL/Tcl startup (Tom Lane)
</para>
</listitem>
<title>Client Applications</title>
<sect4>
- <title><xref linkend="app-psql"></title>
+ <title><xref linkend="app-psql"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="pgbench"></title>
+ <title><xref linkend="pgbench"/></title>
<itemizedlist>
<sect4>
- <title><xref linkend="app-pgbasebackup"></title>
+ <title><xref linkend="app-pgbasebackup"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><application><xref linkend="app-pg-ctl"></application></title>
+ <title><application><xref linkend="app-pg-ctl"/></application></title>
<itemizedlist>
2016-09-21 [e7010ce47] pg_ctl: Add wait option to promote action
-->
<para>
- Add wait option for <application><xref linkend="app-pg-ctl"></application>'s
+ Add wait option for <application><xref linkend="app-pg-ctl"/></application>'s
promote operation (Peter Eisentraut)
</para>
</listitem>
<para>
This release contains a variety of fixes from 7.4.29.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.26,
- see <xref linkend="release-7-4-26">.
+ see <xref linkend="release-7-4-26"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.28.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.26,
- see <xref linkend="release-7-4-26">.
+ see <xref linkend="release-7-4-26"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.27.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.26,
- see <xref linkend="release-7-4-26">.
+ see <xref linkend="release-7-4-26"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.26.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.26,
- see <xref linkend="release-7-4-26">.
+ see <xref linkend="release-7-4-26"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.25.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
However, if you have any hash indexes on <type>interval</type> columns,
you must <command>REINDEX</command> them after updating to 7.4.26.
Also, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.24.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.23.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.22.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.21.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains one serious bug fix over 7.4.20.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.19.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X.
However, if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
This release contains a variety of fixes from 7.4.18,
including fixes for significant security issues.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains fixes from 7.4.17.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
This release contains fixes from 7.4.16,
including a security fix.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
This release contains a variety of fixes from 7.4.15, including
a security fix.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.14.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.13.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
This release contains a variety of fixes from 7.4.12,
including patches for extremely serious security issues.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
<para>
<para>
This release contains a variety of fixes from 7.4.11.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.11,
- see <xref linkend="release-7-4-11">.
+ see <xref linkend="release-7-4-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.10.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.8,
- see <xref linkend="release-7-4-8">.
+ see <xref linkend="release-7-4-8"/>.
Also, you might need to <command>REINDEX</command> indexes on textual
columns after updating, if you are affected by the locale or
<application>plperl</application> issues described below.
<para>
This release contains a variety of fixes from 7.4.9.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.8,
- see <xref linkend="release-7-4-8">.
+ see <xref linkend="release-7-4-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 7.4.8.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 7.4.X. However,
if you are upgrading from a version earlier than 7.4.8,
- see <xref linkend="release-7-4-8">.
+ see <xref linkend="release-7-4-8"/>.
</para>
</sect2>
This release contains a variety of fixes from 7.4.7, including several
security-related issues.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
This release contains a variety of fixes from 7.4.6, including several
security-related issues.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 7.4.5.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
This release contains one serious bug fix over 7.4.4.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
This release contains a variety of fixes from 7.4.3.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
This release contains a variety of fixes from 7.4.2.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
This release contains a variety of fixes from 7.4.1.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
This release contains a variety of fixes from 7.4.
For information about new features in the 7.4 major release, see
- <xref linkend="release-7-4">.
+ <xref linkend="release-7-4"/>.
</para>
<para>
This release contains a variety of fixes from 8.0.25.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.22,
- see <xref linkend="release-8-0-22">.
+ see <xref linkend="release-8-0-22"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.24.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.22,
- see <xref linkend="release-8-0-22">.
+ see <xref linkend="release-8-0-22"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.23.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.22,
- see <xref linkend="release-8-0-22">.
+ see <xref linkend="release-8-0-22"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.22.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.22,
- see <xref linkend="release-8-0-22">.
+ see <xref linkend="release-8-0-22"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.21.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
However, if you have any hash indexes on <type>interval</type> columns,
you must <command>REINDEX</command> them after updating to 8.0.22.
Also, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.20.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.19.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.18.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.17.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains one serious bug fix over 8.0.16.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.15.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X.
However, if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.0.14,
including fixes for significant security issues.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.13.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.0.12,
including a security fix.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains one fix from 8.0.11.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.0.10, including
a security fix.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.9.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.8.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.0.7,
including patches for extremely serious security issues.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
<para>
<para>
This release contains a variety of fixes from 8.0.6.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.6,
- see <xref linkend="release-8-0-6">.
+ see <xref linkend="release-8-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.5.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.3,
- see <xref linkend="release-8-0-3">.
+ see <xref linkend="release-8-0-3"/>.
Also, you might need to <command>REINDEX</command> indexes on textual
columns after updating, if you are affected by the locale or
<application>plperl</application> issues described below.
<para>
This release contains a variety of fixes from 8.0.4.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.3,
- see <xref linkend="release-8-0-3">.
+ see <xref linkend="release-8-0-3"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.0.3.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.0.X. However,
if you are upgrading from a version earlier than 8.0.3,
- see <xref linkend="release-8-0-3">.
+ see <xref linkend="release-8-0-3"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.0.2, including several
security-related issues.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.0.1.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
This release contains a variety of fixes from 8.0.0, including several
security-related issues.
For information about new features in the 8.0 major release, see
- <xref linkend="release-8-0">.
+ <xref linkend="release-8-0"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.1.22.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.18,
- see <xref linkend="release-8-1-18">.
+ see <xref linkend="release-8-1-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.21.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.18,
- see <xref linkend="release-8-1-18">.
+ see <xref linkend="release-8-1-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.20.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.18,
- see <xref linkend="release-8-1-18">.
+ see <xref linkend="release-8-1-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.19.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.18,
- see <xref linkend="release-8-1-18">.
+ see <xref linkend="release-8-1-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.18.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.18,
- see <xref linkend="release-8-1-18">.
+ see <xref linkend="release-8-1-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.17.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
However, if you have any hash indexes on <type>interval</type> columns,
you must <command>REINDEX</command> them after updating to 8.1.18.
Also, if you are upgrading from a version earlier than 8.1.15,
- see <xref linkend="release-8-1-15">.
+ see <xref linkend="release-8-1-15"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.16.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.15,
- see <xref linkend="release-8-1-15">.
+ see <xref linkend="release-8-1-15"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.15.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.15,
- see <xref linkend="release-8-1-15">.
+ see <xref linkend="release-8-1-15"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.14.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">. Also, if you were running a previous
+ see <xref linkend="release-8-1-2"/>. Also, if you were running a previous
8.1.X release, it is recommended to <command>REINDEX</command> all GiST
indexes after the upgrade.
</para>
<para>
This release contains a variety of fixes from 8.1.13.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains one serious and one minor bug fix over 8.1.12.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.11.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.1.10,
including fixes for significant security issues.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.9.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.1.8,
including a security fix.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains one fix from 8.1.7.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.1.6, including
a security fix.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.5.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.4.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
This release contains a variety of fixes from 8.1.3,
including patches for extremely serious security issues.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
<para>
This release contains a variety of fixes from 8.1.2,
including one very serious security issue.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.1.X.
However, if you are upgrading from a version earlier than 8.1.2,
- see <xref linkend="release-8-1-2">.
+ see <xref linkend="release-8-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.1.1.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.1.0.
For information about new features in the 8.1 major release, see
- <xref linkend="release-8-1">.
+ <xref linkend="release-8-1"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.2.22.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<para>
<para>
Also, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.21.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.20.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.19.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.18.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.17.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.16.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.15.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.14.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.14,
- see <xref linkend="release-8-2-14">.
+ see <xref linkend="release-8-2-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.13.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
However, if you have any hash indexes on <type>interval</type> columns,
you must <command>REINDEX</command> them after updating to 8.2.14.
Also, if you are upgrading from a version earlier than 8.2.11,
- see <xref linkend="release-8-2-11">.
+ see <xref linkend="release-8-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.12.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.11,
- see <xref linkend="release-8-2-11">.
+ see <xref linkend="release-8-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.11.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.11,
- see <xref linkend="release-8-2-11">.
+ see <xref linkend="release-8-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.10.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.7,
- see <xref linkend="release-8-2-7">. Also, if you were running a previous
+ see <xref linkend="release-8-2-7"/>. Also, if you were running a previous
8.2.X release, it is recommended to <command>REINDEX</command> all GiST
indexes after the upgrade.
</para>
<para>
This release contains a variety of fixes from 8.2.9.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.7,
- see <xref linkend="release-8-2-7">.
+ see <xref linkend="release-8-2-7"/>.
</para>
</sect2>
<para>
This release contains one serious and one minor bug fix over 8.2.8.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.7,
- see <xref linkend="release-8-2-7">.
+ see <xref linkend="release-8-2-7"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.7.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.2.X.
However, if you are upgrading from a version earlier than 8.2.7,
- see <xref linkend="release-8-2-7">.
+ see <xref linkend="release-8-2-7"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.2.6.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
This release contains a variety of fixes from 8.2.5,
including fixes for significant security issues.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.2.4.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
This release contains a variety of fixes from 8.2.3,
including a security fix.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
This release contains two fixes from 8.2.2.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
This release contains a variety of fixes from 8.2.1, including
a security fix.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.2.
For information about new features in the 8.2 major release, see
- <xref linkend="release-8-2">.
+ <xref linkend="release-8-2"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.3.22.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 8.3.17,
- see <xref linkend="release-8-3-17">.
+ see <xref linkend="release-8-3-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.21.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 8.3.17,
- see <xref linkend="release-8-3-17">.
+ see <xref linkend="release-8-3-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.20.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 8.3.17,
- see <xref linkend="release-8-3-17">.
+ see <xref linkend="release-8-3-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.19.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 8.3.17,
- see <xref linkend="release-8-3-17">.
+ see <xref linkend="release-8-3-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.18.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.3.17,
- see <xref linkend="release-8-3-17">.
+ see <xref linkend="release-8-3-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.17.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.3.17,
- see <xref linkend="release-8-3-17">.
+ see <xref linkend="release-8-3-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.16.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.15.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.14.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.13.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.12.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.11.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.10.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.9.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.8.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.8,
- see <xref linkend="release-8-3-8">.
+ see <xref linkend="release-8-3-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.7.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
However, if you have any hash indexes on <type>interval</type> columns,
you must <command>REINDEX</command> them after updating to 8.3.8.
Also, if you are upgrading from a version earlier than 8.3.5,
- see <xref linkend="release-8-3-5">.
+ see <xref linkend="release-8-3-5"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.6.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.5,
- see <xref linkend="release-8-3-5">.
+ see <xref linkend="release-8-3-5"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.5.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.5,
- see <xref linkend="release-8-3-5">.
+ see <xref linkend="release-8-3-5"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.4.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.1,
- see <xref linkend="release-8-3-1">. Also, if you were running a previous
+ see <xref linkend="release-8-3-1"/>. Also, if you were running a previous
8.3.X release, it is recommended to <command>REINDEX</command> all GiST
indexes after the upgrade.
</para>
<para>
This release contains a variety of fixes from 8.3.3.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.1,
- see <xref linkend="release-8-3-1">.
+ see <xref linkend="release-8-3-1"/>.
</para>
</sect2>
<para>
This release contains one serious and one minor bug fix over 8.3.2.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.1,
- see <xref linkend="release-8-3-1">.
+ see <xref linkend="release-8-3-1"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.1.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.3.X.
However, if you are upgrading from a version earlier than 8.3.1,
- see <xref linkend="release-8-3-1">.
+ see <xref linkend="release-8-3-1"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.3.0.
For information about new features in the 8.3 major release, see
- <xref linkend="release-8-3">.
+ <xref linkend="release-8-3"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.4.21.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<para>
<para>
Also, if you are upgrading from a version earlier than 8.4.19,
- see <xref linkend="release-8-4-19">.
+ see <xref linkend="release-8-4-19"/>.
</para>
</sect2>
<listitem>
<para>
On Windows, allow new sessions to absorb values of PGC_BACKEND
- parameters (such as <xref linkend="guc-log-connections">) from the
+ parameters (such as <xref linkend="guc-log-connections"/>) from the
configuration file (Amit Kapila)
</para>
<para>
This release contains a variety of fixes from 8.4.20.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 8.4.19,
- see <xref linkend="release-8-4-19">.
+ see <xref linkend="release-8-4-19"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.19.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 8.4.19,
- see <xref linkend="release-8-4-19">.
+ see <xref linkend="release-8-4-19"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.18.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 8.4.17,
- see <xref linkend="release-8-4-17">.
+ see <xref linkend="release-8-4-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.17.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.17,
- see <xref linkend="release-8-4-17">.
+ see <xref linkend="release-8-4-17"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.16.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.15.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.14.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.13.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.12.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.11.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.10.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.10,
- see <xref linkend="release-8-4-10">.
+ see <xref linkend="release-8-4-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.9.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 8.4.8,
- see <xref linkend="release-8-4-8">.
+ see <xref linkend="release-8-4-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.8.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 8.4.8,
- see <xref linkend="release-8-4-8">.
+ see <xref linkend="release-8-4-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.7.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 8.4.2,
- see <xref linkend="release-8-4-2">.
+ see <xref linkend="release-8-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.6.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.4.X.
However, if you are upgrading from a version earlier than 8.4.2,
- see <xref linkend="release-8-4-2">.
+ see <xref linkend="release-8-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.5.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.4.X.
However, if you are upgrading from a version earlier than 8.4.2,
- see <xref linkend="release-8-4-2">.
+ see <xref linkend="release-8-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.4.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.4.X.
However, if you are upgrading from a version earlier than 8.4.2,
- see <xref linkend="release-8-4-2">.
+ see <xref linkend="release-8-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.3.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.4.X.
However, if you are upgrading from a version earlier than 8.4.2,
- see <xref linkend="release-8-4-2">.
+ see <xref linkend="release-8-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.2.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
A dump/restore is not required for those running 8.4.X.
However, if you are upgrading from a version earlier than 8.4.2,
- see <xref linkend="release-8-4-2">.
+ see <xref linkend="release-8-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 8.4.1.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 8.4.
For information about new features in the 8.4 major release, see
- <xref linkend="release-8-4">.
+ <xref linkend="release-8-4"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.0.22.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.0.18,
- see <xref linkend="release-9-0-18">.
+ see <xref linkend="release-9-0-18"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.0.21.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.0.18,
- see <xref linkend="release-9-0-18">.
+ see <xref linkend="release-9-0-18"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.0.20.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.0.18,
- see <xref linkend="release-9-0-18">.
+ see <xref linkend="release-9-0-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.19.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.0.18,
- see <xref linkend="release-9-0-18">.
+ see <xref linkend="release-9-0-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.18.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.18,
- see <xref linkend="release-9-0-18">.
+ see <xref linkend="release-9-0-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.17.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.0.15,
- see <xref linkend="release-9-0-15">.
+ see <xref linkend="release-9-0-15"/>.
</para>
</sect2>
<listitem>
<para>
On Windows, allow new sessions to absorb values of PGC_BACKEND
- parameters (such as <xref linkend="guc-log-connections">) from the
+ parameters (such as <xref linkend="guc-log-connections"/>) from the
configuration file (Amit Kapila)
</para>
<para>
This release contains a variety of fixes from 9.0.16.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.15,
- see <xref linkend="release-9-0-15">.
+ see <xref linkend="release-9-0-15"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.15.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.15,
- see <xref linkend="release-9-0-15">.
+ see <xref linkend="release-9-0-15"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.14.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.0.13,
- see <xref linkend="release-9-0-13">.
+ see <xref linkend="release-9-0-13"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.13.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.13,
- see <xref linkend="release-9-0-13">.
+ see <xref linkend="release-9-0-13"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.12.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.11.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.10.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.9.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.8.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.7.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.6.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.6,
- see <xref linkend="release-9-0-6">.
+ see <xref linkend="release-9-0-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.5.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.0.4,
- see <xref linkend="release-9-0-4">.
+ see <xref linkend="release-9-0-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.4.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.0.4,
- see <xref linkend="release-9-0-4">.
+ see <xref linkend="release-9-0-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.0.3.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.0.2.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.0.1.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.0.0.
For information about new features in the 9.0 major release, see
- <xref linkend="release-9-0">.
+ <xref linkend="release-9-0"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.1.23.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.22.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.21.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.20.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.19.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.18.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.1.17.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.1.16.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.16,
- see <xref linkend="release-9-1-16">.
+ see <xref linkend="release-9-1-16"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.15.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.1.14,
- see <xref linkend="release-9-1-14">.
+ see <xref linkend="release-9-1-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.14.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.14,
- see <xref linkend="release-9-1-14">.
+ see <xref linkend="release-9-1-14"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.13.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.1.11,
- see <xref linkend="release-9-1-11">.
+ see <xref linkend="release-9-1-11"/>.
</para>
</sect2>
<listitem>
<para>
- Fix feedback status when <xref linkend="guc-hot-standby-feedback"> is
+ Fix feedback status when <xref linkend="guc-hot-standby-feedback"/> is
turned off on-the-fly (Simon Riggs)
</para>
</listitem>
<listitem>
<para>
Prevent foreign tables from being created with OIDS
- when <xref linkend="guc-default-with-oids"> is true
+ when <xref linkend="guc-default-with-oids"/> is true
(Etsuro Fujita)
</para>
</listitem>
<listitem>
<para>
On Windows, allow new sessions to absorb values of PGC_BACKEND
- parameters (such as <xref linkend="guc-log-connections">) from the
+ parameters (such as <xref linkend="guc-log-connections"/>) from the
configuration file (Amit Kapila)
</para>
<para>
This release contains a variety of fixes from 9.1.12.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.11,
- see <xref linkend="release-9-1-11">.
+ see <xref linkend="release-9-1-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.11.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.11,
- see <xref linkend="release-9-1-11">.
+ see <xref linkend="release-9-1-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.10.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.1.9,
- see <xref linkend="release-9-1-9">.
+ see <xref linkend="release-9-1-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.9.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.9,
- see <xref linkend="release-9-1-9">.
+ see <xref linkend="release-9-1-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.8.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.1.6,
- see <xref linkend="release-9-1-6">.
+ see <xref linkend="release-9-1-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.7.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.6,
- see <xref linkend="release-9-1-6">.
+ see <xref linkend="release-9-1-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.6.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.6,
- see <xref linkend="release-9-1-6">.
+ see <xref linkend="release-9-1-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.5.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.1.4,
- see <xref linkend="release-9-1-4">.
+ see <xref linkend="release-9-1-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.4.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.4,
- see <xref linkend="release-9-1-4">.
+ see <xref linkend="release-9-1-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.3.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.1.2,
- see <xref linkend="release-9-1-2">.
+ see <xref linkend="release-9-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.2.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.1.2,
- see <xref linkend="release-9-1-2">.
+ see <xref linkend="release-9-1-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.1.1.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
This release contains a small number of fixes from 9.1.0.
For information about new features in the 9.1 major release, see
- <xref linkend="release-9-1">.
+ <xref linkend="release-9-1"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.2.23.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.2.22,
- see <xref linkend="release-9-2-22">.
+ see <xref linkend="release-9-2-22"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.2.22.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<para>
<para>
However, if you are upgrading from a version earlier than 9.2.22,
- see <xref linkend="release-9-2-22">.
+ see <xref linkend="release-9-2-22"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.21.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<para>
<para>
Also, if you are upgrading from a version earlier than 9.2.20,
- see <xref linkend="release-9-2-20">.
+ see <xref linkend="release-9-2-20"/>.
</para>
</sect2>
<listitem>
<para>
- Fix code for setting <xref linkend="guc-tcp-keepalives-idle"> on
+ Fix code for setting <xref linkend="guc-tcp-keepalives-idle"/> on
Solaris (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix <application>pg_upgrade</application> to ensure that the ending WAL record
- does not have <xref linkend="guc-wal-level"> = <literal>minimum</literal>
+ does not have <xref linkend="guc-wal-level"/> = <literal>minimum</literal>
(Bruce Momjian)
</para>
<para>
This release contains a variety of fixes from 9.2.20.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<para>
<para>
Also, if you are upgrading from a version earlier than 9.2.20,
- see <xref linkend="release-9-2-20">.
+ see <xref linkend="release-9-2-20"/>.
</para>
</sect2>
By itself, this patch will only fix the behavior in newly initdb'd
databases. If you wish to apply this change in an existing database,
follow the corrected procedure shown in the changelog entry for
- CVE-2017-7547, in <xref linkend="release-9-2-22">.
+ CVE-2017-7547, in <xref linkend="release-9-2-22"/>.
</para>
</listitem>
will use the current and historical DST transition dates of
the <literal>US/Eastern</literal> zone. If you don't want that, remove
the <filename>posixrules</filename> file, or replace it with a copy of some
- other zone file (see <xref linkend="datatype-timezones">). Note that
+ other zone file (see <xref linkend="datatype-timezones"/>). Note that
due to caching, you may need to restart the server to get such changes
to take effect.
</para>
<para>
This release contains a variety of fixes from 9.2.19.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
</para>
<para>
- Previously, this was skipped when <xref linkend="guc-wal-level">
+ Previously, this was skipped when <xref linkend="guc-wal-level"/>
= <literal>minimal</literal>, but actually it's necessary even in that case
to ensure that the unlogged table is properly reset to empty after a
crash.
<para>
Previously, non-default settings
- of <xref linkend="guc-default-tablespace"> could result in broken
+ of <xref linkend="guc-default-tablespace"/> could result in broken
indexes.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.2.18.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<listitem>
<para>
Fix <command>EXPLAIN</command> to emit valid XML when
- <xref linkend="guc-track-io-timing"> is on (Markus Winand)
+ <xref linkend="guc-track-io-timing"/> is on (Markus Winand)
</para>
<para>
<para>
This release contains a variety of fixes from 9.2.17.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.16.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.15.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.14.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.13.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.2.12.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.2.11.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.11,
- see <xref linkend="release-9-2-11">.
+ see <xref linkend="release-9-2-11"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.10.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.2.10,
- see <xref linkend="release-9-2-10">.
+ see <xref linkend="release-9-2-10"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.9.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.2.9,
- see <xref linkend="release-9-2-9">.
+ see <xref linkend="release-9-2-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.8.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.2.6,
- see <xref linkend="release-9-2-6">.
+ see <xref linkend="release-9-2-6"/>.
</para>
</sect2>
<listitem>
<para>
- Fix feedback status when <xref linkend="guc-hot-standby-feedback"> is
+ Fix feedback status when <xref linkend="guc-hot-standby-feedback"/> is
turned off on-the-fly (Simon Riggs)
</para>
</listitem>
<listitem>
<para>
Prevent foreign tables from being created with OIDS
- when <xref linkend="guc-default-with-oids"> is true
+ when <xref linkend="guc-default-with-oids"/> is true
(Etsuro Fujita)
</para>
</listitem>
<listitem>
<para>
On Windows, allow new sessions to absorb values of PGC_BACKEND
- parameters (such as <xref linkend="guc-log-connections">) from the
+ parameters (such as <xref linkend="guc-log-connections"/>) from the
configuration file (Amit Kapila)
</para>
<para>
This release contains a variety of fixes from 9.2.7.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.6,
- see <xref linkend="release-9-2-6">.
+ see <xref linkend="release-9-2-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.6.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.6,
- see <xref linkend="release-9-2-6">.
+ see <xref linkend="release-9-2-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.5.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.2.4,
- see <xref linkend="release-9-2-4">.
+ see <xref linkend="release-9-2-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.4.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.4,
- see <xref linkend="release-9-2-4">.
+ see <xref linkend="release-9-2-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.3.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.2.2,
- see <xref linkend="release-9-2-2">.
+ see <xref linkend="release-9-2-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.2.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.2.2,
- see <xref linkend="release-9-2-2">.
+ see <xref linkend="release-9-2-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.1.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from version 9.2.0,
- see <xref linkend="release-9-2-1">.
+ see <xref linkend="release-9-2-1"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.2.0.
For information about new features in the 9.2 major release, see
- <xref linkend="release-9-2">.
+ <xref linkend="release-9-2"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.3.19.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.18,
- see <xref linkend="release-9-3-18">.
+ see <xref linkend="release-9-3-18"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.3.18.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.18,
- see <xref linkend="release-9-3-18">.
+ see <xref linkend="release-9-3-18"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.17.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.16,
- see <xref linkend="release-9-3-16">.
+ see <xref linkend="release-9-3-16"/>.
</para>
</sect2>
<listitem>
<para>
- Fix code for setting <xref linkend="guc-tcp-keepalives-idle"> on
+ Fix code for setting <xref linkend="guc-tcp-keepalives-idle"/> on
Solaris (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix <application>pg_upgrade</application> to ensure that the ending WAL record
- does not have <xref linkend="guc-wal-level"> = <literal>minimum</literal>
+ does not have <xref linkend="guc-wal-level"/> = <literal>minimum</literal>
(Bruce Momjian)
</para>
<para>
This release contains a variety of fixes from 9.3.16.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.16,
- see <xref linkend="release-9-3-16">.
+ see <xref linkend="release-9-3-16"/>.
</para>
</sect2>
By itself, this patch will only fix the behavior in newly initdb'd
databases. If you wish to apply this change in an existing database,
follow the corrected procedure shown in the changelog entry for
- CVE-2017-7547, in <xref linkend="release-9-3-18">.
+ CVE-2017-7547, in <xref linkend="release-9-3-18"/>.
</para>
</listitem>
will use the current and historical DST transition dates of
the <literal>US/Eastern</literal> zone. If you don't want that, remove
the <filename>posixrules</filename> file, or replace it with a copy of some
- other zone file (see <xref linkend="datatype-timezones">). Note that
+ other zone file (see <xref linkend="datatype-timezones"/>). Note that
due to caching, you may need to restart the server to get such changes
to take effect.
</para>
<para>
This release contains a variety of fixes from 9.3.15.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.15,
- see <xref linkend="release-9-3-15">.
+ see <xref linkend="release-9-3-15"/>.
</para>
</sect2>
</para>
<para>
- Previously, this was skipped when <xref linkend="guc-wal-level">
+ Previously, this was skipped when <xref linkend="guc-wal-level"/>
= <literal>minimal</literal>, but actually it's necessary even in that case
to ensure that the unlogged table is properly reset to empty after a
crash.
<para>
Previously, non-default settings
- of <xref linkend="guc-default-tablespace"> could result in broken
+ of <xref linkend="guc-default-tablespace"/> could result in broken
indexes.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.3.14.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.9,
- see <xref linkend="release-9-3-9">.
+ see <xref linkend="release-9-3-9"/>.
</para>
</sect2>
<listitem>
<para>
Fix <command>EXPLAIN</command> to emit valid XML when
- <xref linkend="guc-track-io-timing"> is on (Markus Winand)
+ <xref linkend="guc-track-io-timing"/> is on (Markus Winand)
</para>
<para>
<para>
This release contains a variety of fixes from 9.3.13.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.9,
- see <xref linkend="release-9-3-9">.
+ see <xref linkend="release-9-3-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.12.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.9,
- see <xref linkend="release-9-3-9">.
+ see <xref linkend="release-9-3-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.11.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.9,
- see <xref linkend="release-9-3-9">.
+ see <xref linkend="release-9-3-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.10.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.9,
- see <xref linkend="release-9-3-9">.
+ see <xref linkend="release-9-3-9"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.9.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.9,
- see <xref linkend="release-9-3-9">.
+ see <xref linkend="release-9-3-9"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.3.8.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.7,
- see <xref linkend="release-9-3-7">.
+ see <xref linkend="release-9-3-7"/>.
</para>
</sect2>
Otherwise, for each table that has
<structname>pg_class</structname>.<structfield>relminmxid</structfield> equal to 1,
<command>VACUUM</command> that table with
- both <xref linkend="guc-vacuum-multixact-freeze-min-age">
- and <xref linkend="guc-vacuum-multixact-freeze-table-age"> set to
+ both <xref linkend="guc-vacuum-multixact-freeze-min-age"/>
+ and <xref linkend="guc-vacuum-multixact-freeze-table-age"/> set to
zero. (You can use the vacuum cost delay parameters described
- in <xref linkend="runtime-config-resource-vacuum-cost"> to reduce
+ in <xref linkend="runtime-config-resource-vacuum-cost"/> to reduce
the performance consequences for concurrent sessions.) You must
use <productname>PostgreSQL</productname> 9.3.5 or later to perform this step.
</para>
<para>
This release contains a small number of fixes from 9.3.7.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.3.7,
- see <xref linkend="release-9-3-7">.
+ see <xref linkend="release-9-3-7"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.6.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.6,
- see <xref linkend="release-9-3-6">.
+ see <xref linkend="release-9-3-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.5.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.5,
- see <xref linkend="release-9-3-5">.
+ see <xref linkend="release-9-3-5"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.4.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.4,
- see <xref linkend="release-9-3-4">.
+ see <xref linkend="release-9-3-4"/>.
</para>
</sect2>
<listitem>
<para>
Prevent foreign tables from being created with OIDS
- when <xref linkend="guc-default-with-oids"> is true
+ when <xref linkend="guc-default-with-oids"/> is true
(Etsuro Fujita)
</para>
</listitem>
<listitem>
<para>
On Windows, allow new sessions to absorb values of PGC_BACKEND
- parameters (such as <xref linkend="guc-log-connections">) from the
+ parameters (such as <xref linkend="guc-log-connections"/>) from the
configuration file (Amit Kapila)
</para>
<para>
This release contains a variety of fixes from 9.3.3.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.3,
- see <xref linkend="release-9-3-3">.
+ see <xref linkend="release-9-3-3"/>.
</para>
</sect2>
<application>walsender</application> failed to send ping messages to the client
if it was constantly busy sending WAL data; but it expected to see
ping responses despite that, and would therefore disconnect
- once <xref linkend="guc-wal-sender-timeout"> elapsed.
+ once <xref linkend="guc-wal-sender-timeout"/> elapsed.
</para>
</listitem>
<listitem>
<para>
- Add read-only <xref linkend="guc-data-checksums"> parameter to
+ Add read-only <xref linkend="guc-data-checksums"/> parameter to
display whether page checksums are enabled (Heikki Linnakangas)
</para>
<para>
This release contains a variety of fixes from 9.3.2.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.2,
- see <xref linkend="release-9-3-2">.
+ see <xref linkend="release-9-3-2"/>.
</para>
</sect2>
freezing parameters were used for multixact IDs too; but since
the consumption rates of transaction IDs and multixact IDs can be
quite different, this did not work very well. Introduce new settings
- <xref linkend="guc-vacuum-multixact-freeze-min-age">,
- <xref linkend="guc-vacuum-multixact-freeze-table-age">, and
- <xref linkend="guc-autovacuum-multixact-freeze-max-age">
+ <xref linkend="guc-vacuum-multixact-freeze-min-age"/>,
+ <xref linkend="guc-vacuum-multixact-freeze-table-age"/>, and
+ <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>
to control when to freeze multixacts.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.3.1.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.3.1,
- see <xref linkend="release-9-3-1">.
+ see <xref linkend="release-9-3-1"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.3.0.
For information about new features in the 9.3 major release, see
- <xref linkend="release-9-3">.
+ <xref linkend="release-9-3"/>.
</para>
<sect2>
<para>
This release contains a variety of fixes from 9.4.14.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.13,
- see <xref linkend="release-9-4-13">.
+ see <xref linkend="release-9-4-13"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.4.13.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.13,
- see <xref linkend="release-9-4-13">.
+ see <xref linkend="release-9-4-13"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.4.12.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.12,
- see <xref linkend="release-9-4-12">.
+ see <xref linkend="release-9-4-12"/>.
</para>
</sect2>
<listitem>
<para>
- Fix code for setting <xref linkend="guc-tcp-keepalives-idle"> on
+ Fix code for setting <xref linkend="guc-tcp-keepalives-idle"/> on
Solaris (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix <application>pg_upgrade</application> to ensure that the ending WAL record
- does not have <xref linkend="guc-wal-level"> = <literal>minimum</literal>
+ does not have <xref linkend="guc-wal-level"/> = <literal>minimum</literal>
(Bruce Momjian)
</para>
<para>
This release contains a variety of fixes from 9.4.11.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.11,
- see <xref linkend="release-9-4-11">.
+ see <xref linkend="release-9-4-11"/>.
</para>
</sect2>
By itself, this patch will only fix the behavior in newly initdb'd
databases. If you wish to apply this change in an existing database,
follow the corrected procedure shown in the changelog entry for
- CVE-2017-7547, in <xref linkend="release-9-4-13">.
+ CVE-2017-7547, in <xref linkend="release-9-4-13"/>.
</para>
</listitem>
will use the current and historical DST transition dates of
the <literal>US/Eastern</literal> zone. If you don't want that, remove
the <filename>posixrules</filename> file, or replace it with a copy of some
- other zone file (see <xref linkend="datatype-timezones">). Note that
+ other zone file (see <xref linkend="datatype-timezones"/>). Note that
due to caching, you may need to restart the server to get such changes
to take effect.
</para>
<para>
This release contains a variety of fixes from 9.4.10.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.10,
- see <xref linkend="release-9-4-10">.
+ see <xref linkend="release-9-4-10"/>.
</para>
</sect2>
</para>
<para>
- Previously, this was skipped when <xref linkend="guc-wal-level">
+ Previously, this was skipped when <xref linkend="guc-wal-level"/>
= <literal>minimal</literal>, but actually it's necessary even in that case
to ensure that the unlogged table is properly reset to empty after a
crash.
<para>
Previously, non-default settings
- of <xref linkend="guc-default-tablespace"> could result in broken
+ of <xref linkend="guc-default-tablespace"/> could result in broken
indexes.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.4.9.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.6,
- see <xref linkend="release-9-4-6">.
+ see <xref linkend="release-9-4-6"/>.
</para>
</sect2>
<listitem>
<para>
Fix <command>EXPLAIN</command> to emit valid XML when
- <xref linkend="guc-track-io-timing"> is on (Markus Winand)
+ <xref linkend="guc-track-io-timing"/> is on (Markus Winand)
</para>
<para>
<para>
This release contains a variety of fixes from 9.4.8.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.6,
- see <xref linkend="release-9-4-6">.
+ see <xref linkend="release-9-4-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.4.7.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.6,
- see <xref linkend="release-9-4-6">.
+ see <xref linkend="release-9-4-6"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.4.6.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.6,
- see <xref linkend="release-9-4-6">.
+ see <xref linkend="release-9-4-6"/>.
</para>
</sect2>
<listitem>
<para>
- Ignore <xref linkend="recovery-min-apply-delay"> parameter until
+ Ignore <xref linkend="recovery-min-apply-delay"/> parameter until
recovery has reached a consistent state (Michael Paquier)
</para>
<para>
This release contains a variety of fixes from 9.4.5.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.4,
- see <xref linkend="release-9-4-4">.
+ see <xref linkend="release-9-4-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.4.4.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.4,
- see <xref linkend="release-9-4-4">.
+ see <xref linkend="release-9-4-4"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.4.3.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.2,
- see <xref linkend="release-9-4-2">.
+ see <xref linkend="release-9-4-2"/>.
</para>
</sect2>
Otherwise, for each table that has
<structname>pg_class</structname>.<structfield>relminmxid</structfield> equal to 1,
<command>VACUUM</command> that table with
- both <xref linkend="guc-vacuum-multixact-freeze-min-age">
- and <xref linkend="guc-vacuum-multixact-freeze-table-age"> set to
+ both <xref linkend="guc-vacuum-multixact-freeze-min-age"/>
+ and <xref linkend="guc-vacuum-multixact-freeze-table-age"/> set to
zero. (You can use the vacuum cost delay parameters described
- in <xref linkend="runtime-config-resource-vacuum-cost"> to reduce
+ in <xref linkend="runtime-config-resource-vacuum-cost"/> to reduce
the performance consequences for concurrent sessions.)
</para>
</listitem>
<para>
This release contains a small number of fixes from 9.4.2.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.4.2,
- see <xref linkend="release-9-4-2">.
+ see <xref linkend="release-9-4-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.4.1.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.4.1,
- see <xref linkend="release-9-4-1">.
+ see <xref linkend="release-9-4-1"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.4.0.
For information about new features in the 9.4 major release, see
- <xref linkend="release-9-4">.
+ <xref linkend="release-9-4"/>.
</para>
<sect2>
<listitem>
<para>
- Add new <acronym>SQL</acronym> command <xref linkend="sql-altersystem">
+ Add new <acronym>SQL</acronym> command <xref linkend="sql-altersystem"/>
for changing <filename>postgresql.conf</filename> configuration file entries
</para>
</listitem>
<listitem>
<para>
- Reduce lock strength for some <xref linkend="sql-altertable">
+ Reduce lock strength for some <xref linkend="sql-altertable"/>
commands
</para>
</listitem>
<title>Migration to Version 9.4</title>
<para>
- A dump/restore using <xref linkend="app-pg-dumpall">, or use
- of <xref linkend="pgupgrade">, is required for those wishing to migrate
+ A dump/restore using <xref linkend="app-pg-dumpall"/>, or use
+ of <xref linkend="pgupgrade"/>, is required for those wishing to migrate
data from any previous release.
</para>
<para>
Previously such values were rendered according to the current
- <xref linkend="guc-datestyle"> setting; but many JSON processors
+ <xref linkend="guc-datestyle"/> setting; but many JSON processors
require timestamps to be in ISO 8601 format. If necessary, the
previous behavior can be obtained by explicitly casting the datetime
value to <type>text</type> before passing it to the JSON conversion
<listitem>
<para>
- <xref linkend="sql-discard"> now also discards sequence-related state
+ <xref linkend="sql-discard"/> now also discards sequence-related state
(Fabrízio de Royes Mello, Robert Haas)
</para>
</listitem>
<para>
User commands that did their own quote preservation might need
adjustment. This is likely to be an issue for commands used in
- <xref linkend="guc-archive-command">, <xref linkend="restore-command">,
+ <xref linkend="guc-archive-command"/>, <xref linkend="restore-command"/>,
and <link linkend="sql-copy"><command>COPY TO/FROM PROGRAM</command></link>.
</para>
</listitem>
<listitem>
<para>
- Change empty arrays returned by the <xref linkend="intarray"> module
+ Change empty arrays returned by the <xref linkend="intarray"/> module
to be zero-dimensional arrays (Bruce Momjian)
</para>
<listitem>
<para>
- <xref linkend="pgupgrade"> now uses <option>-U</option>
+ <xref linkend="pgupgrade"/> now uses <option>-U</option>
or <option>--username</option> to specify the user name (Bruce Momjian)
</para>
<para>
This reduces the likelihood of leaving orphaned child processes
- behind after <xref linkend="app-postmaster"> shutdown, as well
+ behind after <xref linkend="app-postmaster"/> shutdown, as well
as ensuring that crash recovery can proceed if some child processes
have become <quote>stuck</quote>.
</para>
<listitem>
<para>
- Make <xref linkend="sql-vacuum"> properly report dead but
+ Make <xref linkend="sql-vacuum"/> properly report dead but
not-yet-removable rows to the statistics collector (Hari Babu)
</para>
</para>
<para>
- Indexes upgraded via <xref linkend="pgupgrade"> will work fine
+ Indexes upgraded via <xref linkend="pgupgrade"/> will work fine
but will still be in the old, larger <acronym>GIN</acronym> format.
- Use <xref linkend="sql-reindex"> to recreate old GIN indexes in the
+ Use <xref linkend="sql-reindex"/> to recreate old GIN indexes in the
new format.
</para>
</listitem>
<para>
Attempt to <link linkend="vacuum-for-wraparound">freeze</link>
tuples when tables are rewritten with <xref
- linkend="sql-cluster"> or <link
+ linkend="sql-cluster"/> or <link
linkend="sql-vacuum"><command>VACUUM FULL</command></link> (Robert Haas,
Andres Freund)
</para>
<listitem>
<para>
- Improve speed of <xref linkend="sql-copy"> with default <link
+ Improve speed of <xref linkend="sql-copy"/> with default <link
linkend="functions-sequence-table"><function>nextval()</function></link>
columns (Simon Riggs)
</para>
<listitem>
<para>
Reduce memory allocated by <application>PL/pgSQL</application>
- <xref linkend="sql-do"> blocks (Tom Lane)
+ <xref linkend="sql-do"/> blocks (Tom Lane)
</para>
</listitem>
<listitem>
<para>
- Add <xref linkend="pg-stat-archiver-view"> system view to
+ Add <xref linkend="pg-stat-archiver-view"/> system view to
report <link linkend="wal"><acronym>WAL</acronym></link> archiver activity
(Gabriele Bartolini)
</para>
<listitem>
<para>
Add <structfield>n_mod_since_analyze</structfield> columns to
- <xref linkend="pg-stat-all-tables-view"> and related system views
+ <xref linkend="pg-stat-all-tables-view"/> and related system views
(Mark Kirkwood)
</para>
<para>
These columns expose the system's estimate of the number of changed
- tuples since the table's last <xref linkend="sql-analyze">. This
+ tuples since the table's last <xref linkend="sql-analyze"/>. This
estimate drives decisions about when to auto-analyze.
</para>
</listitem>
<listitem>
<para>
Add <structfield>backend_xid</structfield> and <structfield>backend_xmin</structfield>
- columns to the system view <xref linkend="pg-stat-activity-view">,
+ columns to the system view <xref linkend="pg-stat-activity-view"/>,
and a <structfield>backend_xmin</structfield> column to
- <xref linkend="pg-stat-replication-view"> (Christian Kruse)
+ <xref linkend="pg-stat-replication-view"/> (Christian Kruse)
</para>
</listitem>
This allows use of Elliptic Curve keys for server authentication.
Such keys are faster and have better security than <acronym>RSA</acronym>
keys. The new configuration parameter
- <xref linkend="guc-ssl-ecdh-curve">
+ <xref linkend="guc-ssl-ecdh-curve"/>
controls which curve is used for <acronym>ECDH</acronym>.
</para>
</listitem>
<listitem>
<para>
- Improve the default <xref linkend="guc-ssl-ciphers"> setting
+ Improve the default <xref linkend="guc-ssl-ciphers"/> setting
(Marko Kreen)
</para>
</listitem>
</para>
<para>
- Previously, the order specified by <xref linkend="guc-ssl-ciphers">
+ Previously, the order specified by <xref linkend="guc-ssl-ciphers"/>
was usually ignored in favor of client-side defaults, which are not
configurable in most <productname>PostgreSQL</productname> clients. If
desired, the old behavior can be restored via the new configuration
- parameter <xref linkend="guc-ssl-prefer-server-ciphers">.
+ parameter <xref linkend="guc-ssl-prefer-server-ciphers"/>.
</para>
</listitem>
<listitem>
<para>
- Make <xref linkend="guc-log-connections"> show <acronym>SSL</acronym>
+ Make <xref linkend="guc-log-connections"/> show <acronym>SSL</acronym>
encryption information (Andreas Kunert)
</para>
</listitem>
<listitem>
<para>
- Add new <acronym>SQL</acronym> command <xref linkend="sql-altersystem">
+ Add new <acronym>SQL</acronym> command <xref linkend="sql-altersystem"/>
for changing <filename>postgresql.conf</filename> configuration file entries
(Amit Kapila)
</para>
<listitem>
<para>
- Add <xref linkend="guc-autovacuum-work-mem"> configuration parameter
+ Add <xref linkend="guc-autovacuum-work-mem"/> configuration parameter
to control the amount of memory used by autovacuum workers
(Peter Geoghegan)
</para>
<listitem>
<para>
- Add <xref linkend="guc-huge-pages"> parameter to allow using huge
+ Add <xref linkend="guc-huge-pages"/> parameter to allow using huge
memory pages on Linux (Christian Kruse, Richard Poole, Abhijit
Menon-Sen)
</para>
<listitem>
<para>
- Add <xref linkend="guc-max-worker-processes"> parameter
+ Add <xref linkend="guc-max-worker-processes"/> parameter
to limit the number of background workers (Robert Haas)
</para>
<listitem>
<para>
- Add superuser-only <xref linkend="guc-session-preload-libraries">
+ Add superuser-only <xref linkend="guc-session-preload-libraries"/>
parameter to load libraries at session start (Peter Eisentraut)
</para>
<para>
- In contrast to <xref linkend="guc-local-preload-libraries">, this
+ In contrast to <xref linkend="guc-local-preload-libraries"/>, this
parameter can load any shared library, not just those in
the <filename>$libdir/plugins</filename> directory.
</para>
<listitem>
<para>
- Add <xref linkend="guc-wal-log-hints"> parameter to enable WAL
+ Add <xref linkend="guc-wal-log-hints"/> parameter to enable WAL
logging of hint-bit changes (Sawada Masahiko)
</para>
<listitem>
<para>
- Increase the default settings of <xref linkend="guc-work-mem">
- and <xref linkend="guc-maintenance-work-mem"> by four times (Bruce
+ Increase the default settings of <xref linkend="guc-work-mem"/>
+ and <xref linkend="guc-maintenance-work-mem"/> by four times (Bruce
Momjian)
</para>
<listitem>
<para>
Increase the default setting of <xref
- linkend="guc-effective-cache-size">
+ linkend="guc-effective-cache-size"/>
to 4GB (Bruce Momjian, Tom Lane)
</para>
</listitem>
<listitem>
<para>
Allow <function>printf</function>-style space padding to be
- specified in <xref linkend="guc-log-line-prefix"> (David Rowley)
+ specified in <xref linkend="guc-log-line-prefix"/> (David Rowley)
</para>
</listitem>
<listitem>
<para>
Show <acronym>PID</acronym>s of lock holders and waiters and improve
- information about relations in <xref linkend="guc-log-lock-waits">
+ information about relations in <xref linkend="guc-log-lock-waits"/>
log messages (Christian Kruse)
</para>
</listitem>
<listitem>
<para>
On Windows, make <literal>SQL_ASCII</literal>-encoded databases and server
- processes (e.g., <xref linkend="app-postmaster">) emit messages in
+ processes (e.g., <xref linkend="app-postmaster"/>) emit messages in
the character encoding of the server's Windows user locale
(Alexander Law, Noah Misch)
</para>
<listitem>
<para>
- Add recovery parameter <xref linkend="recovery-min-apply-delay">
+ Add recovery parameter <xref linkend="recovery-min-apply-delay"/>
to delay replication (Robert Haas, Fabrízio de Royes Mello,
Simon Riggs)
</para>
<listitem>
<para>
- Add <xref linkend="recovery-target">
+ Add <xref linkend="recovery-target"/>
option <option>immediate</option> to stop <link
linkend="wal"><acronym>WAL</acronym></link> recovery as soon as a
consistent state is reached (MauMau, Heikki Linnakangas)
<listitem>
<para>
- Add new <xref linkend="guc-wal-level"> setting <option>logical</option>
+ Add new <xref linkend="guc-wal-level"/> setting <option>logical</option>
to enable logical change-set encoding in <acronym>WAL</acronym> (Andres
Freund)
</para>
<listitem>
<para>
- Add <xref linkend="app-pgrecvlogical"> application to receive
+ Add <xref linkend="app-pgrecvlogical"/> application to receive
logical-decoding data (Andres Freund)
</para>
</listitem>
<listitem>
<para>
- Add <xref linkend="test-decoding"> module to illustrate logical
+ Add <xref linkend="test-decoding"/> module to illustrate logical
decoding at the <acronym>SQL</acronym> level (Andres Freund)
</para>
</listitem>
<listitem>
<para>
- Allow <xref linkend="sql-select"> to have
+ Allow <xref linkend="sql-select"/> to have
an empty target list (Tom Lane)
</para>
</itemizedlist>
<sect4>
- <title><xref linkend="sql-explain"></title>
+ <title><xref linkend="sql-explain"/></title>
<itemizedlist>
</para>
<para>
- This is controlled with the new <xref linkend="sql-createview">
+ This is controlled with the new <xref linkend="sql-createview"/>
clause <literal>WITH CHECK OPTION</literal>.
</para>
</listitem>
<para>
Allow moving groups of objects from one tablespace to another
using the <literal>ALL IN TABLESPACE ... SET TABLESPACE</literal> form of
- <xref linkend="sql-altertable">, <xref linkend="sql-alterindex">, or
- <xref linkend="sql-altermaterializedview"> (Stephen Frost)
+ <xref linkend="sql-altertable"/>, <xref linkend="sql-alterindex"/>, or
+ <xref linkend="sql-altermaterializedview"/> (Stephen Frost)
</para>
</listitem>
<listitem>
<para>
Allow changing foreign key constraint deferrability
- via <xref linkend="sql-altertable"> ... <literal>ALTER
+ via <xref linkend="sql-altertable"/> ... <literal>ALTER
CONSTRAINT</literal> (Simon Riggs)
</para>
</listitem>
<listitem>
<para>
- Reduce lock strength for some <xref linkend="sql-altertable">
+ Reduce lock strength for some <xref linkend="sql-altertable"/>
commands
(Simon Riggs, Noah Misch, Robert Haas)
</para>
<listitem>
<para>
Allow tablespace options to be set
- in <xref linkend="sql-createtablespace"> (Vik Fearing)
+ in <xref linkend="sql-createtablespace"/> (Vik Fearing)
</para>
<para>
Formerly these options could only be set
- via <xref linkend="sql-altertablespace">.
+ via <xref linkend="sql-altertablespace"/>.
</para>
</listitem>
<listitem>
<para>
- Allow <xref linkend="sql-createaggregate"> to define the estimated
+ Allow <xref linkend="sql-createaggregate"/> to define the estimated
size of the aggregate's transition state data (Hadi Moshayedi)
</para>
<listitem>
<para>
- Add <xref linkend="app-createuser"> option <option>-g</option>
+ Add <xref linkend="app-createuser"/> option <option>-g</option>
to specify role membership (Christopher Browne)
</para>
</listitem>
<listitem>
<para>
- Add <xref linkend="app-vacuumdb">
+ Add <xref linkend="app-vacuumdb"/>
option <option>--analyze-in-stages</option> to analyze in stages of
increasing granularity (Peter Eisentraut)
</para>
<listitem>
<para>
- Make <xref linkend="app-initdb"> throw error for incorrect locale
+ Make <xref linkend="app-initdb"/> throw error for incorrect locale
settings, rather than silently falling back to a default choice
(Tom Lane)
</para>
<listitem>
<para>
- Make <xref linkend="app-pg-ctl"> return exit code <literal>4</literal> for
+ Make <xref linkend="app-pg-ctl"/> return exit code <literal>4</literal> for
an inaccessible data directory (Amit Kapila, Bruce Momjian)
</para>
<para>
On Windows, ensure that a non-absolute <option>-D</option> path
specification is interpreted relative
- to <xref linkend="app-pg-ctl">'s current directory
+ to <xref linkend="app-pg-ctl"/>'s current directory
(Kumar Rajeev Rastogi)
</para>
</itemizedlist>
<sect4>
- <title><xref linkend="app-psql"></title>
+ <title><xref linkend="app-psql"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="app-pgdump"></title>
+ <title><xref linkend="app-pgdump"/></title>
<itemizedlist>
<listitem>
<para>
- Allow <xref linkend="app-pgrestore"> options
+ Allow <xref linkend="app-pgrestore"/> options
<option>-I</option>, <option>-P</option>, <option>-T</option> and <option>-n</option>
to be specified multiple times (Heikki Linnakangas)
</para>
<para>
This change prevents unnecessary errors when removing old objects.
The new <option>--if-exists</option> option
- for <xref linkend="app-pgdump">, <xref linkend="app-pg-dumpall">,
- and <xref linkend="app-pgrestore"> is only available
+ for <xref linkend="app-pgdump"/>, <xref linkend="app-pg-dumpall"/>,
+ and <xref linkend="app-pgrestore"/> is only available
when <option>--clean</option> is also specified.
</para>
</listitem>
</sect4>
<sect4>
- <title><xref linkend="app-pgbasebackup"></title>
+ <title><xref linkend="app-pgbasebackup"/></title>
<itemizedlist>
<listitem>
<para>
- Add <xref linkend="pgprewarm"> extension to preload relation data
+ Add <xref linkend="pgprewarm"/> extension to preload relation data
into the shared buffer cache at server start (Robert Haas)
</para>
<listitem>
<para>
Add <acronym>UUID</acronym> random number generator
- <function>gen_random_uuid()</function> to <xref linkend="pgcrypto">
+ <function>gen_random_uuid()</function> to <xref linkend="pgcrypto"/>
(Oskari Saarenmaa)
</para>
<para>
This allows creation of version 4 <acronym>UUID</acronym>s without
- requiring installation of <xref linkend="uuid-ossp">.
+ requiring installation of <xref linkend="uuid-ossp"/>.
</para>
</listitem>
<listitem>
<para>
- Allow <xref linkend="uuid-ossp"> to work with
+ Allow <xref linkend="uuid-ossp"/> to work with
the <systemitem>BSD</systemitem> or <systemitem>e2fsprogs</systemitem> UUID libraries,
not only the <systemitem>OSSP</systemitem> UUID library (Matteo Beccati)
</para>
<listitem>
<para>
- Add option to <xref linkend="auto-explain"> to include trigger
+ Add option to <xref linkend="auto-explain"/> to include trigger
execution time (Horiguchi Kyotaro)
</para>
</listitem>
<listitem>
<para>
- Fix <xref linkend="pgstattuple"> to not report rows from
+ Fix <xref linkend="pgstattuple"/> to not report rows from
uncommitted transactions as dead (Robert Haas)
</para>
</listitem>
<listitem>
<para>
- Make <xref linkend="pgstattuple"> functions
+ Make <xref linkend="pgstattuple"/> functions
use <type>regclass</type>-type arguments (Satoshi Nagayasu)
</para>
<listitem>
<para>
- Improve consistency of <xref linkend="pgrowlocks"> output to honor
+ Improve consistency of <xref linkend="pgrowlocks"/> output to honor
snapshot rules more consistently (Robert Haas)
</para>
</listitem>
<listitem>
<para>
- Improve <xref linkend="pgtrgm">'s choice of trigrams for indexed
+ Improve <xref linkend="pgtrgm"/>'s choice of trigrams for indexed
regular expression searches (Alexander Korotkov)
</para>
<listitem>
<para>
- Store <xref linkend="cube"> data more compactly (Stas Kelvich)
+ Store <xref linkend="cube"/> data more compactly (Stas Kelvich)
</para>
<para>
<listitem>
<para>
- Reduce <xref linkend="vacuumlo"> client-side memory usage by using
+ Reduce <xref linkend="vacuumlo"/> client-side memory usage by using
a cursor (Andrew Dunstan)
</para>
</listitem>
<listitem>
<para>
Dramatically reduce memory consumption
- in <xref linkend="pgupgrade"> (Bruce Momjian)
+ in <xref linkend="pgupgrade"/> (Bruce Momjian)
</para>
</listitem>
<listitem>
<para>
- Pass <xref linkend="pgupgrade">'s user name (<option>-U</option>) option to
+ Pass <xref linkend="pgupgrade"/>'s user name (<option>-U</option>) option to
generated analyze scripts (Bruce Momjian)
</para>
</listitem>
</itemizedlist>
<sect4>
- <title><xref linkend="pgbench"></title>
+ <title><xref linkend="pgbench"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="pgstatstatements"></title>
+ <title><xref linkend="pgstatstatements"/></title>
<itemizedlist>
<para>
This release contains a variety of fixes from 9.5.9.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.5.8,
- see <xref linkend="release-9-5-8">.
+ see <xref linkend="release-9-5-8"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.5.8.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.5.8,
- see <xref linkend="release-9-5-8">.
+ see <xref linkend="release-9-5-8"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.5.7.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.5.7,
- see <xref linkend="release-9-5-7">.
+ see <xref linkend="release-9-5-7"/>.
</para>
</sect2>
<listitem>
<para>
- Fix code for setting <xref linkend="guc-tcp-keepalives-idle"> on
+ Fix code for setting <xref linkend="guc-tcp-keepalives-idle"/> on
Solaris (Tom Lane)
</para>
</listitem>
<listitem>
<para>
Fix <application>pg_upgrade</application> to ensure that the ending WAL record
- does not have <xref linkend="guc-wal-level"> = <literal>minimum</literal>
+ does not have <xref linkend="guc-wal-level"/> = <literal>minimum</literal>
(Bruce Momjian)
</para>
<para>
This release contains a variety of fixes from 9.5.6.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.5.6,
- see <xref linkend="release-9-5-6">.
+ see <xref linkend="release-9-5-6"/>.
</para>
</sect2>
By itself, this patch will only fix the behavior in newly initdb'd
databases. If you wish to apply this change in an existing database,
follow the corrected procedure shown in the changelog entry for
- CVE-2017-7547, in <xref linkend="release-9-5-8">.
+ CVE-2017-7547, in <xref linkend="release-9-5-8"/>.
</para>
</listitem>
will use the current and historical DST transition dates of
the <literal>US/Eastern</literal> zone. If you don't want that, remove
the <filename>posixrules</filename> file, or replace it with a copy of some
- other zone file (see <xref linkend="datatype-timezones">). Note that
+ other zone file (see <xref linkend="datatype-timezones"/>). Note that
due to caching, you may need to restart the server to get such changes
to take effect.
</para>
<para>
This release contains a variety of fixes from 9.5.5.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.5.5,
- see <xref linkend="release-9-5-5">.
+ see <xref linkend="release-9-5-5"/>.
</para>
</sect2>
</para>
<para>
- Previously, this was skipped when <xref linkend="guc-wal-level">
+ Previously, this was skipped when <xref linkend="guc-wal-level"/>
= <literal>minimal</literal>, but actually it's necessary even in that case
to ensure that the unlogged table is properly reset to empty after a
crash.
<para>
Previously, non-default settings
- of <xref linkend="guc-default-tablespace"> could result in broken
+ of <xref linkend="guc-default-tablespace"/> could result in broken
indexes.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.5.4.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.5.2,
- see <xref linkend="release-9-5-2">.
+ see <xref linkend="release-9-5-2"/>.
</para>
</sect2>
<listitem>
<para>
Fix <command>EXPLAIN</command> to emit valid XML when
- <xref linkend="guc-track-io-timing"> is on (Markus Winand)
+ <xref linkend="guc-track-io-timing"/> is on (Markus Winand)
</para>
<para>
</para>
<para>
- With <xref linkend="guc-track-commit-timestamp"> turned on, old
+ With <xref linkend="guc-track-commit-timestamp"/> turned on, old
commit timestamps became inaccessible after a clean server restart.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.5.3.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.5.2,
- see <xref linkend="release-9-5-2">.
+ see <xref linkend="release-9-5-2"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.5.2.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.5.2,
- see <xref linkend="release-9-5-2">.
+ see <xref linkend="release-9-5-2"/>.
</para>
</sect2>
-->
<para>
Fix corner-case parser failures occurring
- when <xref linkend="guc-operator-precedence-warning"> is turned on
+ when <xref linkend="guc-operator-precedence-warning"/> is turned on
(Tom Lane)
</para>
<para>
This release contains a variety of fixes from 9.5.1.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<listitem>
<para>
- Ignore <xref linkend="recovery-min-apply-delay"> parameter until
+ Ignore <xref linkend="recovery-min-apply-delay"/> parameter until
recovery has reached a consistent state (Michael Paquier)
</para>
<para>
This release contains a variety of fixes from 9.5.0.
For information about new features in the 9.5 major release, see
- <xref linkend="release-9-5">.
+ <xref linkend="release-9-5"/>.
</para>
<sect2>
<title>Migration to Version 9.5</title>
<para>
- A dump/restore using <xref linkend="app-pg-dumpall">, or use
- of <xref linkend="pgupgrade">, is required for those wishing to migrate
+ A dump/restore using <xref linkend="app-pg-dumpall"/>, or use
+ of <xref linkend="pgupgrade"/>, is required for those wishing to migrate
data from any previous release.
</para>
before they had inconsistent precedence, behaving like <literal>NOT</literal>
with respect to their left operand but like their base operator with
respect to their right operand. The new configuration
- parameter <xref linkend="guc-operator-precedence-warning"> can be
+ parameter <xref linkend="guc-operator-precedence-warning"/> can be
enabled to warn about queries in which these precedence changes result
in different parsing choices.
</para>
2015-03-31 [0badb06] Bruce ..: pg_ctl: change default shutdown mode from 'sma..
-->
<para>
- Change <xref linkend="app-pg-ctl">'s default shutdown mode from
+ Change <xref linkend="app-pg-ctl"/>'s default shutdown mode from
<literal>smart</literal> to <literal>fast</literal> (Bruce Momjian)
</para>
-->
<para>
Replace configuration parameter <varname>checkpoint_segments</varname>
- with <xref linkend="guc-min-wal-size">
- and <xref linkend="guc-max-wal-size"> (Heikki Linnakangas)
+ with <xref linkend="guc-min-wal-size"/>
+ and <xref linkend="guc-max-wal-size"/> (Heikki Linnakangas)
</para>
<para>
Add GUC and storage parameter to set the maximum size of GIN pending list.
-->
<para>
- Add configuration parameter <xref linkend="guc-gin-pending-list-limit">
+ Add configuration parameter <xref linkend="guc-gin-pending-list-limit"/>
to control the size of <acronym>GIN</acronym> pending lists (Fujii Masao)
</para>
<para>
This value can also be set on a per-index basis as an index storage
parameter. Previously the pending-list size was controlled
- by <xref linkend="guc-work-mem">, which was awkward because
+ by <xref linkend="guc-work-mem"/>, which was awkward because
appropriate values for <varname>work_mem</varname> are often much too large
for this purpose.
</para>
2014-06-29 [51adcaa] Andres..: Add cluster_name GUC which is included in proce..
-->
<para>
- Add new configuration parameter <xref linkend="guc-cluster-name">
+ Add new configuration parameter <xref linkend="guc-cluster-name"/>
(Thomas Munro)
</para>
-->
<para>
Prevent non-superusers from changing <xref
- linkend="guc-log-disconnections"> on connection startup (Fujii Masao)
+ linkend="guc-log-disconnections"/> on connection startup (Fujii Masao)
</para>
</listitem>
-->
<para>
Replace configuration parameter <varname>checkpoint_segments</varname>
- with <xref linkend="guc-min-wal-size">
- and <xref linkend="guc-max-wal-size"> (Heikki Linnakangas)
+ with <xref linkend="guc-min-wal-size"/>
+ and <xref linkend="guc-max-wal-size"/> (Heikki Linnakangas)
</para>
<para>
<para>
Allow recording of transaction
commit time stamps when configuration parameter <xref
- linkend="guc-track-commit-timestamp">
+ linkend="guc-track-commit-timestamp"/>
is enabled (Álvaro Herrera, Petr Jelínek)
</para>
2014-12-22 [584e35d] Peter ..: Change local_preload_libraries to PGC_USERSET
-->
<para>
- Allow <xref linkend="guc-local-preload-libraries"> to be set
+ Allow <xref linkend="guc-local-preload-libraries"/> to be set
by <command>ALTER ROLE SET</command> (Peter Eisentraut, Kyotaro Horiguchi)
</para>
</listitem>
2014-06-20 [3bdcf6a] Andres..: Don't allow to disable backend assertions via t..
-->
<para>
- Make configuration parameter <xref linkend="guc-debug-assertions">
+ Make configuration parameter <xref linkend="guc-debug-assertions"/>
read-only (Andres Freund)
</para>
2014-10-18 [7feaccc] Peter ..: Allow setting effective_io_concurrency even on..
-->
<para>
- Allow setting <xref linkend="guc-effective-io-concurrency"> on
+ Allow setting <xref linkend="guc-effective-io-concurrency"/> on
systems where it has no effect (Peter Eisentraut)
</para>
</listitem>
2015-05-15 [ffd3774] Heikki..: Add archive_mode='always' option.
-->
<para>
- Add new <xref linkend="guc-archive-mode"> value
+ Add new <xref linkend="guc-archive-mode"/> value
<literal>always</literal> to allow standbys to always archive received
<acronym>WAL</acronym> files (Fujii Masao)
</para>
-->
<para>
Add configuration
- parameter <xref linkend="guc-wal-retrieve-retry-interval"> to
+ parameter <xref linkend="guc-wal-retrieve-retry-interval"/> to
control <acronym>WAL</acronym> read retry after failure
(Alexey Vasiliev, Michael Paquier)
</para>
<para>
This feature reduces WAL volume, at the cost of more CPU time spent
on WAL logging and WAL replay. It is controlled by a new
- configuration parameter <xref linkend="guc-wal-compression">, which
+ configuration parameter <xref linkend="guc-wal-compression"/>, which
currently is off by default.
</para>
</listitem>
-->
<para>
Add configuration parameter <xref
- linkend="guc-log-replication-commands">
+ linkend="guc-log-replication-commands"/>
to log replication commands (Fujii Masao)
</para>
<para>
By default, replication commands, e.g. <link
linkend="protocol-replication"><literal>IDENTIFY_SYSTEM</literal></link>,
- are not logged, even when <xref linkend="guc-log-statement"> is set
+ are not logged, even when <xref linkend="guc-log-statement"/> is set
to <literal>all</literal>.
</para>
</listitem>
</itemizedlist>
<sect4>
- <title><xref linkend="sql-reindex"></title>
+ <title><xref linkend="sql-reindex"/></title>
<itemizedlist>
<para>
This feature is now supported in
- <xref linkend="sql-alteruser">, <xref linkend="sql-altergroup">,
- <xref linkend="sql-alterrole">, <xref linkend="sql-grant">,
+ <xref linkend="sql-alteruser"/>, <xref linkend="sql-altergroup"/>,
+ <xref linkend="sql-alterrole"/>, <xref linkend="sql-grant"/>,
and <command>ALTER <replaceable>object</replaceable> OWNER TO</command> commands.
</para>
</listitem>
2014-07-10 [59efda3] Tom Lane: Implement IMPORT FOREIGN SCHEMA.
-->
<para>
- Add support for <xref linkend="sql-importforeignschema">
+ Add support for <xref linkend="sql-importforeignschema"/>
(Ronan Dunklau, Michael Paquier, Tom Lane)
</para>
</itemizedlist>
<sect4>
- <title><xref linkend="app-psql"></title>
+ <title><xref linkend="app-psql"/></title>
<itemizedlist>
-->
<para>
Add <application>psql</application> tab completion when setting the
- <xref linkend="guc-search-path"> variable (Jeff Janes)
+ <xref linkend="guc-search-path"/> variable (Jeff Janes)
</para>
<para>
</sect4>
<sect4>
- <title><xref linkend="app-pgdump"></title>
+ <title><xref linkend="app-pgdump"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="app-pg-ctl"></title>
+ <title><xref linkend="app-pg-ctl"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="pgupgrade"></title>
+ <title><xref linkend="pgupgrade"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="pgbench"></title>
+ <title><xref linkend="pgbench"/></title>
<itemizedlist>
<para>
This release contains a variety of fixes from 9.6.5.
For information about new features in the 9.6 major release, see
- <xref linkend="release-9-6">.
+ <xref linkend="release-9-6"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.6.4,
- see <xref linkend="release-9-6-4">.
+ see <xref linkend="release-9-6-4"/>.
</para>
</sect2>
<para>
This release contains a small number of fixes from 9.6.4.
For information about new features in the 9.6 major release, see
- <xref linkend="release-9-6">.
+ <xref linkend="release-9-6"/>.
</para>
<sect2>
<para>
However, if you are upgrading from a version earlier than 9.6.4,
- see <xref linkend="release-9-6-4">.
+ see <xref linkend="release-9-6-4"/>.
</para>
</sect2>
<para>
This release contains a variety of fixes from 9.6.3.
For information about new features in the 9.6 major release, see
- <xref linkend="release-9-6">.
+ <xref linkend="release-9-6"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.6.3,
- see <xref linkend="release-9-6-3">.
+ see <xref linkend="release-9-6-3"/>.
</para>
</sect2>
Branch: REL9_2_STABLE [5e7447132] 2017-06-28 12:30:16 -0400
-->
<para>
- Fix code for setting <xref linkend="guc-tcp-keepalives-idle"> on
+ Fix code for setting <xref linkend="guc-tcp-keepalives-idle"/> on
Solaris (Tom Lane)
</para>
</listitem>
-->
<para>
Fix <application>pg_upgrade</application> to ensure that the ending WAL record
- does not have <xref linkend="guc-wal-level"> = <literal>minimum</literal>
+ does not have <xref linkend="guc-wal-level"/> = <literal>minimum</literal>
(Bruce Momjian)
</para>
<para>
This release contains a variety of fixes from 9.6.2.
For information about new features in the 9.6 major release, see
- <xref linkend="release-9-6">.
+ <xref linkend="release-9-6"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.6.2,
- see <xref linkend="release-9-6-2">.
+ see <xref linkend="release-9-6-2"/>.
</para>
</sect2>
By itself, this patch will only fix the behavior in newly initdb'd
databases. If you wish to apply this change in an existing database,
follow the corrected procedure shown in the changelog entry for
- CVE-2017-7547, in <xref linkend="release-9-6-4">.
+ CVE-2017-7547, in <xref linkend="release-9-6-4"/>.
</para>
</listitem>
will use the current and historical DST transition dates of
the <literal>US/Eastern</literal> zone. If you don't want that, remove
the <filename>posixrules</filename> file, or replace it with a copy of some
- other zone file (see <xref linkend="datatype-timezones">). Note that
+ other zone file (see <xref linkend="datatype-timezones"/>). Note that
due to caching, you may need to restart the server to get such changes
to take effect.
</para>
<para>
This release contains a variety of fixes from 9.6.1.
For information about new features in the 9.6 major release, see
- <xref linkend="release-9-6">.
+ <xref linkend="release-9-6"/>.
</para>
<sect2>
<para>
Also, if you are upgrading from a version earlier than 9.6.1,
- see <xref linkend="release-9-6-1">.
+ see <xref linkend="release-9-6-1"/>.
</para>
</sect2>
</para>
<para>
- Previously, this was skipped when <xref linkend="guc-wal-level">
+ Previously, this was skipped when <xref linkend="guc-wal-level"/>
= <literal>minimal</literal>, but actually it's necessary even in that case
to ensure that the unlogged table is properly reset to empty after a
crash.
-->
<para>
Disallow setting the <replaceable>num_sync</replaceable> field to zero in
- <xref linkend="guc-synchronous-standby-names"> (Fujii Masao)
+ <xref linkend="guc-synchronous-standby-names"/> (Fujii Masao)
</para>
<para>
<para>
Previously, non-default settings
- of <xref linkend="guc-default-tablespace"> could result in broken
+ of <xref linkend="guc-default-tablespace"/> could result in broken
indexes.
</para>
</listitem>
<para>
This release contains a variety of fixes from 9.6.0.
For information about new features in the 9.6 major release, see
- <xref linkend="release-9-6">.
+ <xref linkend="release-9-6"/>.
</para>
<sect2>
-->
<para>
Fix <command>EXPLAIN</command> to emit valid XML when
- <xref linkend="guc-track-io-timing"> is on (Markus Winand)
+ <xref linkend="guc-track-io-timing"/> is on (Markus Winand)
</para>
<para>
</para>
<para>
- With <xref linkend="guc-track-commit-timestamp"> turned on, old
+ With <xref linkend="guc-track-commit-timestamp"/> turned on, old
commit timestamps became inaccessible after a clean server restart.
</para>
</listitem>
<title>Migration to Version 9.6</title>
<para>
- A dump/restore using <xref linkend="app-pg-dumpall">, or use of <xref
- linkend="pgupgrade">, is required for those wishing to migrate data
+ A dump/restore using <xref linkend="app-pg-dumpall"/>, or use of <xref
+ linkend="pgupgrade"/>, is required for those wishing to migrate data
from any previous release.
</para>
<para>
Parallel query execution is not (yet) enabled by default.
To allow it, set the new configuration
- parameter <xref linkend="guc-max-parallel-workers-per-gather"> to a
+ parameter <xref linkend="guc-max-parallel-workers-per-gather"/> to a
value larger than zero. Additional control over use of parallelism
is available through other new configuration parameters
- <xref linkend="guc-force-parallel-mode">,
- <xref linkend="guc-parallel-setup-cost">, <xref
- linkend="guc-parallel-tuple-cost">, and
+ <xref linkend="guc-force-parallel-mode"/>,
+ <xref linkend="guc-parallel-setup-cost"/>, <xref
+ linkend="guc-parallel-tuple-cost"/>, and
<literal>min_parallel_relation_size</literal>.
</para>
</listitem>
-->
<para>
Allow <link linkend="gin"><acronym>GIN</acronym></link> index builds to
- make effective use of <xref linkend="guc-maintenance-work-mem">
+ make effective use of <xref linkend="guc-maintenance-work-mem"/>
settings larger than 1 GB (Robert Abraham, Teodor Sigaev)
</para>
</listitem>
time can thus cause considerable table bloat because
space cannot be recycled. This feature allows setting
a time-based limit, via the new configuration parameter
- <xref linkend="guc-old-snapshot-threshold">, on how long an
+ <xref linkend="guc-old-snapshot-threshold"/>, on how long an
<acronym>MVCC</acronym> snapshot is guaranteed to be valid. After that,
dead tuples are candidates for removal. A transaction using an
outdated snapshot will get an error if it attempts to read a page
<para>
The new configuration parameters <xref
- linkend="guc-backend-flush-after">, <xref
- linkend="guc-bgwriter-flush-after">, <xref
- linkend="guc-checkpoint-flush-after">, and <xref
- linkend="guc-wal-writer-flush-after"> control this behavior.
+ linkend="guc-backend-flush-after"/>, <xref
+ linkend="guc-bgwriter-flush-after"/>, <xref
+ linkend="guc-checkpoint-flush-after"/>, and <xref
+ linkend="guc-wal-writer-flush-after"/> control this behavior.
</para>
</listitem>
2016-08-17 [9b33c7e80] Disable update_process_title by default on Windows
-->
<para>
- Disable <xref linkend="guc-update-process-title"> by default on
+ Disable <xref linkend="guc-update-process-title"/> by default on
Windows (Takayuki Tsunakawa)
</para>
<para>
This behavior is controlled by the new configuration parameter
- <xref linkend="guc-idle-in-transaction-session-timeout">. It can
+ <xref linkend="guc-idle-in-transaction-session-timeout"/>. It can
be useful to prevent forgotten transactions from holding locks
or preventing vacuum cleanup for too long.
</para>
-->
<para>
Raise the maximum allowed value
- of <xref linkend="guc-checkpoint-timeout"> to 24 hours (Simon Riggs)
+ of <xref linkend="guc-checkpoint-timeout"/> to 24 hours (Simon Riggs)
</para>
</listitem>
2015-09-07 [b1e1862a1] Coordinate log_line_prefix options 'm' and 'n' to share
-->
<para>
- Add <xref linkend="guc-log-line-prefix"> option <literal>%n</literal> to
+ Add <xref linkend="guc-log-line-prefix"/> option <literal>%n</literal> to
print the current time in Unix epoch form, with milliseconds (Tomas
Vondra, Jeff Davis)
</para>
2016-03-16 [fc201dfd9] Add syslog_split_messages parameter
-->
<para>
- Add <xref linkend="guc-syslog-sequence-numbers"> and <xref
- linkend="guc-syslog-split-messages"> configuration parameters
+ Add <xref linkend="guc-syslog-sequence-numbers"/> and <xref
+ linkend="guc-syslog-split-messages"/> configuration parameters
to provide more control over the message format when logging to
<systemitem>syslog</systemitem> (Peter Eisentraut)
</para>
-->
<para>
Merge the <literal>archive</literal> and <literal>hot_standby</literal> values
- of the <xref linkend="guc-wal-level"> configuration parameter
+ of the <xref linkend="guc-wal-level"/> configuration parameter
into a single new value <literal>replica</literal> (Peter Eisentraut)
</para>
<para>
The number of standby servers that must acknowledge a commit
before it is considered complete is now configurable as part of
- the <xref linkend="guc-synchronous-standby-names"> parameter.
+ the <xref linkend="guc-synchronous-standby-names"/> parameter.
</para>
</listitem>
-->
<para>
Add new setting <literal>remote_apply</literal> for configuration
- parameter <xref linkend="guc-synchronous-commit"> (Thomas Munro)
+ parameter <xref linkend="guc-synchronous-commit"/> (Thomas Munro)
</para>
<para>
</itemizedlist>
<sect4>
- <title><xref linkend="app-psql"></title>
+ <title><xref linkend="app-psql"/></title>
<itemizedlist>
</sect4>
<sect4>
- <title><xref linkend="pgbench"></title>
+ <title><xref linkend="pgbench"/></title>
<itemizedlist>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
<para>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.13,
- see <xref linkend="release-7-3-13">.
+ see <xref linkend="release-7-3-13"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.10,
- see <xref linkend="release-7-3-10">.
+ see <xref linkend="release-7-3-10"/>.
Also, you might need to <command>REINDEX</command> indexes on textual
columns after updating, if you are affected by the locale or
<application>plperl</application> issues described below.
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.10,
- see <xref linkend="release-7-3-10">.
+ see <xref linkend="release-7-3-10"/>.
</para>
</sect2>
<para>
A dump/restore is not required for those running 7.3.X. However,
if you are upgrading from a version earlier than 7.3.10,
- see <xref linkend="release-7-3-10">.
+ see <xref linkend="release-7-3-10"/>.
</para>
</sect2>
replication and inefficiencies. Replication origins provide an optional
mechanism to recognize and prevent that. When configured using the functions
referenced in the previous paragraph, every change and transaction passed to
- output plugin callbacks (see <xref linkend="logicaldecoding-output-plugin">)
+ output plugin callbacks (see <xref linkend="logicaldecoding-output-plugin"/>)
generated by the session is tagged with the replication origin of the
generating session. This allows treating them differently in the output
plugin, e.g. ignoring all but locally-originating rows. Additionally
<para>
(These constants are actually only a special case of
the generic type constants discussed in <xref
- linkend="sql-syntax-constants-generic">. The constant is initially
+ linkend="sql-syntax-constants-generic"/>. The constant is initially
treated as a string and passed to the composite-type input conversion
routine. An explicit type specification might be necessary to tell
which type to convert the constant to.)
('', 42, NULL)
</programlisting>
The <literal>ROW</literal> expression syntax is discussed in more detail in <xref
- linkend="sql-syntax-row-constructors">.
+ linkend="sql-syntax-row-constructors"/>.
</para>
</sect2>
<para>
The special field name <literal>*</literal> means <quote>all fields</quote>, as
- further explained in <xref linkend="rowtypes-usage">.
+ further explained in <xref linkend="rowtypes-usage"/>.
</para>
</sect2>
</programlisting>
All of these <literal>ORDER BY</literal> clauses specify the row's composite
value, resulting in sorting the rows according to the rules described
- in <xref linkend="composite-type-comparison">. However,
+ in <xref linkend="composite-type-comparison"/>. However,
if <structname>inventory_item</structname> contained a column
named <structfield>c</structfield>, the first case would be different from the
others, as it would mean to sort by that column only. Given the column
with a data type whose input routine also treated backslashes specially,
<type>bytea</type> for example, we might need as many as eight backslashes
in the command to get one backslash into the stored composite field.)
- Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting">) can be
+ Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting"/>) can be
used to avoid the need to double backslashes.
</para>
</note>
execution. It is very powerful, and can be used for many things
such as query language procedures, views, and versions. The
theoretical foundations and the power of this rule system are
- also discussed in <xref linkend="ston90b"> and <xref
- linkend="ong90">.
+ also discussed in <xref linkend="ston90b"/> and <xref
+ linkend="ong90"/>.
</para>
<sect1 id="querytree">
to allow the executor to find the row to be deleted.
(<acronym>CTID</acronym> is added when the result relation is an ordinary
table. If it is a view, a whole-row variable is added instead,
- as described in <xref linkend="rules-views-update">.)
+ as described in <xref linkend="rules-views-update"/>.)
</para>
<para>
the base relation in the appropriate way. Views that are
<quote>simple enough</quote> for this are called <firstterm>automatically
updatable</firstterm>. For detailed information on the kinds of view that can
- be automatically updated, see <xref linkend="sql-createview">.
+ be automatically updated, see <xref linkend="sql-createview"/>.
</para>
<para>
<command>UPDATE</command>, and <command>DELETE</command> commands on
a view. These rules will rewrite the command, typically into a command
that updates one or more tables, rather than views. That is the topic
- of <xref linkend="rules-update">.
+ of <xref linkend="rules-update"/>.
</para>
<para>
during initialization is called
<literal>template1</literal>. As the name suggests, this will be used
as a template for subsequently created databases; it should not be
- used for actual work. (See <xref linkend="managing-databases"> for
+ used for actual work. (See <xref linkend="managing-databases"/> for
information about creating new databases within a cluster.)
</para>
<filename>/usr/local/pgsql/data</filename> or
<filename>/var/lib/pgsql/data</filename> are popular. To initialize a
database cluster, use the command <xref
- linkend="app-initdb">,<indexterm><primary>initdb</primary></indexterm> which is
+ linkend="app-initdb"/>,<indexterm><primary>initdb</primary></indexterm> which is
installed with <productname>PostgreSQL</productname>. The desired
file system location of your database cluster is indicated by the
<option>-D</option> option, for example:
<para>
Alternatively, you can run <command>initdb</command> via
- the <xref linkend="app-pg-ctl">
+ the <xref linkend="app-pg-ctl"/>
program<indexterm><primary>pg_ctl</primary></indexterm> like so:
<screen>
<prompt>$</prompt> <userinput>pg_ctl -D /usr/local/pgsql/data initdb</userinput>
</screen>
This may be more intuitive if you are
using <command>pg_ctl</command> for starting and stopping the
- server (see <xref linkend="server-start">), so
+ server (see <xref linkend="server-start"/>), so
that <command>pg_ctl</command> would be the sole command you use
for managing the database server instance.
</para>
<emphasis>before</emphasis> you start the server for the first time. (Other
reasonable approaches include using <literal>peer</literal> authentication
or file system permissions to restrict connections. See <xref
- linkend="client-authentication"> for more information.)
+ linkend="client-authentication"/> for more information.)
</para>
<para>
Normally, it will just take the locale settings in the environment
and apply them to the initialized database. It is possible to
specify a different locale for the database; more information about
- that can be found in <xref linkend="locale">. The default sort order used
+ that can be found in <xref linkend="locale"/>. The default sort order used
within the particular database cluster is set by
<command>initdb</command>, and while you can create new databases using
different sort order, the order used in the template databases that initdb
<para>
<command>initdb</command> also sets the default character set encoding
for the database cluster. Normally this should be chosen to match the
- locale setting. For details see <xref linkend="multibyte">.
+ locale setting. For details see <xref linkend="multibyte"/>.
</para>
<para>
It is important to store the server's <systemitem>stdout</systemitem> and
<systemitem>stderr</systemitem> output somewhere, as shown above. It will help
for auditing purposes and to diagnose problems. (See <xref
- linkend="logfile-maintenance"> for a more thorough discussion of log
+ linkend="logfile-maintenance"/> for a more thorough discussion of log
file handling.)
</para>
<para>
The <command>postgres</command> program also takes a number of other
command-line options. For more information, see the
- <xref linkend="app-postgres"> reference page
- and <xref linkend="runtime-config"> below.
+ <xref linkend="app-postgres"/> reference page
+ and <xref linkend="runtime-config"/> below.
</para>
<para>
This shell syntax can get tedious quickly. Therefore the wrapper
program
- <xref linkend="app-pg-ctl"><indexterm><primary>pg_ctl</primary></indexterm>
+ <xref linkend="app-pg-ctl"/><indexterm><primary>pg_ctl</primary></indexterm>
is provided to simplify some tasks. For example:
<programlisting>
pg_ctl start -l logfile
mean that you do not have System-V-style shared memory support
configured into your kernel at all. As a temporary workaround, you
can try starting the server with a smaller-than-normal number of
- buffers (<xref linkend="guc-shared-buffers">). You will eventually want
+ buffers (<xref linkend="guc-shared-buffers"/>). You will eventually want
to reconfigure your kernel to increase the allowed shared memory
size. You might also see this message when trying to start multiple
servers on the same machine, if their total space requested
<productname>PostgreSQL</productname> wants to create. As above,
you might be able to work around the problem by starting the
server with a reduced number of allowed connections
- (<xref linkend="guc-max-connections">), but you'll eventually want to
+ (<xref linkend="guc-max-connections"/>), but you'll eventually want to
increase the kernel limit.
</para>
<para>
Details about configuring <systemitem class="osname">System V</systemitem>
- <acronym>IPC</acronym> facilities are given in <xref linkend="sysvipc">.
+ <acronym>IPC</acronym> facilities are given in <xref linkend="sysvipc"/>.
</para>
</sect2>
does <emphasis>not</emphasis> mean that the server got your
connection request and rejected it. That case will produce a
different message, as shown in <xref
- linkend="client-authentication-problems">.) Other error messages
+ linkend="client-authentication-problems"/>.) Other error messages
such as <computeroutput>Connection timed out</computeroutput> might
indicate more fundamental problems, like lack of network
connectivity.
the server will refuse to start and
should leave an instructive error message describing the problem
and what to do about it. (See also <xref
- linkend="server-start-failures">.) The relevant kernel
+ linkend="server-start-failures"/>.) The relevant kernel
parameters are named consistently across different systems; <xref
- linkend="sysvipc-parameters"> gives an overview. The methods to set
+ linkend="sysvipc-parameters"/> gives an overview. The methods to set
them, however, vary. Suggestions for some platforms are given below.
</para>
<para>
When using System V semaphores,
<productname>PostgreSQL</productname> uses one semaphore per allowed connection
- (<xref linkend="guc-max-connections">), allowed autovacuum worker process
- (<xref linkend="guc-autovacuum-max-workers">) and allowed background
- process (<xref linkend="guc-max-worker-processes">), in sets of 16.
+ (<xref linkend="guc-max-connections"/>), allowed autovacuum worker process
+ (<xref linkend="guc-autovacuum-max-workers"/>) and allowed background
+ process (<xref linkend="guc-max-worker-processes"/>), in sets of 16.
Each such set will
also contain a 17th semaphore which contains a <quote>magic
number</quote>, to detect collision with semaphore sets used by
<varname>autovacuum_max_workers</varname> plus <varname>max_worker_processes</varname>,
plus one extra for each 16
allowed connections plus workers (see the formula in <xref
- linkend="sysvipc-parameters">). The parameter <varname>SEMMNI</varname>
+ linkend="sysvipc-parameters"/>). The parameter <varname>SEMMNI</varname>
determines the limit on the number of semaphore sets that can
exist on the system at one time. Hence this parameter must be at
least <literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 16)</literal>.
<para>
When using POSIX semaphores, the number of semaphores needed is the
same as for System V, that is one semaphore per allowed connection
- (<xref linkend="guc-max-connections">), allowed autovacuum worker process
- (<xref linkend="guc-autovacuum-max-workers">) and allowed background
- process (<xref linkend="guc-max-worker-processes">).
+ (<xref linkend="guc-max-connections"/>), allowed autovacuum worker process
+ (<xref linkend="guc-autovacuum-max-workers"/>) and allowed background
+ process (<xref linkend="guc-max-worker-processes"/>).
On the platforms where this option is preferred, there is no specific
kernel limit on the number of POSIX semaphores.
</para>
processes do so then the system-wide limit can easily be exceeded.
If you find this happening, and you do not want to alter the
system-wide limit, you can set <productname>PostgreSQL</productname>'s <xref
- linkend="guc-max-files-per-process"> configuration parameter to
+ linkend="guc-max-files-per-process"/> configuration parameter to
limit the consumption of open files.
</para>
</sect2>
<para>
Using huge pages reduces overhead when using large contiguous chunks of
memory, as <productname>PostgreSQL</productname> does, particularly when
- using large values of <xref linkend="guc-shared-buffers">. To use this
+ using large values of <xref linkend="guc-shared-buffers"/>. To use this
feature in <productname>PostgreSQL</productname> you need a kernel
with <varname>CONFIG_HUGETLBFS=y</varname> and
<varname>CONFIG_HUGETLB_PAGE=y</varname>. You will also have to adjust
The default behavior for huge pages in
<productname>PostgreSQL</productname> is to use them when possible and
to fall back to normal pages when failing. To enforce the use of huge
- pages, you can set <xref linkend="guc-huge-pages">
+ pages, you can set <xref linkend="guc-huge-pages"/>
to <literal>on</literal> in <filename>postgresql.conf</filename>.
Note that with this setting <productname>PostgreSQL</productname> will fail to
start if not enough huge pages are available.
</para>
<para>
- The <xref linkend="app-pg-ctl"> program provides a convenient
+ The <xref linkend="app-pg-ctl"/> program provides a convenient
interface for sending these signals to shut down the server.
Alternatively, you can send the signal directly using <command>kill</command>
on non-Windows systems.
<para>
To terminate an individual session while allowing other sessions to
continue, use <function>pg_terminate_backend()</function> (see <xref
- linkend="functions-admin-signal-table">) or send a
+ linkend="functions-admin-signal-table"/>) or send a
<systemitem>SIGTERM</systemitem> signal to the child process associated with
the session.
</para>
internal data storage format is subject to change, thus complicating
upgrades. The traditional method for moving data to a new major version
is to dump and reload the database, though this can be slow. A
- faster method is <xref linkend="pgupgrade">. Replication methods are
+ faster method is <xref linkend="pgupgrade"/>. Replication methods are
also available, as discussed below.
</para>
New major versions also typically introduce some user-visible
incompatibilities, so application programming changes might be required.
All user-visible changes are listed in the release notes (<xref
- linkend="release">); pay particular attention to the section
+ linkend="release"/>); pay particular attention to the section
labeled "Migration". If you are upgrading across several major
versions, be sure to read the release notes for each intervening
version.
data would of course not be included. If necessary, edit the
permissions in the file <filename>/usr/local/pgsql/data/pg_hba.conf</filename>
(or equivalent) to disallow access from everyone except you.
- See <xref linkend="client-authentication"> for additional information on
+ See <xref linkend="client-authentication"/> for additional information on
access control.
</para>
<para>
To make the backup, you can use the <application>pg_dumpall</application>
command from the version you are currently running; see <xref
- linkend="backup-dump-all"> for more details. For best
+ linkend="backup-dump-all"/> for more details. For best
results, however, try to use the <application>pg_dumpall</application>
command from <productname>PostgreSQL</productname> &version;,
since this version contains bug fixes and improvements over older
<screen>
<userinput>/etc/rc.d/init.d/postgresql stop</userinput>
</screen>
- See <xref linkend="runtime"> for details about starting and
+ See <xref linkend="runtime"/> for details about starting and
stopping the server.
</para>
</step>
<step>
<para>
Install the new version of <productname>PostgreSQL</productname> as
- outlined in <xref linkend="install-procedure">.
+ outlined in <xref linkend="install-procedure"/>.
</para>
</step>
<title>Upgrading Data via <application>pg_upgrade</application></title>
<para>
- The <xref linkend="pgupgrade"> module allows an installation to
+ The <xref linkend="pgupgrade"/> module allows an installation to
be migrated in-place from one major <productname>PostgreSQL</productname>
version to another. Upgrades can be performed in minutes,
particularly with <option>--link</option> mode. It requires steps similar to
<para>
One way to prevent spoofing of <literal>local</literal>
connections is to use a Unix domain socket directory (<xref
- linkend="guc-unix-socket-directories">) that has write permission only
+ linkend="guc-unix-socket-directories"/>) that has write permission only
for a trusted local user. This prevents a malicious user from creating
their own socket file in that directory. If you are concerned that
some applications might still reference <filename>/tmp</filename> for the
SSL certificates and make sure that clients check the server's certificate.
To do that, the server
must be configured to accept only <literal>hostssl</literal> connections (<xref
- linkend="auth-pg-hba-conf">) and have SSL key and certificate files
- (<xref linkend="ssl-tcp">). The TCP client must connect using
+ linkend="auth-pg-hba-conf"/>) and have SSL key and certificate files
+ (<xref linkend="ssl-tcp"/>). The TCP client must connect using
<literal>sslmode=verify-ca</literal> or
<literal>verify-full</literal> and have the appropriate root certificate
- file installed (<xref linkend="libq-ssl-certificates">).
+ file installed (<xref linkend="libq-ssl-certificates"/>).
</para>
</sect1>
<listitem>
<para>
- The <xref linkend="pgcrypto"> module allows certain fields to be
+ The <xref linkend="pgcrypto"/> module allows certain fields to be
stored encrypted.
This is useful if only some of the data is sensitive.
The client supplies the decryption key and the data is decrypted
for increased security. This requires that
<productname>OpenSSL</productname> is installed on both client and
server systems and that support in <productname>PostgreSQL</productname> is
- enabled at build time (see <xref linkend="installation">).
+ enabled at build time (see <xref linkend="installation"/>).
</para>
<para>
With <acronym>SSL</acronym> support compiled in, the
<productname>PostgreSQL</productname> server can be started with
<acronym>SSL</acronym> enabled by setting the parameter
- <xref linkend="guc-ssl"> to <literal>on</literal> in
+ <xref linkend="guc-ssl"/> to <literal>on</literal> in
<filename>postgresql.conf</filename>. The server will listen for both normal
and <acronym>SSL</acronym> connections on the same TCP port, and will negotiate
with any connecting client on whether to use <acronym>SSL</acronym>. By
default, this is at the client's option; see <xref
- linkend="auth-pg-hba-conf"> about how to set up the server to require
+ linkend="auth-pg-hba-conf"/> about how to set up the server to require
use of <acronym>SSL</acronym> for some or all connections.
</para>
and authentication algorithms, of varying strength. While a list of
ciphers can be specified in the <productname>OpenSSL</productname>
configuration file, you can specify ciphers specifically for use by
- the database server by modifying <xref linkend="guc-ssl-ciphers"> in
+ the database server by modifying <xref linkend="guc-ssl-ciphers"/> in
<filename>postgresql.conf</filename>.
</para>
and private key must exist. By default, these files are expected to be
named <filename>server.crt</filename> and <filename>server.key</filename>, respectively, in
the server's data directory, but other names and locations can be specified
- using the configuration parameters <xref linkend="guc-ssl-cert-file">
- and <xref linkend="guc-ssl-key-file">.
+ using the configuration parameters <xref linkend="guc-ssl-cert-file"/>
+ and <xref linkend="guc-ssl-key-file"/>.
</para>
<para>
To require the client to supply a trusted certificate, place
certificates of the certificate authorities (<acronym>CA</acronym>s)
you trust in a file named <filename>root.crt</filename> in the data
- directory, set the parameter <xref linkend="guc-ssl-ca-file"> in
+ directory, set the parameter <xref linkend="guc-ssl-ca-file"/> in
<filename>postgresql.conf</filename> to <literal>root.crt</literal>,
and add the authentication option <literal>clientcert=1</literal> to the
appropriate <literal>hostssl</literal> line(s) in <filename>pg_hba.conf</filename>.
A certificate will then be requested from the client during
- SSL connection startup. (See <xref linkend="libpq-ssl"> for a
+ SSL connection startup. (See <xref linkend="libpq-ssl"/> for a
description of how to set up certificates on the client.) The server will
verify that the client's certificate is signed by one of the trusted
certificate authorities.
<filename>root.crt</filename>, the file must also contain certificate
chains to their root <acronym>CA</acronym>s. Certificate Revocation List
(CRL) entries
- are also checked if the parameter <xref linkend="guc-ssl-crl-file"> is set.
+ are also checked if the parameter <xref linkend="guc-ssl-crl-file"/> is set.
<!-- If this URL changes replace it with a URL to www.archive.org. -->
(See <ulink
url="http://h71000.www7.hp.com/doc/83final/ba554_90007/ch04s02.html"></ulink>
If you are setting up client certificates, you may wish to use
the <literal>cert</literal> authentication method, so that the certificates
control user authentication as well as providing connection security.
- See <xref linkend="auth-cert"> for details. (It is not necessary to
+ See <xref linkend="auth-cert"/> for details. (It is not necessary to
specify <literal>clientcert=1</literal> explicitly when using
the <literal>cert</literal> authentication method.)
</para>
<title>SSL Server File Usage</title>
<para>
- <xref linkend="ssl-file-usage"> summarizes the files that are
+ <xref linkend="ssl-file-usage"/> summarizes the files that are
relevant to the SSL setup on the server. (The shown file names are default
names. The locally configured names could be different.)
</para>
<tbody>
<row>
- <entry><xref linkend="guc-ssl-cert-file"> (<filename>$PGDATA/server.crt</filename>)</entry>
+ <entry><xref linkend="guc-ssl-cert-file"/> (<filename>$PGDATA/server.crt</filename>)</entry>
<entry>server certificate</entry>
<entry>sent to client to indicate server's identity</entry>
</row>
<row>
- <entry><xref linkend="guc-ssl-key-file"> (<filename>$PGDATA/server.key</filename>)</entry>
+ <entry><xref linkend="guc-ssl-key-file"/> (<filename>$PGDATA/server.key</filename>)</entry>
<entry>server private key</entry>
<entry>proves server certificate was sent by the owner; does not indicate
certificate owner is trustworthy</entry>
</row>
<row>
- <entry><xref linkend="guc-ssl-ca-file"></entry>
+ <entry><xref linkend="guc-ssl-ca-file"/></entry>
<entry>trusted certificate authorities</entry>
<entry>checks that client certificate is
signed by a trusted certificate authority</entry>
</row>
<row>
- <entry><xref linkend="guc-ssl-crl-file"></entry>
+ <entry><xref linkend="guc-ssl-crl-file"/></entry>
<entry>certificates revoked by certificate authorities</entry>
<entry>client certificate must not be on this list</entry>
</row>
<para>
To specify a different event source name (see
- <xref linkend="guc-event-source">), use the <literal>/n</literal>
+ <xref linkend="guc-event-source"/>), use the <literal>/n</literal>
and <literal>/i</literal> options:
<screen>
<userinput>regsvr32 /n /i:<replaceable>event_source_name</replaceable> <replaceable>pgsql_library_directory</replaceable>/pgevent.dll</userinput>
<note>
<para>
To enable event logging in the database server, modify
- <xref linkend="guc-log-destination"> to include
+ <xref linkend="guc-log-destination"/> to include
<literal>eventlog</literal> in <filename>postgresql.conf</filename>.
</para>
</note>
Optional certainty indicators (<literal><</literal>,
<literal>></literal> or <literal>~</literal>) can be stored as well.
(Certainty indicators are ignored by all the built-in operators, however.)
- <xref linkend="seg-repr-table"> gives an overview of allowed
- representations; <xref linkend="seg-input-examples"> shows some
+ <xref linkend="seg-repr-table"/> gives an overview of allowed
+ representations; <xref linkend="seg-input-examples"/> shows some
examples.
</para>
<para>
- In <xref linkend="seg-repr-table">, <replaceable>x</replaceable>, <replaceable>y</replaceable>, and
+ In <xref linkend="seg-repr-table"/>, <replaceable>x</replaceable>, <replaceable>y</replaceable>, and
<replaceable>delta</replaceable> denote
floating-point numbers. <replaceable>x</replaceable> and <replaceable>y</replaceable>, but
not <replaceable>delta</replaceable>, can be preceded by a certainty indicator.
<para>
The <filename>seg</filename> module includes a GiST index operator class for
<type>seg</type> values.
- The operators supported by the GiST operator class are shown in <xref linkend="seg-gist-operators">.
+ The operators supported by the GiST operator class are shown in <xref linkend="seg-gist-operators"/>.
</para>
<table id="seg-gist-operators">
<para>
The current implementation has significant limitations, and does not
enforce mandatory access control for all actions. See
- <xref linkend="sepgsql-limitations">.
+ <xref linkend="sepgsql-limitations"/>.
</para>
</warning>
</para>
<para>
- The <xref linkend="sql-security-label"> statement allows assignment of
+ The <xref linkend="sql-security-label"/> statement allows assignment of
a security label to a database object.
</para>
<para>
To use this module, you must include <literal>sepgsql</literal>
- in the <xref linkend="guc-shared-preload-libraries"> parameter in
+ in the <xref linkend="guc-shared-preload-libraries"/> parameter in
<filename>postgresql.conf</filename>. The module will not function correctly
if loaded in any other manner. Once the module is loaded, you
should execute <filename>sepgsql.sql</filename> in each database.
<para>
First, set up <filename>sepgsql</filename> in a working database
- according to the instructions in <xref linkend="sepgsql-installation">.
+ according to the instructions in <xref linkend="sepgsql-installation"/>.
Note that the current operating system user must be able to connect to the
database as superuser without password authentication.
</para>
</screen>
<para>
- See <xref linkend="sepgsql-resources"> for details on adjusting your
+ See <xref linkend="sepgsql-resources"/> for details on adjusting your
working domain, if necessary.
</para>
<itemizedlist>
<listitem>
<para>
- <xref linkend="sql-createdatabase"> additionally requires
+ <xref linkend="sql-createdatabase"/> additionally requires
<literal>getattr</literal> permission for the source or template database.
</para>
</listitem>
</listitem>
<listitem>
<para>
- Using <xref linkend="sql-security-label"> on an object additionally
+ Using <xref linkend="sql-security-label"/> on an object additionally
requires <literal>relabelfrom</literal> permission for the object in
conjunction with its old security label and <literal>relabelto</literal>
permission for the object in conjunction with its new security label.
<sect3>
<title>Miscellaneous</title>
<para>
- We reject the <xref linkend="sql-load"> command across the board, because
+ We reject the <xref linkend="sql-load"/> command across the board, because
any module loaded could easily circumvent security policy enforcement.
</para>
<sect2 id="sepgsql-functions">
<title>Sepgsql Functions</title>
<para>
- <xref linkend="sepgsql-functions-table"> shows the available functions.
+ <xref linkend="sepgsql-functions-table"/> shows the available functions.
</para>
<table id="sepgsql-functions-table">
<application>flex</application>, and <application>Perl</application>. These tools are not needed
to build from a distribution tarball, because the files that these tools
are used to build are included in the tarball. Other tool requirements
- are the same as shown in <xref linkend="install-requirements">.
+ are the same as shown in <xref linkend="install-requirements"/>.
</para>
<sect1 id="git">
<replaceable>n</replaceable> is the integer value that determines which plural
form is needed, and the remaining arguments are formatted according
to the selected format string. For more information see
- <xref linkend="nls-guidelines">.
+ <xref linkend="nls-guidelines"/>.
</para>
</listitem>
<listitem>
<function>errdetail_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n, ...)</function> is like <function>errdetail</function>, but with
support for various plural forms of the message.
- For more information see <xref linkend="nls-guidelines">.
+ For more information see <xref linkend="nls-guidelines"/>.
</para>
</listitem>
<listitem>
*fmt_plural, unsigned long n, ...)</function> is like
<function>errdetail_log</function>, but with support for various plural forms of
the message.
- For more information see <xref linkend="nls-guidelines">.
+ For more information see <xref linkend="nls-guidelines"/>.
</para>
</listitem>
<listitem>
<para>
Advice about writing good error messages can be found in
- <xref linkend="error-style-guide">.
+ <xref linkend="error-style-guide"/>.
</para>
</sect1>
<para>
Keep in mind that error message texts need to be translated into other
- languages. Follow the guidelines in <xref linkend="nls-guidelines">
+ languages. Follow the guidelines in <xref linkend="nls-guidelines"/>
to avoid making life difficult for translators.
</para>
</simplesect>
<para>
The core <productname>PostgreSQL</productname> distribution
includes the <acronym>SP-GiST</acronym> operator classes shown in
- <xref linkend="spgist-builtin-opclasses-table">.
+ <xref linkend="spgist-builtin-opclasses-table"/>.
</para>
<table id="spgist-builtin-opclasses-table">
in a radix tree the node label could be the next character of the string
value. (Alternatively, an operator class can omit the node labels, if it
works with a fixed set of nodes for all inner tuples;
- see <xref linkend="spgist-null-labels">.)
+ see <xref linkend="spgist-null-labels"/>.)
Optionally, an inner tuple can have a <firstterm>prefix</firstterm> value
that describes all its members. In a radix tree this could be the common
prefix of the represented strings. The prefix value is not necessarily
<structfield>longValuesOK</structfield> should be set true only when the
<structfield>attType</structfield> is of variable length and the operator
class is capable of segmenting long values by repeated suffixing
- (see <xref linkend="spgist-limits">).
+ (see <xref linkend="spgist-limits"/>).
</para>
</listitem>
</varlistentry>
zero for the root level.
<structfield>allTheSame</structfield> is true if the current inner tuple is
marked as containing multiple equivalent nodes
- (see <xref linkend="spgist-all-the-same">).
+ (see <xref linkend="spgist-all-the-same"/>).
<structfield>hasPrefix</structfield> is true if the current inner tuple contains
a prefix; if so,
<structfield>prefixDatum</structfield> is its value.
<literal>allTheSame</literal> to signify that this has happened. The
<function>choose</function> and <function>inner_consistent</function> functions
must take suitable care with such inner tuples.
- See <xref linkend="spgist-all-the-same"> for more information.
+ See <xref linkend="spgist-all-the-same"/> for more information.
</para>
<para>
value has been supplied. In this case the point of the operation is
to strip off a prefix and produce a new, shorter leaf datum value.
The call will be repeated until a leaf datum short enough to fit on
- a page has been produced. See <xref linkend="spgist-limits"> for
+ a page has been produced. See <xref linkend="spgist-limits"/> for
more information.
</para>
</listitem>
<structfield>allTheSame</structfield> is true if the current inner tuple is
marked <quote>all-the-same</quote>; in this case all the nodes have the
same label (if any) and so either all or none of them match the query
- (see <xref linkend="spgist-all-the-same">).
+ (see <xref linkend="spgist-all-the-same"/>).
<structfield>hasPrefix</structfield> is true if the current inner tuple contains
a prefix; if so,
<structfield>prefixDatum</structfield> is its value.
tuple <emphasis>must</emphasis> divide the set of leaf values into more than one
node group. If the operator class's <function>picksplit</function> function
fails to do that, the <acronym>SP-GiST</acronym> core resorts to
- extraordinary measures described in <xref linkend="spgist-all-the-same">.
+ extraordinary measures described in <xref linkend="spgist-all-the-same"/>.
</para>
</sect2>
<para>
The <productname>PostgreSQL</productname> source distribution includes
several examples of index operator classes for <acronym>SP-GiST</acronym>,
- as described in <xref linkend="spgist-builtin-opclasses-table">. Look
+ as described in <xref linkend="spgist-builtin-opclasses-table"/>. Look
into <filename>src/backend/access/spgist/</filename>
and <filename>src/backend/utils/adt/</filename> to see the code.
</para>
force re-analysis and re-planning of the statement before using it
whenever database objects used in the statement have undergone
definitional (DDL) changes since the previous use of the prepared
- statement. Also, if the value of <xref linkend="guc-search-path"> changes
+ statement. Also, if the value of <xref linkend="guc-search-path"/> changes
from one use to the next, the statement will be re-parsed using the new
<varname>search_path</varname>. (This latter behavior is new as of
<productname>PostgreSQL</productname> 9.3.) See <xref
- linkend="sql-prepare"> for more information about the behavior of prepared
+ linkend="sql-prepare"/> for more information about the behavior of prepared
statements.
</para>
<title>Notes</title>
<para>
- See the SQL <xref linkend="sql-fetch"> command
+ See the SQL <xref linkend="sql-fetch"/> command
for details of the interpretation of the
<parameter>direction</parameter> and
<parameter>count</parameter> parameters.
<title>Notes</title>
<para>
- See the SQL <xref linkend="sql-fetch"> command
+ See the SQL <xref linkend="sql-fetch"/> command
for details of the interpretation of the
<parameter>direction</parameter> and
<parameter>count</parameter> parameters.
that were processed by the command. You can find more complex
examples for SPI in the source tree in
<filename>src/test/regress/regress.c</filename> and in the
- <xref linkend="contrib-spi"> module.
+ <xref linkend="contrib-spi"/> module.
</para>
<programlisting>
<para>
This is how you declare the function after having compiled it into
- a shared library (details are in <xref linkend="dfunc">.):
+ a shared library (details are in <xref linkend="dfunc"/>.):
<programlisting>
CREATE FUNCTION execq(text, integer) RETURNS int8
<productname>PostgreSQL</productname> using this source code distribution.
</para>
- <xi:include href="postgres.xml" xpointer="install-short" xmlns:xi="http://www.w3.org/2001/XInclude"/>
- <xi:include href="postgres.xml" xpointer="install-requirements" xmlns:xi="http://www.w3.org/2001/XInclude"/>
- <xi:include href="postgres.xml" xpointer="install-procedure" xmlns:xi="http://www.w3.org/2001/XInclude"/>
- <xi:include href="postgres.xml" xpointer="install-post" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="postgres.sgml" xpointer="install-short" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="postgres.sgml" xpointer="install-requirements" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="postgres.sgml" xpointer="install-procedure" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="postgres.sgml" xpointer="install-post" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<sect1 id="install-getting-started">
<title>Getting Started</title>
</para>
</sect1>
- <xi:include href="postgres.xml" xpointer="supported-platforms" xmlns:xi="http://www.w3.org/2001/XInclude"/>
- <xi:include href="postgres.xml" xpointer="installation-platform-notes" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="postgres.sgml" xpointer="supported-platforms" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="postgres.sgml" xpointer="installation-platform-notes" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</article>
<para>
If you are installing <productname>PostgreSQL</productname>
- yourself, then refer to <xref linkend="installation">
+ yourself, then refer to <xref linkend="installation"/>
for instructions on installation, and return to
this guide when the installation is complete. Be sure to follow
closely the section about setting up the appropriate environment
administrator has not created a <productname>PostgreSQL</productname> user account
for you. (<productname>PostgreSQL</productname> user accounts are distinct from
operating system user accounts.) If you are the administrator, see
- <xref linkend="user-manag"> for help creating accounts. You will need to
+ <xref linkend="user-manag"/> for help creating accounts. You will need to
become the operating system user under which <productname>PostgreSQL</productname>
was installed (usually <literal>postgres</literal>) to create the first user
account. It could also be that you were assigned a
<para>
More about <command>createdb</command> and <command>dropdb</command> can
- be found in <xref linkend="app-createdb"> and <xref linkend="app-dropdb">
+ be found in <xref linkend="app-createdb"/> and <xref linkend="app-dropdb"/>
respectively.
</para>
</sect1>
<para>
Writing a custom application, using one of the several
available language bindings. These possibilities are discussed
- further in <xref linkend="client-interfaces">.
+ further in <xref linkend="client-interfaces"/>.
</para>
</listitem>
</itemizedlist>
command shell. (For more internal commands, type
<literal>\?</literal> at the <command>psql</command> prompt.) The
full capabilities of <command>psql</command> are documented in
- <xref linkend="app-psql">. In this tutorial we will not use these
+ <xref linkend="app-psql"/>. In this tutorial we will not use these
features explicitly, but you can use them yourself when it is helpful.
</para>
<para>
The <varname>PGDATA</varname> directory contains several subdirectories and control
-files, as shown in <xref linkend="pgdata-contents-table">. In addition to
+files, as shown in <xref linkend="pgdata-contents-table"/>. In addition to
these required items, the cluster configuration files
<filename>postgresql.conf</filename>, <filename>pg_hba.conf</filename>, and
<filename>pg_ident.conf</filename> are traditionally stored in
is the backend ID of the backend which created the file, and <replaceable>FFF</replaceable>
is the filenode number. In either case, in addition to the main file (a/k/a
main fork), each table and index has a <firstterm>free space map</firstterm> (see <xref
-linkend="storage-fsm">), which stores information about free space available in
+linkend="storage-fsm"/>), which stores information about free space available in
the relation. The free space map is stored in a file named with the filenode
number plus the suffix <literal>_fsm</literal>. Tables also have a
<firstterm>visibility map</firstterm>, stored in a fork with the suffix <literal>_vm</literal>,
to track which pages are known to have no dead tuples. The visibility map is
-described further in <xref linkend="storage-vm">. Unlogged tables and indexes
+described further in <xref linkend="storage-vm"/>. Unlogged tables and indexes
have a third fork, known as the initialization fork, which is stored in a fork
-with the suffix <literal>_init</literal> (see <xref linkend="storage-init">).
+with the suffix <literal>_init</literal> (see <xref linkend="storage-init"/>).
</para>
<caution>
field values that are too large to keep in the table rows proper.
<structname>pg_class</structname>.<structfield>reltoastrelid</structfield> links from a table to
its <acronym>TOAST</acronym> table, if any.
-See <xref linkend="storage-toast"> for more information.
+See <xref linkend="storage-toast"/> for more information.
</para>
<para>
The contents of tables and indexes are discussed further in
-<xref linkend="storage-page-layout">.
+<xref linkend="storage-page-layout"/>.
</para>
<para>
been <firstterm>detoasted</firstterm>. (This is normally done by invoking
<function>PG_DETOAST_DATUM</function> before doing anything with an input value,
but in some cases more efficient approaches are possible.
-See <xref linkend="xtypes-toast"> for more detail.)
+See <xref linkend="xtypes-toast"/> for more detail.)
</para>
<para>
itself. These <firstterm>on-disk</firstterm> pointer datums are created by the
<acronym>TOAST</acronym> management code (in <filename>access/heap/tuptoaster.c</filename>)
when a tuple to be stored on disk is too large to be stored as-is.
-Further details appear in <xref linkend="storage-toast-ondisk">.
+Further details appear in <xref linkend="storage-toast-ondisk"/>.
Alternatively, a <acronym>TOAST</acronym> pointer datum can contain a pointer to
out-of-line data that appears elsewhere in memory. Such datums are
necessarily short-lived, and will never appear on-disk, but they are very
useful for avoiding copying and redundant processing of large data values.
-Further details appear in <xref linkend="storage-toast-inmemory">.
+Further details appear in <xref linkend="storage-toast-inmemory"/>.
</para>
<para>
<para>
See <filename>src/backend/storage/freespace/README</filename> for more details on
how the <acronym>FSM</acronym> is structured, and how it's updated and searched.
-The <xref linkend="pgfreespacemap"> module
+The <xref linkend="pgfreespacemap"/> module
can be used to examine the information stored in free space maps.
</para>
</para>
<para>
-The <xref linkend="pgvisibility"> module can be used to examine the
+The <xref linkend="pgvisibility"/> module can be used to examine the
information stored in the visibility map.
</para>
</para>
<para>
-<xref linkend="page-table"> shows the overall layout of a page.
+<xref linkend="page-table"/> shows the overall layout of a page.
There are five parts to each page.
</para>
The first 24 bytes of each page consists of a page header
(<structname>PageHeaderData</structname>). Its format is detailed in <xref
- linkend="pageheaderdata-table">. The first field tracks the most
+ linkend="pageheaderdata-table"/>. The first field tracks the most
recent WAL entry related to this page. The second field contains
- the page checksum if <xref linkend="app-initdb-data-checksums"> are
+ the page checksum if <xref linkend="app-initdb-data-checksums"/> are
enabled. Next is a 2-byte field containing flag bits. This is followed
by three 2-byte integer fields (<structfield>pd_lower</structfield>,
<structfield>pd_upper</structfield>, and
header (occupying 23 bytes on most machines), followed by an optional null
bitmap, an optional object ID field, and the user data. The header is
detailed
- in <xref linkend="heaptupleheaderdata-table">. The actual user data
+ in <xref linkend="heaptupleheaderdata-table"/>. The actual user data
(columns of the row) begins at the offset indicated by
<structfield>t_hoff</structfield>, which must always be a multiple of the MAXALIGN
distance for the platform.
<type>struct varlena</type>, which includes the total length of the stored
value and some flag bits. Depending on the flags, the data can be either
inline or in a <acronym>TOAST</acronym> table;
- it might be compressed, too (see <xref linkend="storage-toast">).
+ it might be compressed, too (see <xref linkend="storage-toast"/>).
</para>
</sect1>
a <token>SET</token> token to appear in a certain position, and
this particular variation of <command>INSERT</command> also
requires a <token>VALUES</token> in order to be complete. The
- precise syntax rules for each command are described in <xref linkend="reference">.
+ precise syntax rules for each command are described in <xref linkend="reference"/>.
</para>
<sect2 id="sql-syntax-identifiers">
same lexical structure, meaning that one cannot know whether a
token is an identifier or a key word without knowing the language.
A complete list of key words can be found in <xref
- linkend="sql-keywords-appendix">.
+ linkend="sql-keywords-appendix"/>.
</para>
<para>
Within an escape string, a backslash character (<literal>\</literal>) begins a
C-like <firstterm>backslash escape</firstterm> sequence, in which the combination
of backslash and following character(s) represent a special byte
- value, as shown in <xref linkend="sql-backslash-table">.
+ value, as shown in <xref linkend="sql-backslash-table"/>.
</para>
<table id="sql-backslash-table">
valid characters in the server character set encoding. When the
server encoding is UTF-8, then the Unicode escapes or the
alternative Unicode escape syntax, explained
- in <xref linkend="sql-syntax-strings-uescape">, should be used
+ in <xref linkend="sql-syntax-strings-uescape"/>, should be used
instead. (The alternative would be doing the UTF-8 encoding by
hand and writing out the bytes, which would be very cumbersome.)
</para>
<caution>
<para>
If the configuration parameter
- <xref linkend="guc-standard-conforming-strings"> is <literal>off</literal>,
+ <xref linkend="guc-standard-conforming-strings"/> is <literal>off</literal>,
then <productname>PostgreSQL</productname> recognizes backslash escapes
in both regular and escape string constants. However, as of
<productname>PostgreSQL</productname> 9.1, the default is <literal>on</literal>, meaning
<para>
In addition to <varname>standard_conforming_strings</varname>, the configuration
- parameters <xref linkend="guc-escape-string-warning"> and
- <xref linkend="guc-backslash-quote"> govern treatment of backslashes
+ parameters <xref linkend="guc-escape-string-warning"/> and
+ <xref linkend="guc-backslash-quote"/> govern treatment of backslashes
in string constants.
</para>
</caution>
<para>
Also, the Unicode escape syntax for string constants only works
when the configuration
- parameter <xref linkend="guc-standard-conforming-strings"> is
+ parameter <xref linkend="guc-standard-conforming-strings"/> is
turned on. This is because otherwise this syntax could confuse
clients that parse the SQL statements to the point that it could
lead to SQL injections and similar security issues. If the
<replaceable>typename</replaceable> ( '<replaceable>string</replaceable>' )
</synopsis>
but not all type names can be used in this way; see <xref
- linkend="sql-syntax-type-casts"> for details.
+ linkend="sql-syntax-type-casts"/> for details.
</para>
<para>
The <literal>::</literal>, <literal>CAST()</literal>, and
function-call syntaxes can also be used to specify run-time type
conversions of arbitrary expressions, as discussed in <xref
- linkend="sql-syntax-type-casts">. To avoid syntactic ambiguity, the
+ linkend="sql-syntax-type-casts"/>. To avoid syntactic ambiguity, the
<literal><replaceable>type</replaceable> '<replaceable>string</replaceable>'</literal>
syntax can only be used to specify the type of a simple literal constant.
Another restriction on the
<listitem>
<para>
Brackets (<literal>[]</literal>) are used to select the elements
- of an array. See <xref linkend="arrays"> for more information
+ of an array. See <xref linkend="arrays"/> for more information
on arrays.
</para>
</listitem>
<para>
The colon (<literal>:</literal>) is used to select
<quote>slices</quote> from arrays. (See <xref
- linkend="arrays">.) In certain SQL dialects (such as Embedded
+ linkend="arrays"/>.) In certain SQL dialects (such as Embedded
SQL), the colon is used to prefix variable names.
</para>
</listitem>
</indexterm>
<para>
- <xref linkend="sql-precedence-table"> shows the precedence and
+ <xref linkend="sql-precedence-table"/> shows the precedence and
associativity of the operators in <productname>PostgreSQL</productname>.
Most operators have the same precedence and are left-associative.
The precedence and associativity of the operators is hard-wired
SELECT 3 OPERATOR(pg_catalog.+) 4;
</programlisting>
the <literal>OPERATOR</literal> construct is taken to have the default precedence
- shown in <xref linkend="sql-precedence-table"> for
+ shown in <xref linkend="sql-precedence-table"/> for
<quote>any other operator</quote>. This is true no matter
which specific operator appears inside <literal>OPERATOR()</literal>.
</para>
change behavior without any parsing error being reported. If you are
concerned about whether these changes have silently broken something,
you can test your application with the configuration
- parameter <xref linkend="guc-operator-precedence-warning"> turned on
+ parameter <xref linkend="guc-operator-precedence-warning"/> turned on
to see if any warnings are logged.
</para>
</note>
be classified as an expression but do not follow any general syntax
rules. These generally have the semantics of a function or
operator and are explained in the appropriate location in <xref
- linkend="functions">. An example is the <literal>IS NULL</literal>
+ linkend="functions"/>. An example is the <literal>IS NULL</literal>
clause.
</para>
<para>
We have already discussed constants in <xref
- linkend="sql-syntax-constants">. The following sections discuss
+ linkend="sql-syntax-constants"/>. The following sections discuss
the remaining options.
</para>
table (possibly qualified with a schema name), or an alias for a table
defined by means of a <literal>FROM</literal> clause.
The correlation name and separating dot can be omitted if the column name
- is unique across all the tables being used in the current query. (See also <xref linkend="queries">.)
+ is unique across all the tables being used in the current query. (See also <xref linkend="queries"/>.)
</para>
</sect2>
</programlisting>
The parentheses in the last example are required.
- See <xref linkend="arrays"> for more about arrays.
+ See <xref linkend="arrays"/> for more about arrays.
</para>
</sect2>
(compositecol).*
</programlisting>
This notation behaves differently depending on context;
- see <xref linkend="rowtypes-usage"> for details.
+ see <xref linkend="rowtypes-usage"/> for details.
</para>
</sect2>
<member><replaceable>expression</replaceable> <replaceable>operator</replaceable> (unary postfix operator)</member>
</simplelist>
where the <replaceable>operator</replaceable> token follows the syntax
- rules of <xref linkend="sql-syntax-operators">, or is one of the
+ rules of <xref linkend="sql-syntax-operators"/>, or is one of the
key words <token>AND</token>, <token>OR</token>, and
<token>NOT</token>, or is a qualified operator name in the form:
<synopsis>
</synopsis>
Which particular operators exist and whether
they are unary or binary depends on what operators have been
- defined by the system or the user. <xref linkend="functions">
+ defined by the system or the user. <xref linkend="functions"/>
describes the built-in operators.
</para>
</sect2>
</para>
<para>
- The list of built-in functions is in <xref linkend="functions">.
+ The list of built-in functions is in <xref linkend="functions"/>.
Other functions can be added by the user.
</para>
<para>
The arguments can optionally have names attached.
- See <xref linkend="sql-syntax-calling-funcs"> for details.
+ See <xref linkend="sql-syntax-calling-funcs"/> for details.
</para>
<note>
interchangeable. This behavior is not SQL-standard but is provided
in <productname>PostgreSQL</productname> because it allows use of functions to
emulate <quote>computed fields</quote>. For more information see
- <xref linkend="rowtypes-usage">.
+ <xref linkend="rowtypes-usage"/>.
</para>
</note>
</sect2>
such an aggregate, the optional <replaceable>order_by_clause</replaceable> can be
used to specify the desired ordering. The <replaceable>order_by_clause</replaceable>
has the same syntax as for a query-level <literal>ORDER BY</literal> clause, as
- described in <xref linkend="queries-order">, except that its expressions
+ described in <xref linkend="queries-order"/>, except that its expressions
are always just expressions and cannot be output-column names or numbers.
For example:
<programlisting>
<para>
The predefined aggregate functions are described in <xref
- linkend="functions-aggregate">. Other aggregate functions can be added
+ linkend="functions-aggregate"/>. Other aggregate functions can be added
by the user.
</para>
<para>
When an aggregate expression appears in a subquery (see
- <xref linkend="sql-syntax-scalar-subqueries"> and
- <xref linkend="functions-subquery">), the aggregate is normally
+ <xref linkend="sql-syntax-scalar-subqueries"/> and
+ <xref linkend="functions-subquery"/>), the aggregate is normally
evaluated over the rows of the subquery. But an exception occurs
if the aggregate's arguments (and <replaceable>filter_clause</replaceable>
if any) contain only outer-level variables:
Alternatively, a full <replaceable>window_definition</replaceable> can
be given within parentheses, using the same syntax as for defining a
named window in the <literal>WINDOW</literal> clause; see the
- <xref linkend="sql-select"> reference page for details. It's worth
+ <xref linkend="sql-select"/> reference page for details. It's worth
pointing out that <literal>OVER wname</literal> is not exactly equivalent to
<literal>OVER (wname ...)</literal>; the latter implies copying and modifying the
window definition, and will be rejected if the referenced window
<para>
The built-in window functions are described in <xref
- linkend="functions-window-table">. Other window functions can be added by
+ linkend="functions-window-table"/>. Other window functions can be added by
the user. Also, any built-in or user-defined general-purpose or
statistical aggregate can be used as a window function. (Ordered-set
and hypothetical-set aggregates cannot presently be used as window functions.)
<para>
More information about window functions can be found in
- <xref linkend="tutorial-window">,
- <xref linkend="functions-window">, and
- <xref linkend="queries-window">.
+ <xref linkend="tutorial-window"/>,
+ <xref linkend="functions-window"/>, and
+ <xref linkend="queries-window"/>.
</para>
</sect2>
represents a run-time type conversion. The cast will succeed only
if a suitable type conversion operation has been defined. Notice that this
is subtly different from the use of casts with constants, as shown in
- <xref linkend="sql-syntax-constants-generic">. A cast applied to an
+ <xref linkend="sql-syntax-constants-generic"/>. A cast applied to an
unadorned string literal represents the initial assignment of a type
to a literal constant value, and so it will succeed for any type
(if the contents of the string literal are acceptable input syntax for the
syntax</quote> is nothing more than a direct invocation of the underlying
conversion function. Obviously, this is not something that a portable
application should rely on. For further details see
- <xref linkend="sql-createcast">.
+ <xref linkend="sql-createcast"/>.
</para>
</note>
</sect2>
arguments, and an explicit <literal>COLLATE</literal> clause will override the
collations of all other arguments. (Attaching non-matching
<literal>COLLATE</literal> clauses to more than one argument, however, is an
- error. For more details see <xref linkend="collation">.)
+ error. For more details see <xref linkend="collation"/>.)
Thus, this gives the same result as the previous example:
<programlisting>
SELECT * FROM tbl WHERE a COLLATE "C" > 'foo';
<para>
A scalar subquery is an ordinary
<command>SELECT</command> query in parentheses that returns exactly one
- row with one column. (See <xref linkend="queries"> for information about writing queries.)
+ row with one column. (See <xref linkend="queries"/> for information about writing queries.)
The <command>SELECT</command> query is executed
and the single returned value is used in the surrounding value expression.
It is an error to use a query that
there is no error; the scalar result is taken to be null.)
The subquery can refer to variables from the surrounding query,
which will act as constants during any one evaluation of the subquery.
- See also <xref linkend="functions-subquery"> for other expressions involving subqueries.
+ See also <xref linkend="functions-subquery"/> for other expressions involving subqueries.
</para>
<para>
By default,
the array element type is the common type of the member expressions,
determined using the same rules as for <literal>UNION</literal> or
- <literal>CASE</literal> constructs (see <xref linkend="typeconv-union-case">).
+ <literal>CASE</literal> constructs (see <xref linkend="typeconv-union-case"/>).
You can override this by explicitly casting the array constructor to the
desired type, for example:
<programlisting>
</programlisting>
This has the same effect as casting each expression to the array
element type individually.
- For more on casting, see <xref linkend="sql-syntax-type-casts">.
+ For more on casting, see <xref linkend="sql-syntax-type-casts"/>.
</para>
<para>
<para>
The subscripts of an array value built with <literal>ARRAY</literal>
always begin with one. For more information about arrays, see
- <xref linkend="arrays">.
+ <xref linkend="arrays"/>.
</para>
</sect2>
<replaceable>rowvalue</replaceable><literal>.*</literal>,
which will be expanded to a list of the elements of the row value,
just as occurs when the <literal>.*</literal> syntax is used at the top level
- of a <command>SELECT</command> list (see <xref linkend="rowtypes-usage">).
+ of a <command>SELECT</command> list (see <xref linkend="rowtypes-usage"/>).
For example, if table <literal>t</literal> has
columns <literal>f1</literal> and <literal>f2</literal>, these are the same:
<programlisting>
SELECT ROW(table.*) IS NULL FROM table; -- detect all-null rows
</programlisting>
- For more detail see <xref linkend="functions-comparisons">.
+ For more detail see <xref linkend="functions-comparisons"/>.
Row constructors can also be used in connection with subqueries,
- as discussed in <xref linkend="functions-subquery">.
+ as discussed in <xref linkend="functions-subquery"/>.
</para>
</sect2>
<para>
When it is essential to force evaluation order, a <literal>CASE</literal>
- construct (see <xref linkend="functions-conditional">) can be
+ construct (see <xref linkend="functions-conditional"/>) can be
used. For example, this is an untrustworthy way of trying to
avoid division by zero in a <literal>WHERE</literal> clause:
<programlisting>
<literal>CASE</literal> is not a cure-all for such issues, however.
One limitation of the technique illustrated above is that it does not
prevent early evaluation of constant subexpressions.
- As described in <xref linkend="xfunc-volatility">, functions and
+ As described in <xref linkend="xfunc-volatility"/>, functions and
operators marked <literal>IMMUTABLE</literal> can be evaluated when
the query is planned rather than when it is executed. Thus for example
<programlisting>
<literal>b</literal> inputs will be concatenated, and forced to either
upper or lower case depending on the <literal>uppercase</literal>
parameter. The remaining details of this function
- definition are not important here (see <xref linkend="extend"> for
+ definition are not important here (see <xref linkend="extend"/> for
more information).
</para>
<title>Functions Provided</title>
<para>
- <xref linkend="tablefunc-functions"> shows the functions provided
+ <xref linkend="tablefunc-functions"/> shows the functions provided
by the <filename>tablefunc</filename> module.
</para>
</para>
<para>
- <xref linkend="tablefunc-connectby-parameters"> explains the
+ <xref linkend="tablefunc-connectby-parameters"/> explains the
parameters.
</para>
type <type>TsmRoutine</type>, which contains pointers to support functions for
the sampling method. These support functions are plain C functions and
are not visible or callable at the SQL level. The support functions are
- described in <xref linkend="tablesample-support-functions">.
+ described in <xref linkend="tablesample-support-functions"/>.
</para>
<para>
<para>
A data type <type>tsvector</type> is provided for storing preprocessed
documents, along with a type <type>tsquery</type> for representing processed
- queries (<xref linkend="datatype-textsearch">). There are many
+ queries (<xref linkend="datatype-textsearch"/>). There are many
functions and operators available for these data types
- (<xref linkend="functions-textsearch">), the most important of which is
+ (<xref linkend="functions-textsearch"/>), the most important of which is
the match operator <literal>@@</literal>, which we introduce in
- <xref linkend="textsearch-matching">. Full text searches can be accelerated
- using indexes (<xref linkend="textsearch-indexes">).
+ <xref linkend="textsearch-matching"/>. Full text searches can be accelerated
+ using indexes (<xref linkend="textsearch-indexes"/>).
</para>
text, any more than a <type>tsvector</type> is. A <type>tsquery</type>
contains search terms, which must be already-normalized lexemes, and
may combine multiple terms using AND, OR, NOT, and FOLLOWED BY operators.
- (For syntax details see <xref linkend="datatype-tsquery">.) There are
+ (For syntax details see <xref linkend="datatype-tsquery"/>.) There are
functions <function>to_tsquery</function>, <function>plainto_tsquery</function>,
and <function>phraseto_tsquery</function>
that are helpful in converting user-written text into a proper
<para>
During installation an appropriate configuration is selected and
- <xref linkend="guc-default-text-search-config"> is set accordingly
+ <xref linkend="guc-default-text-search-config"/> is set accordingly
in <filename>postgresql.conf</filename>. If you are using the same text search
configuration for the entire cluster you can use the value in
<filename>postgresql.conf</filename>. To use different configurations
</programlisting>
This query will use the configuration set by <xref
- linkend="guc-default-text-search-config">.
+ linkend="guc-default-text-search-config"/>.
</para>
<para>
<para>
We can create a <acronym>GIN</acronym> index (<xref
- linkend="textsearch-indexes">) to speed up text searches:
+ linkend="textsearch-indexes"/>) to speed up text searches:
<programlisting>
CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector('english', body));
Notice that the 2-argument version of <function>to_tsvector</function> is
used. Only text search functions that specify a configuration name can
- be used in expression indexes (<xref linkend="indexes-expressional">).
+ be used in expression indexes (<xref linkend="indexes-expressional"/>).
This is because the index contents must be unaffected by <xref
- linkend="guc-default-text-search-config">. If they were affected, the
+ linkend="guc-default-text-search-config"/>. If they were affected, the
index contents might be inconsistent because different entries could
contain <type>tsvector</type>s that were created with different text search
configurations, and there would be no way to guess which was which. It
representation,
it is necessary to create a trigger to keep the <type>tsvector</type>
column current anytime <literal>title</literal> or <literal>body</literal> changes.
- <xref linkend="textsearch-update-triggers"> explains how to do that.
+ <xref linkend="textsearch-update-triggers"/> explains how to do that.
</para>
<para>
searches will be faster, since it will not be necessary to redo the
<function>to_tsvector</function> calls to verify index matches. (This is more
important when using a GiST index than a GIN index; see <xref
- linkend="textsearch-indexes">.) The expression-index approach is
+ linkend="textsearch-indexes"/>.) The expression-index approach is
simpler to set up, however, and it requires less disk space since the
<type>tsvector</type> representation is not stored explicitly.
</para>
The <function>to_tsvector</function> function internally calls a parser
which breaks the document text into tokens and assigns a type to
each token. For each token, a list of
- dictionaries (<xref linkend="textsearch-dictionaries">) is consulted,
+ dictionaries (<xref linkend="textsearch-dictionaries"/>) is consulted,
where the list can vary depending on the token type. The first dictionary
that <firstterm>recognizes</firstterm> the token emits one or more normalized
<firstterm>lexemes</firstterm> to represent the token. For example,
<literal>rats</literal> became <literal>rat</literal> because one of the
dictionaries recognized that the word <literal>rats</literal> is a plural
form of <literal>rat</literal>. Some words are recognized as
- <firstterm>stop words</firstterm> (<xref linkend="textsearch-stopwords">), which
+ <firstterm>stop words</firstterm> (<xref linkend="textsearch-stopwords"/>), which
causes them to be ignored since they occur too frequently to be useful in
searching. In our example these are
<literal>a</literal>, <literal>on</literal>, and <literal>it</literal>.
(<literal>Space symbols</literal>), meaning space tokens will never be
indexed. The choices of parser, dictionaries and which types of tokens to
index are determined by the selected text search configuration (<xref
- linkend="textsearch-configuration">). It is possible to have
+ linkend="textsearch-configuration"/>). It is possible to have
many different configurations in the same database, and predefined
configurations are available for various languages. In our example
we used the default configuration <literal>english</literal> for the
of each lexeme in the finished <type>tsvector</type>, and then merged
the labeled <type>tsvector</type> values using the <type>tsvector</type>
concatenation operator <literal>||</literal>. (<xref
- linkend="textsearch-manipulate-tsvector"> gives details about these
+ linkend="textsearch-manipulate-tsvector"/> gives details about these
operations.)
</para>
using parentheses. In other words, the input to
<function>to_tsquery</function> must already follow the general rules for
<type>tsquery</type> input, as described in <xref
- linkend="datatype-tsquery">. The difference is that while basic
+ linkend="datatype-tsquery"/>. The difference is that while basic
<type>tsquery</type> input takes the tokens at face value,
<function>to_tsquery</function> normalizes each token into a lexeme using
the specified or default configuration, and discards any tokens that are
its calculation. Therefore, it ignores any <quote>stripped</quote>
lexemes in the <type>tsvector</type>. If there are no unstripped
lexemes in the input, the result will be zero. (See <xref
- linkend="textsearch-manipulate-tsvector"> for more information
+ linkend="textsearch-manipulate-tsvector"/> for more information
about the <function>strip</function> function and positional information
in <type>tsvector</type>s.)
</para>
<title>Manipulating Documents</title>
<para>
- <xref linkend="textsearch-parsing-documents"> showed how raw textual
+ <xref linkend="textsearch-parsing-documents"/> showed how raw textual
documents can be converted into <type>tsvector</type> values.
<productname>PostgreSQL</productname> also provides functions and
operators that can be used to manipulate documents that are already
<para>
A full list of <type>tsvector</type>-related functions is available
- in <xref linkend="textsearch-functions-table">.
+ in <xref linkend="textsearch-functions-table"/>.
</para>
</sect2>
<title>Manipulating Queries</title>
<para>
- <xref linkend="textsearch-parsing-queries"> showed how raw textual
+ <xref linkend="textsearch-parsing-queries"/> showed how raw textual
queries can be converted into <type>tsquery</type> values.
<productname>PostgreSQL</productname> also provides functions and
operators that can be used to manipulate queries that are already
(e.g., <literal>new york</literal>, <literal>big apple</literal>, <literal>nyc</literal>,
<literal>gotham</literal>) or narrow the search to direct the user to some hot
topic. There is some overlap in functionality between this feature
- and thesaurus dictionaries (<xref linkend="textsearch-thesaurus">).
+ and thesaurus dictionaries (<xref linkend="textsearch-thesaurus"/>).
However, you can modify a set of rewrite rules on-the-fly without
reindexing, whereas updating a thesaurus requires reindexing to be
effective.
<para>
The built-in parser is named <literal>pg_catalog.default</literal>.
- It recognizes 23 token types, shown in <xref linkend="textsearch-default-parser">.
+ It recognizes 23 token types, shown in <xref linkend="textsearch-default-parser"/>.
</para>
<table id="textsearch-default-parser">
end where it'd be useless. Filtering dictionaries are useful to partially
normalize words to simplify the task of later dictionaries. For example,
a filtering dictionary could be used to remove accents from accented
- letters, as is done by the <xref linkend="unaccent"> module.
+ letters, as is done by the <xref linkend="unaccent"/> module.
</para>
<sect2 id="textsearch-stopwords">
<para>
This dictionary template is used to create dictionaries that replace a
word with a synonym. Phrases are not supported (use the thesaurus
- template (<xref linkend="textsearch-thesaurus">) for that). A synonym
+ template (<xref linkend="textsearch-thesaurus"/>) for that). A synonym
dictionary can be used to overcome linguistic problems, for example, to
prevent an English stemmer dictionary from reducing the word <quote>Paris</quote> to
<quote>pari</quote>. It is enough to have a <literal>Paris paris</literal> line in the
<function>to_tsvector()</function>, but when it is used in
<function>to_tsquery()</function>, the result will be a query item with
the prefix match marker (see
- <xref linkend="textsearch-parsing-queries">).
+ <xref linkend="textsearch-parsing-queries"/>).
For example, suppose we have these entries in
<filename>$SHAREDIR/tsearch_data/synonym_sample.syn</filename>:
<programlisting>
<function>to_tsvector</function> or <function>to_tsquery</function>
needs a text search configuration to perform its processing.
The configuration parameter
- <xref linkend="guc-default-text-search-config">
+ <xref linkend="guc-default-text-search-config"/>
specifies the name of the default configuration, which is the
one used by text search functions if an explicit configuration
parameter is omitted.
you can create custom configurations easily. To facilitate management
of text search objects, a set of <acronym>SQL</acronym> commands
is available, and there are several <application>psql</application> commands that display information
- about text search objects (<xref linkend="textsearch-psql">).
+ about text search objects (<xref linkend="textsearch-psql"/>).
</para>
<para>
<para>
The word <literal>The</literal> was recognized by the
<literal>english_ispell</literal> dictionary as a stop word (<xref
- linkend="textsearch-stopwords">) and will not be indexed.
+ linkend="textsearch-stopwords"/>) and will not be indexed.
The spaces are discarded too, since the configuration provides no
dictionaries at all for them.
</para>
<para>
Note that <acronym>GIN</acronym> index build time can often be improved
- by increasing <xref linkend="guc-maintenance-work-mem">, while
+ by increasing <xref linkend="guc-maintenance-work-mem"/>, while
<acronym>GiST</acronym> index build time is not sensitive to that
parameter.
</para>
allows the implementation of very fast searches with online update.
Partitioning can be done at the database level using table inheritance,
or by distributing documents over
- servers and collecting search results using the <xref linkend="dblink">
+ servers and collecting search results using the <xref linkend="dblink"/>
module. The latter is possible because ranking functions use
only local information.
</para>
This chapter provides general information about writing trigger functions.
Trigger functions can be written in most of the available procedural
languages, including
- <application>PL/pgSQL</application> (<xref linkend="plpgsql">),
- <application>PL/Tcl</application> (<xref linkend="pltcl">),
- <application>PL/Perl</application> (<xref linkend="plperl">), and
- <application>PL/Python</application> (<xref linkend="plpython">).
+ <application>PL/pgSQL</application> (<xref linkend="plpgsql"/>),
+ <application>PL/Tcl</application> (<xref linkend="pltcl"/>),
+ <application>PL/Perl</application> (<xref linkend="plperl"/>), and
+ <application>PL/Python</application> (<xref linkend="plpython"/>).
After reading this chapter, you should consult the chapter for
your favorite procedural language to find out the language-specific
details of writing a trigger in it.
<para>
Once a suitable trigger function has been created, the trigger is
established with
- <xref linkend="sql-createtrigger">.
+ <xref linkend="sql-createtrigger"/>.
The same trigger function can be used for multiple triggers.
</para>
<para>
Further information about data visibility rules can be found in
- <xref linkend="spi-visibility">. The example in <xref
- linkend="trigger-example"> contains a demonstration of these rules.
+ <xref linkend="spi-visibility"/>. The example in <xref
+ linkend="trigger-example"/> contains a demonstration of these rules.
</para>
</sect1>
<para>
To allow queries issued through SPI to reference transition tables, see
- <xref linkend="spi-spi-register-trigger-data">.
+ <xref linkend="spi-spi-register-trigger-data"/>.
</para>
<para>
<para>
After you have compiled the source code (see <xref
- linkend="dfunc">), declare the function and the triggers:
+ linkend="dfunc"/>), declare the function and the triggers:
<programlisting>
CREATE FUNCTION trigf() RETURNS trigger
AS '<replaceable>filename</replaceable>'
<para>
There are more complex examples in
<filename>src/test/regress/regress.c</filename> and
- in <xref linkend="contrib-spi">.
+ in <xref linkend="contrib-spi"/>.
</para>
</sect1>
</chapter>
<para>
The <filename>tsm_system_rows</filename> module provides the table sampling method
<literal>SYSTEM_ROWS</literal>, which can be used in
- the <literal>TABLESAMPLE</literal> clause of a <xref linkend="sql-select">
+ the <literal>TABLESAMPLE</literal> clause of a <xref linkend="sql-select"/>
command.
</para>
<para>
The <filename>tsm_system_time</filename> module provides the table sampling method
<literal>SYSTEM_TIME</literal>, which can be used in
- the <literal>TABLESAMPLE</literal> clause of a <xref linkend="sql-select">
+ the <literal>TABLESAMPLE</literal> clause of a <xref linkend="sql-select"/>
command.
</para>
<para>
This chapter introduces the <productname>PostgreSQL</productname>
type conversion mechanisms and conventions.
-Refer to the relevant sections in <xref linkend="datatype"> and <xref linkend="functions">
+Refer to the relevant sections in <xref linkend="datatype"/> and <xref linkend="functions"/>
for more information on specific data types and allowed functions and
operators.
</para>
The system catalogs store information about which conversions, or
<firstterm>casts</firstterm>, exist between which data types, and how to
perform those conversions. Additional casts can be added by the user
-with the <xref linkend="sql-createcast">
+with the <xref linkend="sql-createcast"/>
command. (This is usually
done in conjunction with defining new data types. The set of casts
between built-in types has been carefully crafted and is best not
categories</firstterm>, including <type>boolean</type>, <type>numeric</type>,
<type>string</type>, <type>bitstring</type>, <type>datetime</type>,
<type>timespan</type>, <type>geometric</type>, <type>network</type>, and
-user-defined. (For a list see <xref linkend="catalog-typcategory-table">;
+user-defined. (For a list see <xref linkend="catalog-typcategory-table"/>;
but note it is also possible to create custom type categories.) Within each
category there can be one or more <firstterm>preferred types</firstterm>, which
are preferred when there is a choice of possible types. With careful selection
Note that this procedure is indirectly affected
by the precedence of the operators involved, since that will determine
which sub-expressions are taken to be the inputs of which operators.
- See <xref linkend="sql-precedence"> for more information.
+ See <xref linkend="sql-precedence"/> for more information.
</para>
<procedure>
<classname>pg_operator</classname> system catalog. If a non-schema-qualified
operator name was used (the usual case), the operators
considered are those with the matching name and argument count that are
-visible in the current search path (see <xref linkend="ddl-schemas-path">).
+visible in the current search path (see <xref linkend="ddl-schemas-path"/>).
If a qualified operator name was given, only operators in the specified
schema are considered.
</para>
array inclusion (<type>anyarray</type> <literal><@</literal> <type>anyarray</type>)
and range inclusion (<type>anyelement</type> <literal><@</literal> <type>anyrange</type>).
Since none of these polymorphic pseudo-types (see <xref
-linkend="datatype-pseudo">) are considered preferred, the parser cannot
+linkend="datatype-pseudo"/>) are considered preferred, the parser cannot
resolve the ambiguity on that basis.
-However, <xref linkend="op-resol-last-unknown"> tells
+However, <xref linkend="op-resol-last-unknown"/> tells
it to assume that the unknown-type literal is of the same type as the other
input, that is, integer array. Now only one of the two operators can match,
so array inclusion is selected. (Had range inclusion been selected, we would
</screen>
This query will not use the custom operator. The parser will first see if
there is a <type>mytext</type> <literal>=</literal> <type>mytext</type> operator
-(<xref linkend="op-resol-exact-unknown">), which there is not;
+(<xref linkend="op-resol-exact-unknown"/>), which there is not;
then it will consider the domain's base type <type>text</type>, and see if
there is a <type>text</type> <literal>=</literal> <type>text</type> operator
-(<xref linkend="op-resol-exact-domain">), which there is;
+(<xref linkend="op-resol-exact-domain"/>), which there is;
so it resolves the <type>unknown</type>-type literal as <type>text</type> and
uses the <type>text</type> <literal>=</literal> <type>text</type> operator.
The only way to get the custom operator to be used is to explicitly cast
<classname>pg_proc</classname> system catalog. If a non-schema-qualified
function name was used, the functions
considered are those with the matching name and argument count that are
-visible in the current search path (see <xref linkend="ddl-schemas-path">).
+visible in the current search path (see <xref linkend="ddl-schemas-path"/>).
If a qualified function name was given, only functions in the specified
schema are considered.
</para>
in cases where there is not an actual cast function. If there is a cast
function, it is conventionally named after its output type, and so there
is no need to have a special case. See
- <xref linkend="sql-createcast">
+ <xref linkend="sql-createcast"/>
for additional commentary.
</para>
</footnote>
<para>
Otherwise, try to convert the expression to the target type. This is possible
if an <firstterm>assignment cast</firstterm> between the two types is registered in the
-<structname>pg_cast</structname> catalog (see <xref linkend="sql-createcast">).
+<structname>pg_cast</structname> catalog (see <xref linkend="sql-createcast"/>).
Alternatively, if the expression is an unknown-type literal, the contents of
the literal string will be fed to the input conversion routine for the target
type.
<para>
This chapter describes how to create and manage roles.
More information about the effects of role privileges on various
- database objects can be found in <xref linkend="ddl-priv">.
+ database objects can be found in <xref linkend="ddl-priv"/>.
</para>
<sect1 id="database-roles">
maintain a correspondence, but this is not required. Database roles
are global across a database cluster installation (and not
per individual database). To create a role use the <xref
- linkend="sql-createrole"> SQL command:
+ linkend="sql-createrole"/> SQL command:
<synopsis>
CREATE ROLE <replaceable>name</replaceable>;
</synopsis>
double-quoted. (In practice, you will usually want to add additional
options, such as <literal>LOGIN</literal>, to the command. More details appear
below.) To remove an existing role, use the analogous
- <xref linkend="sql-droprole"> command:
+ <xref linkend="sql-droprole"/> command:
<synopsis>
DROP ROLE <replaceable>name</replaceable>;
</synopsis>
</indexterm>
<para>
- For convenience, the programs <xref linkend="app-createuser">
- and <xref linkend="app-dropuser"> are provided as wrappers
+ For convenience, the programs <xref linkend="app-createuser"/>
+ and <xref linkend="app-dropuser"/> are provided as wrappers
around these SQL commands that can be called from the shell command
line:
<synopsis>
<synopsis>
SELECT rolname FROM pg_roles;
</synopsis>
- The <xref linkend="app-psql"> program's <literal>\du</literal> meta-command
+ The <xref linkend="app-psql"/> program's <literal>\du</literal> meta-command
is also useful for listing the existing roles.
</para>
<para>
The set of database roles a given client connection can connect as
is determined by the client authentication setup, as explained in
- <xref linkend="client-authentication">. (Thus, a client is not
+ <xref linkend="client-authentication"/>. (Thus, a client is not
limited to connect as the role matching
its operating system user, just as a person's login name
need not match his or her real name.) Since the role
A role's attributes can be modified after creation with
<command>ALTER ROLE</command>.<indexterm><primary>ALTER ROLE</primary></indexterm>
- See the reference pages for the <xref linkend="sql-createrole">
- and <xref linkend="sql-alterrole"> commands for details.
+ See the reference pages for the <xref linkend="sql-createrole"/>
+ and <xref linkend="sql-alterrole"/> commands for details.
</para>
<tip>
<para>
A role can also have role-specific defaults for many of the run-time
configuration settings described in <xref
- linkend="runtime-config">. For example, if for some reason you
+ linkend="runtime-config"/>. For example, if for some reason you
want to disable index scans (hint: not a good idea) anytime you
connect, you can use:
<programlisting>
<para>
Once the group role exists, you can add and remove members using the
- <xref linkend="sql-grant"> and
- <xref linkend="sql-revoke"> commands:
+ <xref linkend="sql-grant"/> and
+ <xref linkend="sql-revoke"/> commands:
<synopsis>
GRANT <replaceable>group_role</replaceable> TO <replaceable>role1</replaceable>, ... ;
REVOKE <replaceable>group_role</replaceable> FROM <replaceable>role1</replaceable>, ... ;
<para>
The members of a group role can use the privileges of the role in two
ways. First, every member of a group can explicitly do
- <xref linkend="sql-set-role"> to
+ <xref linkend="sql-set-role"/> to
temporarily <quote>become</quote> the group role. In this state, the
database session has access to the privileges of the group role rather
than the original login role, and any database objects created are
<para>
To destroy a group role, use <xref
- linkend="sql-droprole">:
+ linkend="sql-droprole"/>:
<synopsis>
DROP ROLE <replaceable>name</replaceable>;
</synopsis>
<para>
Because roles can own database objects and can hold privileges
to access other objects, dropping a role is often not just a matter of a
- quick <xref linkend="sql-droprole">. Any objects owned by the role must
+ quick <xref linkend="sql-droprole"/>. Any objects owned by the role must
first be dropped or reassigned to other owners; and any permissions
granted to the role must be revoked.
</para>
<programlisting>
ALTER TABLE bobs_table OWNER TO alice;
</programlisting>
- Alternatively, the <xref linkend="sql-reassign-owned"> command can be
+ Alternatively, the <xref linkend="sql-reassign-owned"/> command can be
used to reassign ownership of all objects owned by the role-to-be-dropped
to a single other role. Because <command>REASSIGN OWNED</command> cannot access
objects in other databases, it is necessary to run it in each database
<para>
Once any valuable objects have been transferred to new owners, any
remaining objects owned by the role-to-be-dropped can be dropped with
- the <xref linkend="sql-drop-owned"> command. Again, this command cannot
+ the <xref linkend="sql-drop-owned"/> command. Again, this command cannot
access objects in other databases, so it is necessary to run it in each
database that contains objects owned by the role. Also, <command>DROP
OWNED</command> will not drop entire databases or tablespaces, so it is
</para>
<para>
- The default roles are described in <xref linkend="default-roles-table">.
+ The default roles are described in <xref linkend="default-roles-table"/>.
Note that the specific permissions for each of the default roles may
change in the future as additional capabilities are added. Administrators
should monitor the release notes for changes.
<title><literal>uuid-ossp</literal> Functions</title>
<para>
- <xref linkend="uuid-ossp-functions"> shows the functions available to
+ <xref linkend="uuid-ossp-functions"/> shows the functions available to
generate UUIDs.
The relevant standards ITU-T Rec. X.667, ISO/IEC 9834-8:2005, and RFC
4122 specify four algorithms for generating UUIDs, identified by the
This function generates a version 3 UUID in the given namespace using
the specified input name. The namespace should be one of the special
constants produced by the <function>uuid_ns_*()</function> functions shown
- in <xref linkend="uuid-ossp-constants">. (It could be any UUID in theory.) The name is an identifier
+ in <xref linkend="uuid-ossp-constants"/>. (It could be any UUID in theory.) The name is an identifier
in the selected namespace.
</para>
<para>
If you only need randomly-generated (version 4) UUIDs,
consider using the <function>gen_random_uuid()</function> function
- from the <xref linkend="pgcrypto"> module instead.
+ from the <xref linkend="pgcrypto"/> module instead.
</para>
</note>
</sect2>
<para>
If you use this, you may also be interested in the <function>lo_manage</function>
- trigger in the <xref linkend="lo"> module.
+ trigger in the <xref linkend="lo"/> module.
<function>lo_manage</function> is useful to try
to avoid creating orphaned LOs in the first place.
</para>
Remove no more than <replaceable>limit</replaceable> large objects per
transaction (default 1000). Since the server acquires a lock per LO
removed, removing too many LOs in one transaction risks exceeding
- <xref linkend="guc-max-locks-per-transaction">. Set the limit to
+ <xref linkend="guc-max-locks-per-transaction"/>. Set the limit to
zero if you want all removals done in a single transaction.
</para>
</listitem>
frequently requested disk blocks and combines disk writes. Fortunately,
all operating systems give applications a way to force writes from
the buffer cache to disk, and <productname>PostgreSQL</productname> uses those
- features. (See the <xref linkend="guc-wal-sync-method"> parameter
+ features. (See the <xref linkend="guc-wal-sync-method"/> parameter
to adjust how this is done.)
</para>
(<acronym>BBU</acronym>) disk controllers. In such setups, the synchronize
command forces all data from the controller cache to the disks,
eliminating much of the benefit of the BBU. You can run the
- <xref linkend="pgtestfsync"> program to see
+ <xref linkend="pgtestfsync"/> program to see
if you are affected. If you are affected, the performance benefits
of the BBU can be regained by turning off write barriers in
the file system or reconfiguring the disk controller, if that is
restore partially-written pages from WAL. If you have file-system software
that prevents partial page writes (e.g., ZFS), you can turn off
this page imaging by turning off the <xref
- linkend="guc-full-page-writes"> parameter. Battery-Backed Unit
+ linkend="guc-full-page-writes"/> parameter. Battery-Backed Unit
(BBU) disk controllers do not prevent partial page writes unless
they guarantee that data is written to the BBU as full (8kB) pages.
</para>
<para>
<acronym>WAL</acronym> also makes it possible to support on-line
backup and point-in-time recovery, as described in <xref
- linkend="continuous-archiving">. By archiving the WAL data we can support
+ linkend="continuous-archiving"/>. By archiving the WAL data we can support
reverting to any time instant covered by the available WAL data:
we simply install a prior physical backup of the database, and
replay the WAL log just as far as the desired time. What's more,
transactions running concurrently. This allows flexible trade-offs
between performance and certainty of transaction durability.
The commit mode is controlled by the user-settable parameter
- <xref linkend="guc-synchronous-commit">, which can be changed in any of
+ <xref linkend="guc-synchronous-commit"/>, which can be changed in any of
the ways that a configuration parameter can be set. The mode used for
any one transaction depends on the value of
<varname>synchronous_commit</varname> when transaction commit begins.
The duration of the
risk window is limited because a background process (the <quote>WAL
writer</quote>) flushes unwritten <acronym>WAL</acronym> records to disk
- every <xref linkend="guc-wal-writer-delay"> milliseconds.
+ every <xref linkend="guc-wal-writer-delay"/> milliseconds.
The actual maximum duration of the risk window is three times
<varname>wal_writer_delay</varname> because the WAL writer is
designed to favor writing whole pages at a time during busy periods.
<para>
Asynchronous commit provides behavior different from setting
- <xref linkend="guc-fsync"> = off.
+ <xref linkend="guc-fsync"/> = off.
<varname>fsync</varname> is a server-wide
setting that will alter the behavior of all transactions. It disables
all logic within <productname>PostgreSQL</productname> that attempts to synchronize
</para>
<para>
- <xref linkend="guc-commit-delay"> also sounds very similar to
+ <xref linkend="guc-commit-delay"/> also sounds very similar to
asynchronous commit, but it is actually a synchronous commit method
(in fact, <varname>commit_delay</varname> is ignored during an
asynchronous commit). <varname>commit_delay</varname> causes a delay
<para>
There are several <acronym>WAL</acronym>-related configuration parameters that
affect database performance. This section explains their use.
- Consult <xref linkend="runtime-config"> for general information about
+ Consult <xref linkend="runtime-config"/> for general information about
setting server configuration parameters.
</para>
<para>
The server's checkpointer process automatically performs
a checkpoint every so often. A checkpoint is begun every <xref
- linkend="guc-checkpoint-timeout"> seconds, or if
- <xref linkend="guc-max-wal-size"> is about to be exceeded,
+ linkend="guc-checkpoint-timeout"/> seconds, or if
+ <xref linkend="guc-max-wal-size"/> is about to be exceeded,
whichever comes first.
The default settings are 5 minutes and 1 GB, respectively.
If no WAL has been written since the previous checkpoint, new checkpoints
will be skipped even if <varname>checkpoint_timeout</varname> has passed.
(If WAL archiving is being used and you want to put a lower limit on how
often files are archived in order to bound potential data loss, you should
- adjust the <xref linkend="guc-archive-timeout"> parameter rather than the
+ adjust the <xref linkend="guc-archive-timeout"/> parameter rather than the
checkpoint parameters.)
It is also possible to force a checkpoint by using the SQL
command <command>CHECKPOINT</command>.
more often. This allows faster after-crash recovery, since less work
will need to be redone. However, one must balance this against the
increased cost of flushing dirty data pages more often. If
- <xref linkend="guc-full-page-writes"> is set (as is the default), there is
+ <xref linkend="guc-full-page-writes"/> is set (as is the default), there is
another factor to consider. To ensure data page consistency,
the first modification of a data page after each checkpoint results in
logging the entire page content. In that case,
extra subsequent WAL traffic as discussed above. It is therefore
wise to set the checkpointing parameters high enough so that checkpoints
don't happen too often. As a simple sanity check on your checkpointing
- parameters, you can set the <xref linkend="guc-checkpoint-warning">
+ parameters, you can set the <xref linkend="guc-checkpoint-warning"/>
parameter. If checkpoints happen closer together than
<varname>checkpoint_warning</varname> seconds,
a message will be output to the server log recommending increasing
To avoid flooding the I/O system with a burst of page writes,
writing dirty buffers during a checkpoint is spread over a period of time.
That period is controlled by
- <xref linkend="guc-checkpoint-completion-target">, which is
+ <xref linkend="guc-checkpoint-completion-target"/>, which is
given as a fraction of the checkpoint interval.
The I/O rate is adjusted so that the checkpoint finishes when the
given fraction of
</para>
<para>
- On Linux and POSIX platforms <xref linkend="guc-checkpoint-flush-after">
+ On Linux and POSIX platforms <xref linkend="guc-checkpoint-flush-after"/>
allows to force the OS that pages written by the checkpoint should be
flushed to disk after a configurable number of bytes. Otherwise, these
pages may be kept in the OS's page cache, inducing a stall when
<literal>fsync</literal> is issued at the end of a checkpoint. This setting will
often help to reduce transaction latency, but it also can an adverse effect
on performance; particularly for workloads that are bigger than
- <xref linkend="guc-shared-buffers">, but smaller than the OS's page cache.
+ <xref linkend="guc-shared-buffers"/>, but smaller than the OS's page cache.
</para>
<para>
<para>
Independently of <varname>max_wal_size</varname>,
- <xref linkend="guc-wal-keep-segments"> + 1 most recent WAL files are
+ <xref linkend="guc-wal-keep-segments"/> + 1 most recent WAL files are
kept at all times. Also, if WAL archiving is used, old segments can not be
removed or recycled until they are archived. If WAL archiving cannot keep up
with the pace that WAL is generated, or if <varname>archive_command</varname>
fails repeatedly, old WAL files will accumulate in <filename>pg_wal</filename>
until the situation is resolved. A slow or failed standby server that
uses a replication slot will have the same effect (see
- <xref linkend="streaming-replication-slots">).
+ <xref linkend="streaming-replication-slots"/>).
</para>
<para>
not occur often enough to prevent <function>XLogInsertRecord</function>
from having to do writes. On such systems
one should increase the number of <acronym>WAL</acronym> buffers by
- modifying the <xref linkend="guc-wal-buffers"> parameter. When
- <xref linkend="guc-full-page-writes"> is set and the system is very busy,
+ modifying the <xref linkend="guc-wal-buffers"/> parameter. When
+ <xref linkend="guc-full-page-writes"/> is set and the system is very busy,
setting <varname>wal_buffers</varname> higher will help smooth response times
during the period immediately following each checkpoint.
</para>
<para>
- The <xref linkend="guc-commit-delay"> parameter defines for how many
+ The <xref linkend="guc-commit-delay"/> parameter defines for how many
microseconds a group commit leader process will sleep after acquiring a
lock within <function>XLogFlush</function>, while group commit
followers queue up behind the leader. This delay allows other server
processes to add their commit records to the WAL buffers so that all of
them will be flushed by the leader's eventual sync operation. No sleep
- will occur if <xref linkend="guc-fsync"> is not enabled, or if fewer
- than <xref linkend="guc-commit-siblings"> other sessions are currently
+ will occur if <xref linkend="guc-fsync"/> is not enabled, or if fewer
+ than <xref linkend="guc-commit-siblings"/> other sessions are currently
in active transactions; this avoids sleeping when it's unlikely that
any other session will commit soon. Note that on some platforms, the
resolution of a sleep request is ten milliseconds, so that any nonzero
be chosen intelligently. The higher that cost is, the more effective
<varname>commit_delay</varname> is expected to be in increasing
transaction throughput, up to a point. The <xref
- linkend="pgtestfsync"> program can be used to measure the average time
+ linkend="pgtestfsync"/> program can be used to measure the average time
in microseconds that a single WAL flush operation takes. A value of
half of the average time the program reports it takes to flush after a
single 8kB write operation is often the most effective setting for
</para>
<para>
- The <xref linkend="guc-wal-sync-method"> parameter determines how
+ The <xref linkend="guc-wal-sync-method"/> parameter determines how
<productname>PostgreSQL</productname> will ask the kernel to force
<acronym>WAL</acronym> updates out to disk.
All the options should be the same in terms of reliability, with
force a flush of the disk cache even when other options do not do so.
However, it's quite platform-specific which one will be the fastest.
You can test the speeds of different options using the <xref
- linkend="pgtestfsync"> program.
+ linkend="pgtestfsync"/> program.
Note that this parameter is irrelevant if <varname>fsync</varname>
has been turned off.
</para>
<para>
- Enabling the <xref linkend="guc-wal-debug"> configuration parameter
+ Enabling the <xref linkend="guc-wal-debug"/> configuration parameter
(provided that <productname>PostgreSQL</productname> has been
compiled with support for it) will result in each
<function>XLogInsertRecord</function> and <function>XLogFlush</function>
required from the administrator except ensuring that the
disk-space requirements for the <acronym>WAL</acronym> logs are met,
and that any necessary tuning is done (see <xref
- linkend="wal-configuration">).
+ linkend="wal-configuration"/>).
</para>
<para>
irrecoverable data corruption. Administrators should try to ensure
that disks holding <productname>PostgreSQL</productname>'s
<acronym>WAL</acronym> log files do not make such false reports.
- (See <xref linkend="wal-reliability">.)
+ (See <xref linkend="wal-reliability"/>.)
</para>
<para>
scanning forward from the log location indicated in the checkpoint
record. Because the entire content of data pages is saved in the
log on the first page modification after a checkpoint (assuming
- <xref linkend="guc-full-page-writes"> is not disabled), all pages
+ <xref linkend="guc-full-page-writes"/> is not disabled), all pages
changed since the checkpoint will be restored to a consistent
state.
</para>
<para>
For further details see the
- <xref linkend="sql-createaggregate">
+ <xref linkend="sql-createaggregate"/>
command.
</para>
Aggregate functions can optionally support <firstterm>moving-aggregate
mode</firstterm>, which allows substantially faster execution of aggregate
functions within windows with moving frame starting points.
- (See <xref linkend="tutorial-window">
- and <xref linkend="syntax-window-functions"> for information about use of
+ (See <xref linkend="tutorial-window"/>
+ and <xref linkend="syntax-window-functions"/> for information about use of
aggregate functions as window functions.)
The basic idea is that in addition to a normal <quote>forward</quote>
transition function, the aggregate provides an <firstterm>inverse
Aggregate functions can use polymorphic
state transition functions or final functions, so that the same functions
can be used to implement multiple aggregates.
- See <xref linkend="extend-types-polymorphic">
+ See <xref linkend="extend-types-polymorphic"/>
for an explanation of polymorphic functions.
Going a step further, the aggregate function itself can be specified
with polymorphic input type(s) and state type, allowing a single
An aggregate function can be made to accept a varying number of arguments
by declaring its last argument as a <literal>VARIADIC</literal> array, in much
the same fashion as for regular functions; see
- <xref linkend="xfunc-sql-variadic-functions">. The aggregate's transition
+ <xref linkend="xfunc-sql-variadic-functions"/>. The aggregate's transition
function(s) must have the same array type as their last argument. The
transition function(s) typically would also be marked <literal>VARIADIC</literal>,
but this is not strictly required.
<note>
<para>
Variadic aggregates are easily misused in connection with
- the <literal>ORDER BY</literal> option (see <xref linkend="syntax-aggregates">),
+ the <literal>ORDER BY</literal> option (see <xref linkend="syntax-aggregates"/>),
since the parser cannot tell whether the wrong number of actual arguments
have been given in such a combination. Keep in mind that everything to
the right of <literal>ORDER BY</literal> is a sort key, not an argument to the
Also, because the final function performs the sort, it is not possible
to continue adding input rows by executing the transition function again
later. This means the final function is not <literal>READ_ONLY</literal>;
- it must be declared in <xref linkend="sql-createaggregate">
+ it must be declared in <xref linkend="sql-createaggregate"/>
as <literal>READ_WRITE</literal>, or as <literal>SHARABLE</literal> if it's
possible for additional final-function calls to make use of the
already-sorted state.
(While aggregate transition functions are always allowed to modify
the transition value in-place, aggregate final functions are generally
discouraged from doing so; if they do so, the behavior must be declared
- when creating the aggregate. See <xref linkend="sql-createaggregate">
+ when creating the aggregate. See <xref linkend="sql-createaggregate"/>
for more detail.)
</para>
The second argument of <function>AggCheckCallContext</function> can be used to
retrieve the memory context in which aggregate state values are being kept.
This is useful for transition functions that wish to use <quote>expanded</quote>
- objects (see <xref linkend="xtypes-toast">) as their state values.
+ objects (see <xref linkend="xtypes-toast"/>) as their state values.
On first call, the transition function should return an expanded object
whose memory context is a child of the aggregate state context, and then
keep returning the same expanded object on subsequent calls. See
<listitem>
<para>
query language functions (functions written in
- <acronym>SQL</acronym>) (<xref linkend="xfunc-sql">)
+ <acronym>SQL</acronym>) (<xref linkend="xfunc-sql"/>)
</para>
</listitem>
<listitem>
<para>
procedural language functions (functions written in, for
example, <application>PL/pgSQL</application> or <application>PL/Tcl</application>)
- (<xref linkend="xfunc-pl">)
+ (<xref linkend="xfunc-pl"/>)
</para>
</listitem>
<listitem>
<para>
- internal functions (<xref linkend="xfunc-internal">)
+ internal functions (<xref linkend="xfunc-internal"/>)
</para>
</listitem>
<listitem>
<para>
- C-language functions (<xref linkend="xfunc-c">)
+ C-language functions (<xref linkend="xfunc-c"/>)
</para>
</listitem>
</itemizedlist>
<para>
Throughout this chapter, it can be useful to look at the reference
- page of the <xref linkend="sql-createfunction"> command to
+ page of the <xref linkend="sql-createfunction"/> command to
understand the examples better. Some examples from this chapter
can be found in <filename>funcs.sql</filename> and
<filename>funcs.c</filename> in the <filename>src/tutorial</filename>
The syntax of the <command>CREATE FUNCTION</command> command requires
the function body to be written as a string constant. It is usually
most convenient to use dollar quoting (see <xref
- linkend="sql-syntax-dollar-quoting">) for the string constant.
+ linkend="sql-syntax-dollar-quoting"/>) for the string constant.
If you choose to use regular single-quoted string constant syntax,
you must double single quote marks (<literal>'</literal>) and backslashes
(<literal>\</literal>) (assuming escape string syntax) in the body of
- the function (see <xref linkend="sql-syntax-strings">).
+ the function (see <xref linkend="sql-syntax-strings"/>).
</para>
<sect2 id="xfunc-sql-function-arguments">
WHERE emp.cubicle ~= point '(2,1)';
</screen>
but this usage is deprecated since it's easy to get confused.
- (See <xref linkend="rowtypes-usage"> for details about these
+ (See <xref linkend="rowtypes-usage"/> for details about these
two notations for the composite value of a table row.)
</para>
</screen>
The second way is described more fully in <xref
- linkend="xfunc-sql-table-functions">.
+ linkend="xfunc-sql-table-functions"/>.
</para>
<para>
None
</screen>
- As explained in <xref linkend="rowtypes-usage">, the field notation and
+ As explained in <xref linkend="rowtypes-usage"/>, the field notation and
functional notation are equivalent.
</para>
</screen>
This is not essentially different from the version of <literal>add_em</literal>
- shown in <xref linkend="xfunc-sql-base-functions">. The real value of
+ shown in <xref linkend="xfunc-sql-base-functions"/>. The real value of
output parameters is that they provide a convenient way of defining
functions that return several columns. For example,
The array element parameters generated from a variadic parameter are
treated as not having any names of their own. This means it is not
possible to call a variadic function using named arguments (<xref
- linkend="sql-syntax-calling-funcs">), except when you specify
+ linkend="sql-syntax-calling-funcs"/>), except when you specify
<literal>VARIADIC</literal>. For example, this will work:
<screen>
set-returning function multiple times, with the parameters for each
invocation coming from successive rows of a table or subquery. The
preferred way to do this is to use the <literal>LATERAL</literal> key word,
- which is described in <xref linkend="queries-lateral">.
+ which is described in <xref linkend="queries-lateral"/>.
Here is an example using a set-returning function to enumerate
elements of a tree structure:
return the polymorphic types <type>anyelement</type>,
<type>anyarray</type>, <type>anynonarray</type>,
<type>anyenum</type>, and <type>anyrange</type>. See <xref
- linkend="extend-types-polymorphic"> for a more detailed
+ linkend="extend-types-polymorphic"/> for a more detailed
explanation of polymorphic functions. Here is a polymorphic
function <function>make_array</function> that builds up an array
from two arbitrary data type elements:
When a SQL function has one or more parameters of collatable data types,
a collation is identified for each function call depending on the
collations assigned to the actual arguments, as described in <xref
- linkend="collation">. If a collation is successfully identified
+ linkend="collation"/>. If a collation is successfully identified
(i.e., there are no conflicts of implicit collations among the arguments)
then all the collatable parameters are treated as having that collation
implicitly. This will affect the behavior of collation-sensitive
it is not immediately clear which function would be called with
some trivial input like <literal>test(1, 1.5)</literal>. The
currently implemented resolution rules are described in
- <xref linkend="typeconv">, but it is unwise to design a system that subtly
+ <xref linkend="typeconv"/>, but it is unwise to design a system that subtly
relies on this behavior.
</para>
Every function has a <firstterm>volatility</firstterm> classification, with
the possibilities being <literal>VOLATILE</literal>, <literal>STABLE</literal>, or
<literal>IMMUTABLE</literal>. <literal>VOLATILE</literal> is the default if the
- <xref linkend="sql-createfunction">
+ <xref linkend="sql-createfunction"/>
command does not specify a category. The volatility category is a
promise to the optimizer about the behavior of the function:
been made by the SQL command that is calling the function. A
<literal>VOLATILE</literal> function will see such changes, a <literal>STABLE</literal>
or <literal>IMMUTABLE</literal> function will not. This behavior is implemented
- using the snapshotting behavior of MVCC (see <xref linkend="mvcc">):
+ using the snapshotting behavior of MVCC (see <xref linkend="mvcc"/>):
<literal>STABLE</literal> and <literal>IMMUTABLE</literal> functions use a snapshot
established as of the start of the calling query, whereas
<literal>VOLATILE</literal> functions obtain a fresh snapshot at the start of
A common error is to label a function <literal>IMMUTABLE</literal> when its
results depend on a configuration parameter. For example, a function
that manipulates timestamps might well have results that depend on the
- <xref linkend="guc-timezone"> setting. For safety, such functions should
+ <xref linkend="guc-timezone"/> setting. For safety, such functions should
be labeled <literal>STABLE</literal> instead.
</para>
Procedural languages aren't built into the
<productname>PostgreSQL</productname> server; they are offered
by loadable modules.
- See <xref linkend="xplang"> and following chapters for more
+ See <xref linkend="xplang"/> and following chapters for more
information.
</para>
</sect1>
<para>
Normally, all internal functions present in the
server are declared during the initialization of the database cluster
- (see <xref linkend="creating-cluster">),
+ (see <xref linkend="creating-cluster"/>),
but a user could use <command>CREATE FUNCTION</command>
to create additional alias names for an internal function.
Internal functions are declared in <command>CREATE FUNCTION</command>
<para>
If the name does not contain a directory part, the file is
searched for in the path specified by the configuration variable
- <xref linkend="guc-dynamic-library-path">.<indexterm><primary>dynamic_library_path</primary></indexterm>
+ <xref linkend="guc-dynamic-library-path"/>.<indexterm><primary>dynamic_library_path</primary></indexterm>
</para>
</listitem>
<productname>PostgreSQL</productname> will not compile a C function
automatically. The object file must be compiled before it is referenced
in a <command>CREATE
- FUNCTION</command> command. See <xref linkend="dfunc"> for additional
+ FUNCTION</command> command. See <xref linkend="dfunc"/> for additional
information.
</para>
</note>
means <replaceable>XX</replaceable> <emphasis>bits</emphasis>. Note
therefore also that the C type <type>int8</type> is 1 byte in size. The
SQL type <type>int8</type> is called <type>int64</type> in C. See also
- <xref linkend="xfunc-c-type-table">.)
+ <xref linkend="xfunc-c-type-table"/>.)
</para>
<para>
value. If you do so you are likely to corrupt on-disk data, since
the pointer you are given might point directly into a disk buffer.
The sole exception to this rule is explained in
- <xref linkend="xaggr">.
+ <xref linkend="xaggr"/>.
</para>
</warning>
</para>
<para>
- <xref linkend="xfunc-c-type-table"> specifies which C type
+ <xref linkend="xfunc-c-type-table"/> specifies which C type
corresponds to which SQL type when writing a C-language function
that uses a built-in type of <productname>PostgreSQL</productname>.
The <quote>Defined In</quote> column gives the header file that
<para>
Finally, the version-1 function call conventions make it possible
- to return set results (<xref linkend="xfunc-c-return-set">) and
- implement trigger functions (<xref linkend="triggers">) and
+ to return set results (<xref linkend="xfunc-c-return-set"/>) and
+ implement trigger functions (<xref linkend="triggers"/>) and
procedural-language call handlers (<xref
- linkend="plhandler">). For more details
+ linkend="plhandler"/>). For more details
see <filename>src/backend/utils/fmgr/README</filename> in the
source distribution.
</para>
<para>
Compiling and linking your code so that it can be dynamically
loaded into <productname>PostgreSQL</productname> always
- requires special flags. See <xref linkend="dfunc"> for a
+ requires special flags. See <xref linkend="dfunc"/> for a
detailed explanation of how to do it for your particular
operating system.
</para>
<listitem>
<para>
Remember to define a <quote>magic block</quote> for your shared library,
- as described in <xref linkend="xfunc-c-dynload">.
+ as described in <xref linkend="xfunc-c-dynload"/>.
</para>
</listitem>
return the polymorphic types
<type>anyelement</type>, <type>anyarray</type>, <type>anynonarray</type>,
<type>anyenum</type>, and <type>anyrange</type>.
- See <xref linkend="extend-types-polymorphic"> for a more detailed explanation
+ See <xref linkend="extend-types-polymorphic"/> for a more detailed explanation
of polymorphic functions. When function arguments or return types
are defined as polymorphic types, the function author cannot know
in advance what data type it will be called with, or
Add-ins can reserve LWLocks and an allocation of shared memory on server
startup. The add-in's shared library must be preloaded by specifying
it in
- <xref linkend="guc-shared-preload-libraries"><indexterm><primary>shared_preload_libraries</primary></indexterm>.
+ <xref linkend="guc-shared-preload-libraries"/><indexterm><primary>shared_preload_libraries</primary></indexterm>.
Shared memory is reserved by calling:
<programlisting>
void RequestAddinShmemSpace(int size)
described in <classname>pg_am</classname>. It is possible to add a
new index access method by writing the necessary code and
then creating a row in <classname>pg_am</classname> — but that is
- beyond the scope of this chapter (see <xref linkend="indexam">).
+ beyond the scope of this chapter (see <xref linkend="indexam"/>).
</para>
<para>
<para>
The B-tree index method defines five strategies, shown in <xref
- linkend="xindex-btree-strat-table">.
+ linkend="xindex-btree-strat-table"/>.
</para>
<table tocentry="1" id="xindex-btree-strat-table">
<para>
Hash indexes support only equality comparisons, and so they use only one
- strategy, shown in <xref linkend="xindex-hash-strat-table">.
+ strategy, shown in <xref linkend="xindex-hash-strat-table"/>.
</para>
<table tocentry="1" id="xindex-hash-strat-table">
however it likes. As an example, several of the built-in GiST index
operator classes index two-dimensional geometric objects, providing
the <quote>R-tree</quote> strategies shown in
- <xref linkend="xindex-rtree-strat-table">. Four of these are true
+ <xref linkend="xindex-rtree-strat-table"/>. Four of these are true
two-dimensional tests (overlaps, same, contains, contained by);
four of them consider only the X direction; and the other four
provide the same tests in the Y direction.
class interpret the strategy numbers according to the operator class's
definition. As an example, the strategy numbers used by the built-in
operator classes for points are shown in <xref
- linkend="xindex-spgist-point-strat-table">.
+ linkend="xindex-spgist-point-strat-table"/>.
</para>
<table tocentry="1" id="xindex-spgist-point-strat-table">
each operator class interpret the strategy numbers according to the
operator class's definition. As an example, the strategy numbers used by
the built-in operator class for arrays are shown in
- <xref linkend="xindex-gin-array-strat-table">.
+ <xref linkend="xindex-gin-array-strat-table"/>.
</para>
<table tocentry="1" id="xindex-gin-array-strat-table">
of each operator class interpret the strategy numbers according to the
operator class's definition. As an example, the strategy numbers used by
the built-in <literal>Minmax</literal> operator classes are shown in
- <xref linkend="xindex-brin-minmax-strat-table">.
+ <xref linkend="xindex-brin-minmax-strat-table"/>.
</para>
<table tocentry="1" id="xindex-brin-minmax-strat-table">
level of a <literal>WHERE</literal> clause to be used with an index.
(Some index access methods also support <firstterm>ordering operators</firstterm>,
which typically don't return Boolean values; that feature is discussed
- in <xref linkend="xindex-ordering-ops">.)
+ in <xref linkend="xindex-ordering-ops"/>.)
</para>
</sect2>
<para>
B-trees require a single support function, and allow a second one to be
supplied at the operator class author's option, as shown in <xref
- linkend="xindex-btree-support-table">.
+ linkend="xindex-btree-support-table"/>.
</para>
<table tocentry="1" id="xindex-btree-support-table">
<para>
Hash indexes require one support function, and allow a second one to be
supplied at the operator class author's option, as shown in <xref
- linkend="xindex-hash-support-table">.
+ linkend="xindex-hash-support-table"/>.
</para>
<table tocentry="1" id="xindex-hash-support-table">
<para>
GiST indexes have nine support functions, two of which are optional,
- as shown in <xref linkend="xindex-gist-support-table">.
- (For more information see <xref linkend="gist">.)
+ as shown in <xref linkend="xindex-gist-support-table"/>.
+ (For more information see <xref linkend="gist"/>.)
</para>
<table tocentry="1" id="xindex-gist-support-table">
<para>
SP-GiST indexes require five support functions, as
- shown in <xref linkend="xindex-spgist-support-table">.
- (For more information see <xref linkend="spgist">.)
+ shown in <xref linkend="xindex-spgist-support-table"/>.
+ (For more information see <xref linkend="spgist"/>.)
</para>
<table tocentry="1" id="xindex-spgist-support-table">
<para>
GIN indexes have six support functions, three of which are optional,
- as shown in <xref linkend="xindex-gin-support-table">.
- (For more information see <xref linkend="gin">.)
+ as shown in <xref linkend="xindex-gin-support-table"/>.
+ (For more information see <xref linkend="gin"/>.)
</para>
<table tocentry="1" id="xindex-gin-support-table">
<para>
BRIN indexes have four basic support functions, as shown in
- <xref linkend="xindex-brin-support-table">; those basic functions
+ <xref linkend="xindex-brin-support-table"/>; those basic functions
may require additional support functions to be provided.
- (For more information see <xref linkend="brin-extensibility">.)
+ (For more information see <xref linkend="brin-extensibility"/>.)
</para>
<table tocentry="1" id="xindex-brin-support-table">
operators that sort complex numbers in absolute value order, so we
choose the name <literal>complex_abs_ops</literal>. First, we need
a set of operators. The procedure for defining operators was
- discussed in <xref linkend="xoper">. For an operator class on
+ discussed in <xref linkend="xoper"/>. For an operator class on
B-trees, the operators we require are:
<itemizedlist spacing="compact">
<title>Description of Functions</title>
<para>
- <xref linkend="xml2-functions-table"> shows the functions provided by this module.
+ <xref linkend="xml2-functions-table"/> shows the functions provided by this module.
These functions provide straightforward XML parsing and XPath queries.
All arguments are of type <type>text</type>, so for brevity that is not shown.
</para>
table. The primary key field from the original document table is returned
as the first column of the result so that the result set
can readily be used in joins. The parameters are described in
- <xref linkend="xml2-xpath-table-parameters">.
+ <xref linkend="xml2-xpath-table-parameters"/>.
</para>
<table id="xml2-xpath-table-parameters">
<para>
Here is an example of creating an operator for adding two complex
numbers. We assume we've already created the definition of type
- <type>complex</type> (see <xref linkend="xtypes">). First we need a
+ <type>complex</type> (see <xref linkend="xtypes"/>). First we need a
function that does the work, then we can define the operator:
<programlisting>
<para>
There are currently four procedural languages available in the
standard <productname>PostgreSQL</productname> distribution:
- <application>PL/pgSQL</application> (<xref linkend="plpgsql">),
- <application>PL/Tcl</application> (<xref linkend="pltcl">),
- <application>PL/Perl</application> (<xref linkend="plperl">), and
- <application>PL/Python</application> (<xref linkend="plpython">).
+ <application>PL/pgSQL</application> (<xref linkend="plpgsql"/>),
+ <application>PL/Tcl</application> (<xref linkend="pltcl"/>),
+ <application>PL/Perl</application> (<xref linkend="plperl"/>), and
+ <application>PL/Python</application> (<xref linkend="plpython"/>).
There are additional procedural languages available that are not
- included in the core distribution. <xref linkend="external-projects">
+ included in the core distribution. <xref linkend="external-projects"/>
has information about finding them. In addition other languages can
be defined by users; the basics of developing a new procedural
- language are covered in <xref linkend="plhandler">.
+ language are covered in <xref linkend="plhandler"/>.
</para>
<sect1 id="xplang-install">
The shared object for the language handler must be compiled and
installed into an appropriate library directory. This works in the same
way as building and installing modules with regular user-defined C
- functions does; see <xref linkend="dfunc">. Often, the language
+ functions does; see <xref linkend="dfunc"/>. Often, the language
handler will depend on an external library that provides the actual
programming language engine; if so, that must be installed as well.
</para>
<para>
Optionally, the language handler can provide an <quote>inline</quote>
handler function that executes anonymous code blocks
- (<xref linkend="sql-do"> commands)
+ (<xref linkend="sql-do"/> commands)
written in this language. If an inline handler function
is provided by the language, declare it with a command like
<synopsis>
</procedure>
<para>
- <xref linkend="xplang-install-example"> shows how the manual
+ <xref linkend="xplang-install-example"/> shows how the manual
installation procedure would work with the language
<application>PL/Perl</application>.
</para>
</indexterm>
<para>
- As described in <xref linkend="extend-type-system">,
+ As described in <xref linkend="extend-type-system"/>,
<productname>PostgreSQL</productname> can be extended to support new
data types. This section describes how to define new base types,
which are data types defined below the level of the <acronym>SQL</acronym>
<para>
For further details see the description of the
- <xref linkend="sql-createtype"> command.
+ <xref linkend="sql-createtype"/> command.
</para>
<sect2 id="xtypes-toast">
<para>
If the values of your data type vary in size (in internal form), it's
usually desirable to make the data type <acronym>TOAST</acronym>-able (see <xref
- linkend="storage-toast">). You should do this even if the values are always
+ linkend="storage-toast"/>). You should do this even if the values are always
too small to be compressed or stored externally, because
<acronym>TOAST</acronym> can save space on small data too, by reducing header
overhead.
DBTOEPUB = @DBTOEPUB@
FOP = @FOP@
-NSGMLS = @NSGMLS@
-OSX = @OSX@
XMLLINT = @XMLLINT@
XSLTPROC = @XSLTPROC@