Commit 01839df6 authored by Peter Eisentraut's avatar Peter Eisentraut

Add index. Only some parts of the manual set have index entries so far...

parent eedb7d18
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.36 2001/04/20 15:52:33 thomas Exp $ # $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.37 2001/05/12 22:51:34 petere Exp $
# #
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
...@@ -49,16 +49,9 @@ vpath %.sgml ./ref ...@@ -49,16 +49,9 @@ vpath %.sgml ./ref
ALLBOOKS = admin developer programmer reference tutorial user ALLBOOKS = admin developer programmer reference tutorial user
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) bookindex.sgml setindex.sgml
CATALOG = $(DOCBOOKSTYLE)/catalog
catalog: Makefile $(top_builddir)/src/Makefile.global
(echo "PUBLIC \"-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN\" \"$(DOCBOOKSTYLE)/html/docbook.dsl\""; \
echo "PUBLIC \"-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN\" \"$(DOCBOOKSTYLE)/print/docbook.dsl\"") > $@
ifeq "$(origin DOCBOOKSTYLE)" "command line"
.PHONY: catalog
endif
## ##
...@@ -84,30 +77,44 @@ man: $(ALLSGML) ...@@ -84,30 +77,44 @@ man: $(ALLSGML)
## HTML ## HTML
## ##
JADE.html = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d stylesheet.dsl -i output-html -t sgml JADE.html = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -i output-html -t sgml
postgres.html: postgres.sgml $(ALLSGML) stylesheet.dsl catalog postgres.html: postgres.sgml $(ALLSGML) stylesheet.dsl
@rm -f *.html @rm -f *.html
$(JADE.html) $< $(JADE.html) $<
ln -sf $@ index.html ln -sf $@ index.html
$(addsuffix .html, $(ALLBOOKS)): %.html: %.sgml $(ALLSGML) stylesheet.dsl catalog $(addsuffix .html, $(ALLBOOKS)): %.html: %.sgml $(ALLSGML) stylesheet.dsl
@rm -f *.html @rm -f *.html
$(JADE.html) book-decl.sgml $< $(JADE.html) book-decl.sgml $<
ln -sf $@ index.html ln -sf $@ index.html
COLLATEINDEX = $(PERL) $(DOCBOOKSTYLE)/bin/collateindex.pl -f -g -t 'Index'
ifeq (,$(wildcard HTML.index))
bookindex.sgml:
$(COLLATEINDEX) -o $@ -N
setindex.sgml:
$(COLLATEINDEX) -x -o $@ -N
else
bookindex.sgml: HTML.index
$(COLLATEINDEX) -i 'bookindex' -o $@ $<
setindex.sgml: HTML.index
$(COLLATEINDEX) -i 'setindex' -x -o $@ $<
endif
## ##
## Print ## Print
## ##
# RTF to allow minor editing for hardcopy # RTF to allow minor editing for hardcopy
$(addsuffix .rtf, $(ALLBOOKS)): %.rtf: %.sgml $(ALLSGML) stylesheet.dsl catalog $(addsuffix .rtf, $(ALLBOOKS)): %.rtf: %.sgml $(ALLSGML) stylesheet.dsl
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print book-decl.sgml $< $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print book-decl.sgml $<
# TeX and DVI # TeX and DVI
$(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML) stylesheet.dsl catalog $(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML) stylesheet.dsl
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d stylesheet.dsl -t tex -V tex-backend -i output-print book-decl.sgml $< $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print book-decl.sgml $<
%.dvi: %.tex %.dvi: %.tex
jadetex $< jadetex $<
...@@ -134,7 +141,7 @@ $(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML) stylesheet.dsl catalog ...@@ -134,7 +141,7 @@ $(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML) stylesheet.dsl catalog
## Semi-automatic generation of some text files. ## Semi-automatic generation of some text files.
## ##
JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d stylesheet.dsl -i output-text -t sgml JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -c $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
INSTALL HISTORY: % : %.html INSTALL HISTORY: % : %.html
@echo "|";\ @echo "|";\
...@@ -171,10 +178,11 @@ check-postgres: postgres.sgml ...@@ -171,10 +178,11 @@ check-postgres: postgres.sgml
## ##
clean distclean maintainer-clean: clean distclean maintainer-clean:
rm -f catalog
# HTML # HTML
rm -f HTML.manifest *.html rm -f HTML.manifest *.html
# man # man
rm -rf *.1 *.$(DEFAULTSECTION) man1 man$(DEFAULTSECTION) manpage.refs manpage.links manpage.log rm -rf *.1 *.$(DEFAULTSECTION) man1 man$(DEFAULTSECTION) manpage.refs manpage.links manpage.log
# print # print
rm -f *.rtf *.tex *.dvi *.aux *.log *.ps *.pdf rm -f *.rtf *.tex *.dvi *.aux *.log *.ps *.pdf
# index
rm -f HTML.index bookindex.sgml setindex.sgml
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/admin.sgml,v 1.33 2001/02/04 15:28:18 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/admin.sgml,v 1.34 2001/05/12 22:51:34 petere Exp $
--> -->
<book id="admin"> <book id="admin">
...@@ -38,6 +38,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/admin.sgml,v 1.33 2001/02/04 15:28:18 ...@@ -38,6 +38,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/admin.sgml,v 1.33 2001/02/04 15:28:18
<![%single-book;[ <![%single-book;[
&biblio; &biblio;
&bookindex;
]]> ]]>
</book> </book>
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/array.sgml,v 1.10 2001/01/26 23:40:39 petere Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/array.sgml,v 1.11 2001/05/12 22:51:34 petere Exp $ -->
<chapter id="arrays"> <chapter id="arrays">
<title>Arrays</title> <title>Arrays</title>
<indexterm>
<primary>arrays</primary>
</indexterm>
<para> <para>
<productname>Postgres</productname> allows columns of a table to be <productname>Postgres</productname> allows columns of a table to be
defined as variable-length multi-dimensional arrays. Arrays of any defined as variable-length multi-dimensional arrays. Arrays of any
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.10 2001/03/15 20:01:32 tgl Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.11 2001/05/12 22:51:34 petere Exp $ -->
<chapter id="client-authentication"> <chapter id="client-authentication">
<title>Client Authentication</title> <title>Client Authentication</title>
<indexterm zone="client-authentication">
<primary>client authentication</primary>
</indexterm>
<para> <para>
When a client application connects to the database server, it specifies which When a client application connects to the database server, it specifies which
<productname>Postgres</productname> user name it wants to connect as, <productname>Postgres</productname> user name it wants to connect as,
...@@ -42,6 +46,10 @@ ...@@ -42,6 +46,10 @@
<sect1 id="pg-hba.conf"> <sect1 id="pg-hba.conf">
<title>The <filename>pg_hba.conf</filename> file</title> <title>The <filename>pg_hba.conf</filename> file</title>
<indexterm zone="pg-hba.conf">
<primary>pg_hba.conf</primary>
</indexterm>
<para> <para>
Client authentication is controlled by the file Client authentication is controlled by the file
<filename>pg_hba.conf</filename> in the $PGDATA directory, e.g., <filename>pg_hba.conf</filename> in the $PGDATA directory, e.g.,
...@@ -333,6 +341,11 @@ host all 192.168.0.0 255.255.0.0 ident omicron ...@@ -333,6 +341,11 @@ host all 192.168.0.0 255.255.0.0 ident omicron
<sect2> <sect2>
<title>Password authentication</title> <title>Password authentication</title>
<indexterm>
<primary>password</primary>
</indexterm>
<para> <para>
<productname>Postgres</> database passwords are separate from any <productname>Postgres</> database passwords are separate from any
operating system user passwords. Ordinarily, the password for each operating system user passwords. Ordinarily, the password for each
...@@ -402,6 +415,10 @@ host all 192.168.0.0 255.255.0.0 ident omicron ...@@ -402,6 +415,10 @@ host all 192.168.0.0 255.255.0.0 ident omicron
<sect2 id="kerberos-auth"> <sect2 id="kerberos-auth">
<title>Kerberos authentication</title> <title>Kerberos authentication</title>
<indexterm zone="kerberos-auth">
<primary>Kerberos</primary>
</indexterm>
<para> <para>
<productname>Kerberos</productname> is an industry-standard secure <productname>Kerberos</productname> is an industry-standard secure
authentication system suitable for distributed computing over a authentication system suitable for distributed computing over a
...@@ -505,6 +522,10 @@ host all 192.168.0.0 255.255.0.0 ident omicron ...@@ -505,6 +522,10 @@ host all 192.168.0.0 255.255.0.0 ident omicron
<sect2> <sect2>
<title>Ident-based authentication</title> <title>Ident-based authentication</title>
<indexterm>
<primary>ident</primary>
</indexterm>
<para> <para>
The <quote>Identification Protocol</quote> is described in The <quote>Identification Protocol</quote> is described in
<citetitle>RFC 1413</citetitle>. Virtually every Unix-like <citetitle>RFC 1413</citetitle>. Virtually every Unix-like
...@@ -550,6 +571,7 @@ host all 192.168.0.0 255.255.0.0 ident omicron ...@@ -550,6 +571,7 @@ host all 192.168.0.0 255.255.0.0 ident omicron
</para> </para>
<para> <para>
<indexterm><primary>pg_ident.conf</primary></indexterm>
Ident maps are held in the file <filename>pg_ident.conf</filename> Ident maps are held in the file <filename>pg_ident.conf</filename>
in the data directory, which contains lines of the general form: in the data directory, which contains lines of the general form:
<synopsis> <synopsis>
......
This diff is collapsed.
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.17 2001/02/12 14:21:27 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.18 2001/05/12 22:51:34 petere Exp $
Date/time details Date/time details
--> -->
...@@ -9,6 +9,10 @@ Date/time details ...@@ -9,6 +9,10 @@ Date/time details
<sect1 id="timezones"> <sect1 id="timezones">
<title>Time Zones</title> <title>Time Zones</title>
<indexterm zone="timezones">
<primary>time zones</primary>
</indexterm>
<para> <para>
<productname>Postgres</productname> must have internal tabular <productname>Postgres</productname> must have internal tabular
information for time zone decoding, since there is no *nix standard information for time zone decoding, since there is no *nix standard
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/filelist.sgml,v 1.11 2001/05/12 17:49:32 petere Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/filelist.sgml,v 1.12 2001/05/12 22:51:34 petere Exp $ -->
<!entity history SYSTEM "history.sgml"> <!entity history SYSTEM "history.sgml">
<!entity info SYSTEM "info.sgml"> <!entity info SYSTEM "info.sgml">
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<!entity problems SYSTEM "problems.sgml"> <!entity problems SYSTEM "problems.sgml">
<!entity y2k SYSTEM "y2k.sgml"> <!entity y2k SYSTEM "y2k.sgml">
<!entity bookindex SYSTEM "bookindex.sgml">
<!entity setindex SYSTEM "setindex.sgml">
<!-- tutorial --> <!-- tutorial -->
<!entity advanced SYSTEM "advanced.sgml"> <!entity advanced SYSTEM "advanced.sgml">
<!entity arch SYSTEM "arch.sgml"> <!entity arch SYSTEM "arch.sgml">
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.57 2001/04/20 15:52:33 thomas Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.58 2001/05/12 22:51:34 petere Exp $ -->
<chapter id="functions"> <chapter id="functions">
<title>Functions and Operators</title> <title>Functions and Operators</title>
<indexterm zone="functions">
<primary>functions</primary>
</indexterm>
<indexterm zone="functions">
<primary>operators</primary>
</indexterm>
<para> <para>
<productname>Postgres</productname> provides a large number of <productname>Postgres</productname> provides a large number of
functions and operators for the built-in data types. Users can also functions and operators for the built-in data types. Users can also
...@@ -28,9 +36,35 @@ ...@@ -28,9 +36,35 @@
<sect1 id="functions-logical"> <sect1 id="functions-logical">
<title>Logical Operators</title> <title>Logical Operators</title>
<indexterm zone="functions-logical">
<primary>operators</primary>
<secondary>logical</secondary>
</indexterm>
<indexterm>
<primary>Boolean</primary>
<secondary>operators</secondary>
<see>operators, logical</see>
</indexterm>
<para> <para>
The usual logical operators are available: The usual logical operators are available:
<indexterm>
<primary>and</primary>
<secondary>operator</secondary>
</indexterm>
<indexterm>
<primary>or</primary>
<secondary>operator</secondary>
</indexterm>
<indexterm>
<primary>not</primary>
<secondary>operator</secondary>
</indexterm>
<simplelist> <simplelist>
<member>AND</member> <member>AND</member>
<member>OR</member> <member>OR</member>
...@@ -130,6 +164,11 @@ ...@@ -130,6 +164,11 @@
<sect1 id="functions-comparison"> <sect1 id="functions-comparison">
<title>Comparison Operators</title> <title>Comparison Operators</title>
<indexterm zone="functions-comparison">
<primary>comparison</primary>
<secondary>operators</secondary>
</indexterm>
<table> <table>
<title>Comparison Operators</TITLE> <title>Comparison Operators</TITLE>
<tgroup cols="2"> <tgroup cols="2">
...@@ -193,6 +232,9 @@ ...@@ -193,6 +232,9 @@
</para> </para>
<para> <para>
<indexterm>
<primary>between</primary>
</indexterm>
In addition to the comparison operators, the special In addition to the comparison operators, the special
<token>BETWEEN</token> construct is available. <token>BETWEEN</token> construct is available.
<synopsis> <synopsis>
...@@ -722,7 +764,13 @@ ...@@ -722,7 +764,13 @@
<row> <row>
<entry> <parameter>string</parameter> <literal>||</literal> <parameter>string</parameter> </entry> <entry> <parameter>string</parameter> <literal>||</literal> <parameter>string</parameter> </entry>
<entry> <type>text</type> </entry> <entry> <type>text</type> </entry>
<entry>string concatenation</entry> <entry>
string concatenation
<indexterm>
<primary>character strings</primary>
<secondary>concatenation</secondary>
</indexterm>
</entry>
<entry>'Postgre' || 'SQL'</entry> <entry>'Postgre' || 'SQL'</entry>
<entry>PostgreSQL</entry> <entry>PostgreSQL</entry>
</row> </row>
...@@ -730,7 +778,18 @@ ...@@ -730,7 +778,18 @@
<row> <row>
<entry>char_length(<parameter>string</parameter>) or character_length(<parameter>string</parameter>)</entry> <entry>char_length(<parameter>string</parameter>) or character_length(<parameter>string</parameter>)</entry>
<entry><type>integer</type></entry> <entry><type>integer</type></entry>
<entry>length of string</entry> <entry>
length of string
<indexterm>
<primary>character strings</primary>
<secondary>length</secondary>
</indexterm>
<indexterm>
<primary>length</primary>
<secondary>character strings</secondary>
<see>character strings, length</see>
</indexterm>
</entry>
<entry>char_length('jose')</entry> <entry>char_length('jose')</entry>
<entry>4</entry> <entry>4</entry>
</row> </row>
...@@ -762,7 +821,12 @@ ...@@ -762,7 +821,12 @@
<row> <row>
<entry>substring(<parameter>string</parameter> <optional>from <type>integer</type></optional> <optional>for <type>integer</type></optional>)</entry> <entry>substring(<parameter>string</parameter> <optional>from <type>integer</type></optional> <optional>for <type>integer</type></optional>)</entry>
<entry><type>text</type></entry> <entry><type>text</type></entry>
<entry>extract substring</entry> <entry>
extract substring
<indexterm>
<primary>substring</primary>
</indexterm>
</entry>
<entry>substring('Thomas' from 2 for 3)</entry> <entry>substring('Thomas' from 2 for 3)</entry>
<entry>oma</entry> <entry>oma</entry>
</row> </row>
...@@ -997,6 +1061,10 @@ ...@@ -997,6 +1061,10 @@
<sect2 id="functions-like"> <sect2 id="functions-like">
<title>Pattern Matching with <function>LIKE</function></title> <title>Pattern Matching with <function>LIKE</function></title>
<indexterm>
<primary>like</primary>
</indexterm>
<synopsis> <synopsis>
<replaceable>string</replaceable> LIKE <replaceable>pattern</replaceable> <optional> ESCAPE <replaceable>escape-character</replaceable> </optional> <replaceable>string</replaceable> LIKE <replaceable>pattern</replaceable> <optional> ESCAPE <replaceable>escape-character</replaceable> </optional>
<replaceable>string</replaceable> NOT LIKE <replaceable>pattern</replaceable> <optional> ESCAPE <replaceable>escape-character</replaceable> </optional> <replaceable>string</replaceable> NOT LIKE <replaceable>pattern</replaceable> <optional> ESCAPE <replaceable>escape-character</replaceable> </optional>
...@@ -1081,6 +1149,11 @@ ...@@ -1081,6 +1149,11 @@
<sect2 id="functions-regexp"> <sect2 id="functions-regexp">
<title><acronym>POSIX</acronym> Regular Expressions</title> <title><acronym>POSIX</acronym> Regular Expressions</title>
<indexterm zone="functions-regexp">
<primary>regular expressions</primary>
<seealso>pattern matching</seealso>
</indexterm>
<table> <table>
<title>Regular Expression Match Operators</title> <title>Regular Expression Match Operators</title>
...@@ -1386,6 +1459,10 @@ ...@@ -1386,6 +1459,10 @@
<sect1 id="functions-formatting"> <sect1 id="functions-formatting">
<title>Formatting Functions</title> <title>Formatting Functions</title>
<indexterm zone="functions-formatting">
<primary>formatting</primary>
</indexterm>
<note> <note>
<title>Author</title> <title>Author</title>
<para> <para>
...@@ -1749,10 +1826,9 @@ ...@@ -1749,10 +1826,9 @@
<listitem> <listitem>
<para> <para>
If you want to If you want to have a double quote in the output you must
have a double quote in the output you must precede it with a precede it with a backslash, for example <literal>'\\"YYYY
backslash, for example <literal>'\\"YYYY Month\\"'</literal>. <!-- "" font-lock sanity :-) -->
Month\\"'</literal>. <!-- " font-lock sanity :-) -->
</para> </para>
</listitem> </listitem>
...@@ -2654,6 +2730,16 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40'); ...@@ -2654,6 +2730,16 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
<sect2 id="functions-datetime-current"> <sect2 id="functions-datetime-current">
<title>Current Date/Time</title> <title>Current Date/Time</title>
<indexterm>
<primary>date</primary>
<secondary>current</secondary>
</indexterm>
<indexterm>
<primary>time</primary>
<secondary>current</secondary>
</indexterm>
<para> <para>
The following functions are available to obtain the current date and/or The following functions are available to obtain the current date and/or
time: time:
...@@ -3297,6 +3383,14 @@ Not defined by this name. Implements the intersection operator '#' ...@@ -3297,6 +3383,14 @@ Not defined by this name. Implements the intersection operator '#'
<sect1 id="functions-conditional"> <sect1 id="functions-conditional">
<title>Conditional Expressions</title> <title>Conditional Expressions</title>
<indexterm>
<primary>case</primary>
</indexterm>
<indexterm>
<primary>conditionals</primary>
</indexterm>
<para> <para>
This section describes the <acronym>SQL</acronym>-compliant conditional expressions This section describes the <acronym>SQL</acronym>-compliant conditional expressions
available in <productname>Postgres</productname>. available in <productname>Postgres</productname>.
...@@ -3420,6 +3514,10 @@ SELECT COALESCE(description, short_description, '(none)') ... ...@@ -3420,6 +3514,10 @@ SELECT COALESCE(description, short_description, '(none)') ...
<bridgehead renderas="sect2">NULLIF</bridgehead> <bridgehead renderas="sect2">NULLIF</bridgehead>
<indexterm>
<primary>nullif</primary>
</indexterm>
<synopsis> <synopsis>
<function>NULLIF</function>(<replaceable>value1</replaceable>, <replaceable>value2</replaceable>) <function>NULLIF</function>(<replaceable>value1</replaceable>, <replaceable>value2</replaceable>)
</synopsis> </synopsis>
...@@ -3481,6 +3579,11 @@ SELECT NULLIF(value, '(none)') ... ...@@ -3481,6 +3579,11 @@ SELECT NULLIF(value, '(none)') ...
</tgroup> </tgroup>
</table> </table>
<indexterm zone="functions-misc">
<primary>user</primary>
<secondary>current</secondary>
</indexterm>
<para> <para>
The <function>session_user</> is the user that initiated a database The <function>session_user</> is the user that initiated a database
connection and is fixed for the duration of that connection. The connection and is fixed for the duration of that connection. The
...@@ -3542,6 +3645,10 @@ SELECT NULLIF(value, '(none)') ... ...@@ -3542,6 +3645,10 @@ SELECT NULLIF(value, '(none)') ...
<entry>AVG(<replaceable class="parameter">expression</replaceable>)</entry> <entry>AVG(<replaceable class="parameter">expression</replaceable>)</entry>
<entry>the average (arithmetic mean) of all input values</entry> <entry>the average (arithmetic mean) of all input values</entry>
<entry> <entry>
<indexterm>
<primary>average</primary>
<secondary>function</secondary>
</indexterm>
Finding the average value is available on the following data Finding the average value is available on the following data
types: <type>smallint</type>, <type>integer</type>, types: <type>smallint</type>, <type>integer</type>,
<type>bigint</type>, <type>real</type>, <type>double <type>bigint</type>, <type>real</type>, <type>double
...@@ -3589,6 +3696,9 @@ SELECT NULLIF(value, '(none)') ... ...@@ -3589,6 +3696,9 @@ SELECT NULLIF(value, '(none)') ...
<entry>STDDEV(<replaceable class="parameter">expression</replaceable>)</entry> <entry>STDDEV(<replaceable class="parameter">expression</replaceable>)</entry>
<entry>the sample standard deviation of the input values</entry> <entry>the sample standard deviation of the input values</entry>
<entry> <entry>
<indexterm>
<primary>standard deviation</primary>
</indexterm>
Finding the standard deviation is available on the following Finding the standard deviation is available on the following
data types: <type>smallint</type>, <type>integer</type>, data types: <type>smallint</type>, <type>integer</type>,
<type>bigint</type>, <type>real</type>, <type>double <type>bigint</type>, <type>real</type>, <type>double
...@@ -3616,6 +3726,9 @@ SELECT NULLIF(value, '(none)') ... ...@@ -3616,6 +3726,9 @@ SELECT NULLIF(value, '(none)') ...
<entry>VARIANCE(<replaceable class="parameter">expression</replaceable>)</entry> <entry>VARIANCE(<replaceable class="parameter">expression</replaceable>)</entry>
<entry>the sample variance of the input values</entry> <entry>the sample variance of the input values</entry>
<entry> <entry>
<indexterm>
<primary>variance</primary>
</indexterm>
The variance is the square of the standard deviation. The The variance is the square of the standard deviation. The
supported data types are the same. supported data types are the same.
</entry> </entry>
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v 1.15 2001/05/07 00:43:14 tgl Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v 1.16 2001/05/12 22:51:34 petere Exp $ -->
<chapter id="indices"> <chapter id="indices">
<title id="indices-title">Indices</title> <title id="indices-title">Indices</title>
<indexterm zone="indices">
<primary>indices</primary>
</indexterm>
<indexterm>
<primary>indexes</primary>
<see>indices</see>
</indexterm>
<para> <para>
Indices are a common way to enhance database performance. An index Indices are a common way to enhance database performance. An index
allows the database server to find and retrieve specific rows much allows the database server to find and retrieve specific rows much
...@@ -102,7 +111,16 @@ CREATE INDEX test1_id_index ON test1 (id); ...@@ -102,7 +111,16 @@ CREATE INDEX test1_id_index ON test1 (id);
<para> <para>
<productname>Postgres</productname> provides several index types: <productname>Postgres</productname> provides several index types:
B-tree, R-tree, and Hash. Each index type is more appropriate for B-tree, R-tree, and Hash. Each index type is more appropriate for
a particular query type because of the algorithm it uses. By a particular query type because of the algorithm it uses.
<indexterm>
<primary>indices</primary>
<secondary>B-tree</secondary>
</indexterm>
<indexterm>
<primary>B-tree</primary>
<see>indices</see>
</indexterm>
By
default, the <command>CREATE INDEX</command> command will create a default, the <command>CREATE INDEX</command> command will create a
B-tree index, which fits the most common situations. In B-tree index, which fits the most common situations. In
particular, the <productname>Postgres</productname> query optimizer particular, the <productname>Postgres</productname> query optimizer
...@@ -119,6 +137,14 @@ CREATE INDEX test1_id_index ON test1 (id); ...@@ -119,6 +137,14 @@ CREATE INDEX test1_id_index ON test1 (id);
</para> </para>
<para> <para>
<indexterm>
<primary>indices</primary>
<secondary>R-tree</secondary>
</indexterm>
<indexterm>
<primary>R-tree</primary>
<see>indices</see>
</indexterm>
R-tree indices are especially suited for spacial data. To create R-tree indices are especially suited for spacial data. To create
an R-tree index, use a command of the form an R-tree index, use a command of the form
<synopsis> <synopsis>
...@@ -142,6 +168,14 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> ...@@ -142,6 +168,14 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
</para> </para>
<para> <para>
<indexterm>
<primary>indices</primary>
<secondary>hash</secondary>
</indexterm>
<indexterm>
<primary>hash</primary>
<see>indices</see>
</indexterm>
The query optimizer will consider using a hash index whenever an The query optimizer will consider using a hash index whenever an
indexed column is involved in a comparison using the indexed column is involved in a comparison using the
<literal>=</literal> operator. The following command is used to <literal>=</literal> operator. The following command is used to
...@@ -177,6 +211,11 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> ...@@ -177,6 +211,11 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
<sect1 id="indices-multicolumn"> <sect1 id="indices-multicolumn">
<title>Multi-Column Indices</title> <title>Multi-Column Indices</title>
<indexterm zone="indices-multicolumn">
<primary>indices</primary>
<secondary>multi-column</secondary>
</indexterm>
<para> <para>
An index can be defined on more than one column. For example, if An index can be defined on more than one column. For example, if
you have a table of this form: you have a table of this form:
...@@ -246,6 +285,11 @@ SELECT name FROM test2 WHERE major = <replaceable>constant</replaceable> OR mino ...@@ -246,6 +285,11 @@ SELECT name FROM test2 WHERE major = <replaceable>constant</replaceable> OR mino
<sect1 id="indices-unique"> <sect1 id="indices-unique">
<title>Unique Indices</title> <title>Unique Indices</title>
<indexterm zone="indices-unique">
<primary>indices</primary>
<secondary>unique</secondary>
</indexterm>
<para> <para>
Indexes may also be used to enforce uniqueness of a column's value, Indexes may also be used to enforce uniqueness of a column's value,
or the uniqueness of the combined values of more than one column. or the uniqueness of the combined values of more than one column.
...@@ -276,6 +320,11 @@ CREATE UNIQUE INDEX <replaceable>name</replaceable> ON <replaceable>table</repla ...@@ -276,6 +320,11 @@ CREATE UNIQUE INDEX <replaceable>name</replaceable> ON <replaceable>table</repla
<sect1 id="indices-functional"> <sect1 id="indices-functional">
<title>Functional Indices</title> <title>Functional Indices</title>
<indexterm zone="indices-functional">
<primary>indices</primary>
<secondary>on functions</secondary>
</indexterm>
<para> <para>
For a <firstterm>functional index</firstterm>, an index is defined For a <firstterm>functional index</firstterm>, an index is defined
on the result of a function applied to one or more columns of a on the result of a function applied to one or more columns of a
...@@ -540,6 +589,11 @@ CREATE MEMSTORE ON <replaceable>table</replaceable> COLUMNS <replaceable>cols</r ...@@ -540,6 +589,11 @@ CREATE MEMSTORE ON <replaceable>table</replaceable> COLUMNS <replaceable>cols</r
<sect1 id="partial-index"> <sect1 id="partial-index">
<title id="partial-index-title">Partial Indices</title> <title id="partial-index-title">Partial Indices</title>
<indexterm zone="partial-index">
<primary>indices</primary>
<secondary>partial</secondary>
</indexterm>
<note> <note>
<title>Author</title> <title>Author</title>
<para> <para>
......
<chapter id="install-win32"> <chapter id="install-win32">
<title>Installation on <productname>Windows</productname></title> <title>Installation on <productname>Windows</productname></title>
<indexterm>
<primary>installation</primary>
<secondary>on Windows</secondary>
</indexterm>
<abstract> <abstract>
<para> <para>
Build, installation, and use instructions for Build, installation, and use instructions for
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.47 2001/05/09 19:41:57 momjian Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.48 2001/05/12 22:51:35 petere Exp $ -->
<chapter id="installation"> <chapter id="installation">
<title><![%flattext-install-include[<productname>PostgreSQL</>]]> <title><![%flattext-install-include[<productname>PostgreSQL</>]]>
Installation Instructions</title> Installation Instructions</title>
<indexterm zone="installation">
<primary>installation</primary>
</indexterm>
<sect1 id="install-short"> <sect1 id="install-short">
<title>Short Version</title> <title>Short Version</title>
...@@ -42,6 +46,10 @@ su - postgres ...@@ -42,6 +46,10 @@ su - postgres
The following prerequisites exist for building <productname>PostgreSQL</>: The following prerequisites exist for building <productname>PostgreSQL</>:
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<indexterm>
<primary>make</primary>
</indexterm>
<para> <para>
<acronym>GNU</> <application>make</> is required; other <acronym>GNU</> <application>make</> is required; other
<application>make</> programs will <emphasis>not</> work. <application>make</> programs will <emphasis>not</> work.
...@@ -71,6 +79,10 @@ su - postgres ...@@ -71,6 +79,10 @@ su - postgres
</listitem> </listitem>
<listitem> <listitem>
<indexterm>
<primary>readline</primary>
</indexterm>
<para> <para>
The <acronym>GNU</> <productname>Readline</> library for comfortable The <acronym>GNU</> <productname>Readline</> library for comfortable
line editing and command history retrieval will automatically be used line editing and command history retrieval will automatically be used
...@@ -83,6 +95,16 @@ su - postgres ...@@ -83,6 +95,16 @@ su - postgres
</listitem> </listitem>
<listitem> <listitem>
<indexterm>
<primary>flex</primary>
</indexterm>
<indexterm>
<primary>bison</primary>
</indexterm>
<indexterm>
<primary>yacc</primary>
</indexterm>
<para> <para>
<application>Flex</> and <application>Bison</> are <application>Flex</> and <application>Bison</> are
<emphasis>not</> required when building from a released source <emphasis>not</> required when building from a released source
...@@ -98,6 +120,10 @@ su - postgres ...@@ -98,6 +120,10 @@ su - postgres
</listitem> </listitem>
<listitem> <listitem>
<indexterm>
<primary>installation</primary>
<secondary>on Windows</secondary>
</indexterm>
<para> <para>
To build on <productname>Windows NT</> or <productname>Windows To build on <productname>Windows NT</> or <productname>Windows
2000</> you need the <productname>Cygwin</> and 2000</> you need the <productname>Cygwin</> and
...@@ -151,6 +177,10 @@ su - postgres ...@@ -151,6 +177,10 @@ su - postgres
<sect1 id="install-upgrading"> <sect1 id="install-upgrading">
<title>If You Are Upgrading</title> <title>If You Are Upgrading</title>
<indexterm zone="install-upgrading">
<primary>upgrading</primary>
</indexterm>
<para> <para>
The internal data storage format changes with new releases of The internal data storage format changes with new releases of
<productname>PostgreSQL</>. Therefore, if you are upgrading an <productname>PostgreSQL</>. Therefore, if you are upgrading an
...@@ -175,6 +205,10 @@ su - postgres ...@@ -175,6 +205,10 @@ su - postgres
</step> </step>
<step> <step>
<indexterm>
<primary>pg_dumpall</primary>
</indexterm>
<para> <para>
To dump your database installation, type: To dump your database installation, type:
<screen> <screen>
...@@ -268,6 +302,11 @@ su - postgres ...@@ -268,6 +302,11 @@ su - postgres
<step id="configure"> <step id="configure">
<title>Configuration</> <title>Configuration</>
<indexterm zone="configure">
<primary>configure</primary>
</indexterm>
<para> <para>
The first step of the installation procedure is to configure the The first step of the installation procedure is to configure the
source tree for your system and choose the options you would like. source tree for your system and choose the options you would like.
...@@ -659,6 +698,11 @@ su - postgres ...@@ -659,6 +698,11 @@ su - postgres
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<indexterm>
<primary>OpenSSL</primary>
<seealso>SSL</seealso>
</indexterm>
<term>--with-openssl=<replaceable>DIRECTORY</></term> <term>--with-openssl=<replaceable>DIRECTORY</></term>
<listitem> <listitem>
<para> <para>
...@@ -776,6 +820,10 @@ All of PostgreSQL is successfully made. Ready to install. ...@@ -776,6 +820,10 @@ All of PostgreSQL is successfully made. Ready to install.
<step> <step>
<title>Regression Tests</title> <title>Regression Tests</title>
<indexterm>
<primary>regression test</primary>
</indexterm>
<para> <para>
If you want to test the newly built server before you install it, If you want to test the newly built server before you install it,
you can run the regression tests at this point. The regression you can run the regression tests at this point. The regression
...@@ -892,6 +940,11 @@ All of PostgreSQL is successfully made. Ready to install. ...@@ -892,6 +940,11 @@ All of PostgreSQL is successfully made. Ready to install.
<sect2> <sect2>
<title>Shared Libraries</title> <title>Shared Libraries</title>
<indexterm>
<primary>shared libraries</primary>
</indexterm>
<para> <para>
On some systems that have shared libraries (which most systems do) On some systems that have shared libraries (which most systems do)
you need to tell your system how to find the newly installed you need to tell your system how to find the newly installed
...@@ -954,6 +1007,11 @@ libpq.so.2.1: cannot open shared object file: No such file or directory ...@@ -954,6 +1007,11 @@ libpq.so.2.1: cannot open shared object file: No such file or directory
<sect2> <sect2>
<title>Environment Variables</title> <title>Environment Variables</title>
<indexterm>
<primary><envar>PATH</envar></primary>
</indexterm>
<para> <para>
If you installed into <filename>/usr/local/pgsql</> or some other If you installed into <filename>/usr/local/pgsql</> or some other
location that is not searched for programs by default, you need to location that is not searched for programs by default, you need to
...@@ -972,6 +1030,10 @@ set path = ( /usr/local/pgsql/bin path ) ...@@ -972,6 +1030,10 @@ set path = ( /usr/local/pgsql/bin path )
</para> </para>
<para> <para>
<indexterm>
<primary><envar>MANPATH</envar></primary>
<seealso>man pages</seealso>
</indexterm>
To enable your system to find the <application>man</> To enable your system to find the <application>man</>
documentation, you need to add a line like the following to a documentation, you need to add a line like the following to a
shell start-up file: shell start-up file:
......
<appendix id="sql-keywords-appendix"> <appendix id="sql-keywords-appendix">
<title><acronym>SQL</acronym> Key Words</title> <title><acronym>SQL</acronym> Key Words</title>
<indexterm zone="sql-keywords-appendix">
<primary>key words</primary>
<secondary>list of</secondary>
</indexterm>
<para> <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> in the SQL standard and in <productname>PostgreSQL</productname>
......
<Chapter Id="pgtcl"> <chapter id="pgtcl">
<Title>pgtcl - TCL Binding Library</Title> <title>pgtcl - Tcl Binding Library</title>
<indexterm zone="pgtcl">
<primary>libpgtcl</primary>
</indexterm>
<indexterm zone="pgtcl">
<primary>Tcl</primary>
</indexterm>
<Para> <Para>
<literal>pgtcl</literal> is a tcl package for front-end programs <literal>pgtcl</literal> is a tcl package for front-end programs
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.62 2001/05/01 10:48:57 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.63 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="libpq"> <chapter id="libpq">
<title>libpq - C Library</title> <title>libpq - C Library</title>
<indexterm zone="libpq">
<primary>libpq</primary>
</indexterm>
<para> <para>
<filename>libpq</filename> is the <acronym>C</acronym> <filename>libpq</filename> is the <acronym>C</acronym>
application programmer's interface to application programmer's interface to
...@@ -1563,6 +1567,11 @@ if any notifications came in during the processing of the query. ...@@ -1563,6 +1567,11 @@ if any notifications came in during the processing of the query.
<sect1 id="libpq-copy"> <sect1 id="libpq-copy">
<title>Functions Associated with the COPY Command</title> <title>Functions Associated with the COPY Command</title>
<indexterm zone="libpq-copy">
<primary>COPY</primary>
<secondary>with libpq</secondary>
</indexterm>
<para> <para>
The COPY command in <productname>Postgres</productname> has options to read from The COPY command in <productname>Postgres</productname> has options to read from
or write to the network connection used by <filename>libpq</filename>. or write to the network connection used by <filename>libpq</filename>.
...@@ -1839,6 +1848,10 @@ routines like <function>PQgetvalue</function>. ...@@ -1839,6 +1848,10 @@ routines like <function>PQgetvalue</function>.
<sect1 id="libpq-envars"> <sect1 id="libpq-envars">
<title>Environment Variables</title> <title>Environment Variables</title>
<indexterm zone="libpq-envars">
<primary>environment variables</primary>
</indexterm>
<para> <para>
The following environment variables can be used to select default The following environment variables can be used to select default
connection parameter values, which will be used by <function>PQconnectdb</function> or connection parameter values, which will be used by <function>PQconnectdb</function> or
...@@ -1849,6 +1862,9 @@ application programs. ...@@ -1849,6 +1862,9 @@ application programs.
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
<indexterm>
<primary><envar>PGHOST</envar></primary>
</indexterm>
<envar>PGHOST</envar> sets the default server name. <envar>PGHOST</envar> sets the default server name.
If this begins with a slash, it specifies Unix-domain communication If this begins with a slash, it specifies Unix-domain communication
rather than TCP/IP communication; the value is the name of the rather than TCP/IP communication; the value is the name of the
...@@ -1857,6 +1873,9 @@ directory in which the socket file is stored (default "/tmp"). ...@@ -1857,6 +1873,9 @@ directory in which the socket file is stored (default "/tmp").
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<indexterm>
<primary><envar>PGPORT</envar></primary>
</indexterm>
<envar>PGPORT</envar> sets the default TCP port number or Unix-domain <envar>PGPORT</envar> sets the default TCP port number or Unix-domain
socket file extension for communicating with the socket file extension for communicating with the
<productname>Postgres</productname> backend. <productname>Postgres</productname> backend.
...@@ -1864,18 +1883,27 @@ socket file extension for communicating with the ...@@ -1864,18 +1883,27 @@ socket file extension for communicating with the
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<indexterm>
<primary><envar>PGDATABASE</envar></primary>
</indexterm>
<envar>PGDATABASE</envar> sets the default <envar>PGDATABASE</envar> sets the default
<productname>Postgres</productname> database name. <productname>Postgres</productname> database name.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<indexterm>
<primary><envar>PGUSER</envar></primary>
</indexterm>
<envar>PGUSER</envar> <envar>PGUSER</envar>
sets the username used to connect to the database and for authentication. sets the username used to connect to the database and for authentication.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<indexterm>
<primary><envar>PGPASSWORD</envar></primary>
</indexterm>
<envar>PGPASSWORD</envar> <envar>PGPASSWORD</envar>
sets the password used if the backend demands password authentication. sets the password used if the backend demands password authentication.
</para> </para>
...@@ -1957,6 +1985,11 @@ for information on correct values for these environment variables. ...@@ -1957,6 +1985,11 @@ for information on correct values for these environment variables.
<sect1 id="libpq-threading"> <sect1 id="libpq-threading">
<title>Threading Behavior</title> <title>Threading Behavior</title>
<indexterm zone="libpq-threading">
<primary>threads</primary>
<secondary>with libpq</secondary>
</indexterm>
<para> <para>
<filename>libpq</filename> is thread-safe as of <filename>libpq</filename> is thread-safe as of
<productname>Postgres</productname> 7.0, so long as no two threads <productname>Postgres</productname> 7.0, so long as no two threads
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.14 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="mvcc"> <chapter id="mvcc">
<title>Multi-Version Concurrency Control</title> <title>Multi-Version Concurrency Control</title>
<indexterm>
<primary>concurrency</primary>
</indexterm>
<abstract> <abstract>
<para> <para>
Multi-Version Concurrency Control Multi-Version Concurrency Control
...@@ -55,6 +59,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas ...@@ -55,6 +59,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas
<varlistentry> <varlistentry>
<term> <term>
dirty reads dirty reads
<indexterm><primary>dirty reads</primary></indexterm>
</term> </term>
<listitem> <listitem>
<para> <para>
...@@ -66,6 +71,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas ...@@ -66,6 +71,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas
<varlistentry> <varlistentry>
<term> <term>
non-repeatable reads non-repeatable reads
<indexterm><primary>non-repeatable reads</primary></indexterm>
</term> </term>
<listitem> <listitem>
<para> <para>
...@@ -79,6 +85,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas ...@@ -79,6 +85,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas
<varlistentry> <varlistentry>
<term> <term>
phantom read phantom read
<indexterm><primary>phantom reads</primary></indexterm>
</term> </term>
<listitem> <listitem>
<para> <para>
...@@ -92,6 +99,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas ...@@ -92,6 +99,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas
</para> </para>
<para> <para>
<indexterm>
<primary>isolation levels</primary>
</indexterm>
The four isolation levels and the corresponding behaviors are described below. The four isolation levels and the corresponding behaviors are described below.
<table tocentry="1"> <table tocentry="1">
...@@ -188,6 +198,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas ...@@ -188,6 +198,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas
<sect1 id="xact-read-committed"> <sect1 id="xact-read-committed">
<title>Read Committed Isolation Level</title> <title>Read Committed Isolation Level</title>
<indexterm>
<primary>isolation levels</primary>
<secondary>read committed</secondary>
</indexterm>
<para> <para>
<firstterm>Read Committed</firstterm> <firstterm>Read Committed</firstterm>
is the default isolation level in <productname>Postgres</productname>. is the default isolation level in <productname>Postgres</productname>.
...@@ -234,6 +249,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas ...@@ -234,6 +249,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.13 2001/04/20 15:52:33 thomas
<sect1 id="xact-serializable"> <sect1 id="xact-serializable">
<title>Serializable Isolation Level</title> <title>Serializable Isolation Level</title>
<indexterm>
<primary>isolation levels</primary>
<secondary>read serializable</secondary>
</indexterm>
<para> <para>
<firstterm>Serializable</firstterm> provides the highest transaction <firstterm>Serializable</firstterm> provides the highest transaction
isolation. This level emulates serial transaction execution, isolation. This level emulates serial transaction execution,
...@@ -350,6 +370,10 @@ ERROR: Can't serialize access due to concurrent update ...@@ -350,6 +370,10 @@ ERROR: Can't serialize access due to concurrent update
<sect1 id="locking-tables"> <sect1 id="locking-tables">
<title>Locking and Tables</title> <title>Locking and Tables</title>
<indexterm>
<primary>locking</primary>
</indexterm>
<para> <para>
<productname>Postgres</productname> <productname>Postgres</productname>
provides various lock modes to control concurrent provides various lock modes to control concurrent
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.21 2001/01/20 20:59:28 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.22 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="odbc"> <chapter id="odbc">
...@@ -19,6 +19,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.21 2001/01/20 20:59:28 ...@@ -19,6 +19,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.21 2001/01/20 20:59:28
<title>ODBC Interface</title> <title>ODBC Interface</title>
<indexterm zone="odbc">
<primary>ODBC</primary>
</indexterm>
<note> <note>
<para> <para>
Background information originally by Tim Goeke Background information originally by Tim Goeke
...@@ -80,8 +84,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.21 2001/01/20 20:59:28 ...@@ -80,8 +84,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.21 2001/01/20 20:59:28
(or any <acronym>ODBC</> driver) is that there must exist a (or any <acronym>ODBC</> driver) is that there must exist a
<firstterm>driver manager</> on the system where the <firstterm>driver manager</> on the system where the
<acronym>ODBC</> driver is to be used. There exists a free <acronym>ODBC</> driver is to be used. There exists a free
<acronym>ODBC</> driver for Unix called <productname>iODBC</> <acronym>ODBC</> driver for Unix called
which can be obtained via <ulink <indexterm><primary>iODBC</primary></indexterm>
<productname>iODBC</> which can be obtained via <ulink
url="http://www.iodbc.org">http://www.iodbc.org</ulink>. url="http://www.iodbc.org">http://www.iodbc.org</ulink>.
Instructions for installing <productname>iODBC</> are contained in Instructions for installing <productname>iODBC</> are contained in
the <productname>iODBC</> distribution. Having said that, any the <productname>iODBC</> distribution. Having said that, any
...@@ -296,6 +301,10 @@ InstallDir = /opt/applix/axdata/axshlib ...@@ -296,6 +301,10 @@ InstallDir = /opt/applix/axdata/axshlib
<sect1 id="odbc-applixware"> <sect1 id="odbc-applixware">
<title>ApplixWare</title> <title>ApplixWare</title>
<indexterm zone="odbc-applixware">
<primary>ApplixWare</primary>
</indexterm>
<para> <para>
<productname>ApplixWare</productname> has an <productname>ApplixWare</productname> has an
<acronym>ODBC</acronym> database interface <acronym>ODBC</acronym> database interface
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.7 2000/12/22 18:57:50 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.8 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="plperl"> <chapter id="plperl">
<title>PL/Perl - Perl Procedural Language</title> <title>PL/Perl - Perl Procedural Language</title>
<indexterm zone="plperl">
<primary>PL/Perl</primary>
</indexterm>
<indexterm zone="plperl">
<primary>Perl</primary>
</indexterm>
<para> <para>
PL/Perl allows you to write functions in the Perl programming PL/Perl allows you to write functions in the Perl programming
language that may be used in SQL queries as if they were built into language that may be used in SQL queries as if they were built into
...@@ -29,8 +37,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.7 2000/12/22 18:57:50 peter ...@@ -29,8 +37,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.7 2000/12/22 18:57:50 peter
In order to build and install PL/Perl if you are installing In order to build and install PL/Perl if you are installing
<productname>Postgres</productname> from source then the <productname>Postgres</productname> from source then the
<option>--with-perl</option> must be supplied to the <option>--with-perl</option> must be supplied to the
<indexterm><primary><filename>configure</filename></primary></indexterm>
<filename>configure</filename> script. PL/Perl requires that, when <filename>configure</filename> script. PL/Perl requires that, when
<productname>Perl</productname> was installed, the <productname>Perl</productname> was installed, the
<indexterm><primary>libperl</primary></indexterm>
<filename>libperl</filename> library was build as a shared object. <filename>libperl</filename> library was build as a shared object.
At the time of this writing, this is almost never the case in the At the time of this writing, this is almost never the case in the
Perl packages that are distributed with the operating systems. A Perl packages that are distributed with the operating systems. A
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.30 2001/05/11 06:10:44 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.31 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="plpgsql"> <chapter id="plpgsql">
<title>PL/pgSQL - <acronym>SQL</acronym> Procedural Language</title> <title>PL/pgSQL - <acronym>SQL</acronym> Procedural Language</title>
<indexterm zone="plpgsql">
<primary>PL/pgSQL</primary>
</indexterm>
<para> <para>
PL/pgSQL is a loadable procedural language for the PL/pgSQL is a loadable procedural language for the
<productname>Postgres</productname> database system. <productname>Postgres</productname> database system.
...@@ -1690,6 +1694,14 @@ CREATE FUNCTION c_overpaid (EMP, integer) RETURNS boolean AS ' ...@@ -1690,6 +1694,14 @@ CREATE FUNCTION c_overpaid (EMP, integer) RETURNS boolean AS '
<title>Porting from Oracle PL/SQL</title> <title>Porting from Oracle PL/SQL</title>
<indexterm>
<primary>Oracle</primary>
</indexterm>
<indexterm>
<primary>PL/SQL</primary>
</indexterm>
<note> <note>
<title>Author</title> <title>Author</title>
<para> <para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.9 2001/04/30 22:22:34 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.10 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="pltcl"> <chapter id="pltcl">
<title>PL/Tcl - TCL Procedural Language</title> <title>PL/Tcl - TCL Procedural Language</title>
<indexterm zone="pltcl">
<primary>PL/Tcl</primary>
</indexterm>
<indexterm zone="pltcl">
<primary>Tcl</primary>
</indexterm>
<para> <para>
PL/Tcl is a loadable procedural language for the PL/Tcl is a loadable procedural language for the
<productname>Postgres</productname> database system <productname>Postgres</productname> database system
...@@ -161,6 +169,11 @@ CREATE FUNCTION overpaid_2 (EMP) RETURNS bool AS ' ...@@ -161,6 +169,11 @@ CREATE FUNCTION overpaid_2 (EMP) RETURNS bool AS '
<sect2> <sect2>
<title>Trigger Procedures in PL/Tcl</title> <title>Trigger Procedures in PL/Tcl</title>
<indexterm>
<primary>triggers</primary>
<secondary>in PL/Tcl</secondary>
</indexterm>
<para> <para>
Trigger procedures are defined in <productname>Postgres</productname> Trigger procedures are defined in <productname>Postgres</productname>
as functions without as functions without
...@@ -328,6 +341,9 @@ CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab ...@@ -328,6 +341,9 @@ CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<indexterm>
<primary>elog</primary>
</indexterm>
<term>elog <replaceable>level</replaceable> <replaceable>msg</replaceable></term> <term>elog <replaceable>level</replaceable> <replaceable>msg</replaceable></term>
<listitem> <listitem>
<para> <para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.45 2001/02/03 19:03:27 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.46 2001/05/12 22:51:35 petere Exp $
--> -->
<!doctype set PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ <!doctype set PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
...@@ -35,6 +35,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.45 2001/02/03 19:03:27 pe ...@@ -35,6 +35,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.45 2001/02/03 19:03:27 pe
&programmer; &programmer;
&reference; &reference;
&developer; &developer;
&setindex;
</set> </set>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/programmer.sgml,v 1.37 2001/05/12 17:49:32 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/programmer.sgml,v 1.38 2001/05/12 22:51:35 petere Exp $
PostgreSQL Programmer's Guide. PostgreSQL Programmer's Guide.
--> -->
...@@ -63,18 +63,8 @@ PostgreSQL Programmer's Guide. ...@@ -63,18 +63,8 @@ PostgreSQL Programmer's Guide.
&xindex; &xindex;
&indexcost; &indexcost;
&gist; &gist;
&trigger;
<!-- reference --> &spi;
<!--
The func-ref chapter is not currently useful.
Disable it until we put in some info.
- thomas 1998-10-27
&func-ref;
-->
&trigger;
&spi;
</part> </part>
<part id="programmer-pl"> <part id="programmer-pl">
...@@ -89,6 +79,7 @@ Disable it until we put in some info. ...@@ -89,6 +79,7 @@ Disable it until we put in some info.
<![%single-book;[ <![%single-book;[
&biblio; &biblio;
&bookindex;
]]> ]]>
</book> </book>
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.6 2001/03/24 23:03:26 petere Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.7 2001/05/12 22:51:35 petere Exp $ -->
<chapter id="queries"> <chapter id="queries">
<title>Queries</title> <title>Queries</title>
...@@ -102,6 +102,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -102,6 +102,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
<sect3 id="queries-join"> <sect3 id="queries-join">
<title>Joined Tables</title> <title>Joined Tables</title>
<indexterm zone="queries-join">
<primary>joins</primary>
</indexterm>
<para> <para>
A joined table is a table derived from two other (real or A joined table is a table derived from two other (real or
derived) tables according to the rules of the particular join derived) tables according to the rules of the particular join
...@@ -115,6 +119,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -115,6 +119,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
<term>CROSS JOIN</term> <term>CROSS JOIN</term>
<listitem> <listitem>
<indexterm>
<primary>joins</primary>
<secondary>cross</secondary>
</indexterm>
<synopsis> <synopsis>
<replaceable>T1</replaceable> CROSS JOIN <replaceable>T2</replaceable> <replaceable>T1</replaceable> CROSS JOIN <replaceable>T2</replaceable>
</synopsis> </synopsis>
...@@ -145,6 +153,11 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -145,6 +153,11 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
<term>Qualified JOINs</term> <term>Qualified JOINs</term>
<listitem> <listitem>
<indexterm>
<primary>joins</primary>
<secondary>outer</secondary>
</indexterm>
<synopsis> <synopsis>
<replaceable>T1</replaceable> { <optional>INNER</optional> | { LEFT | RIGHT | FULL } <optional>OUTER</optional> } JOIN <replaceable>T2</replaceable> ON <replaceable>boolean_expression</replaceable> <replaceable>T1</replaceable> { <optional>INNER</optional> | { LEFT | RIGHT | FULL } <optional>OUTER</optional> } JOIN <replaceable>T2</replaceable> ON <replaceable>boolean_expression</replaceable>
<replaceable>T1</replaceable> { <optional>INNER</optional> | { LEFT | RIGHT | FULL } <optional>OUTER</optional> } JOIN <replaceable>T2</replaceable> USING ( <replaceable>join column list</replaceable> ) <replaceable>T1</replaceable> { <optional>INNER</optional> | { LEFT | RIGHT | FULL } <optional>OUTER</optional> } JOIN <replaceable>T2</replaceable> USING ( <replaceable>join column list</replaceable> )
...@@ -187,6 +200,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -187,6 +200,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
</para> </para>
<para> <para>
<indexterm>
<primary>joins</primary>
<secondary>natural</secondary>
</indexterm>
Finally, NATURAL is a shorthand form of USING: it forms a USING Finally, NATURAL is a shorthand form of USING: it forms a USING
list consisting of exactly those column names that appear in both list consisting of exactly those column names that appear in both
input tables. As with USING, these columns appear only once in input tables. As with USING, these columns appear only once in
...@@ -213,6 +230,11 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -213,6 +230,11 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
<term>LEFT OUTER JOIN</term> <term>LEFT OUTER JOIN</term>
<listitem> <listitem>
<indexterm>
<primary>joins</primary>
<secondary>left</secondary>
</indexterm>
<para> <para>
First, an INNER JOIN is performed. Then, for each row in T1 First, an INNER JOIN is performed. Then, for each row in T1
that does not satisfy the join condition with any row in that does not satisfy the join condition with any row in
...@@ -268,6 +290,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -268,6 +290,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
<sect3 id="queries-subqueries"> <sect3 id="queries-subqueries">
<title>Subqueries</title> <title>Subqueries</title>
<indexterm zone="queries-subqueries">
<primary>subqueries</primary>
</indexterm>
<para> <para>
Subqueries specifying a derived table must be enclosed in Subqueries specifying a derived table must be enclosed in
parentheses and <emphasis>must</emphasis> be named using an AS parentheses and <emphasis>must</emphasis> be named using an AS
...@@ -289,6 +315,16 @@ FROM (SELECT * FROM table1) AS alias_name ...@@ -289,6 +315,16 @@ FROM (SELECT * FROM table1) AS alias_name
<sect3 id="queries-table-aliases"> <sect3 id="queries-table-aliases">
<title>Table and Column Aliases</title> <title>Table and Column Aliases</title>
<indexterm zone="queries-table-aliases">
<primary>label</primary>
<secondary>table</secondary>
</indexterm>
<indexterm>
<primary>alias</primary>
<see>label</see>
</indexterm>
<para> <para>
A temporary name can be given to tables and complex table A temporary name can be given to tables and complex table
references to be used for references to the derived table in references to be used for references to the derived table in
...@@ -400,6 +436,10 @@ FROM (SELECT * FROM T1) DT1, T2, T3 ...@@ -400,6 +436,10 @@ FROM (SELECT * FROM T1) DT1, T2, T3
<sect2 id="queries-where"> <sect2 id="queries-where">
<title>WHERE clause</title> <title>WHERE clause</title>
<indexterm zone="queries-where">
<primary>where</primary>
</indexterm>
<para> <para>
The syntax of the WHERE clause is The syntax of the WHERE clause is
<synopsis> <synopsis>
...@@ -482,6 +522,10 @@ FROM FDT WHERE ...@@ -482,6 +522,10 @@ FROM FDT WHERE
<sect2 id="queries-group"> <sect2 id="queries-group">
<title>GROUP BY and HAVING clauses</title> <title>GROUP BY and HAVING clauses</title>
<indexterm zone="queries-group">
<primary>group</primary>
</indexterm>
<para> <para>
After passing the WHERE filter, the derived input table may be After passing the WHERE filter, the derived input table may be
subject to grouping, using the GROUP BY clause, and elimination of subject to grouping, using the GROUP BY clause, and elimination of
...@@ -578,6 +622,11 @@ SELECT pid AS "Products", ...@@ -578,6 +622,11 @@ SELECT pid AS "Products",
<sect1 id="queries-select-lists"> <sect1 id="queries-select-lists">
<title>Select Lists</title> <title>Select Lists</title>
<indexterm>
<primary>select</primary>
<secondary>select list</secondary>
</indexterm>
<para> <para>
As shown in the previous section, As shown in the previous section,
the table expression in the <command>SELECT</command> command the table expression in the <command>SELECT</command> command
...@@ -620,6 +669,11 @@ SELECT tbl1.a, tbl2.b, tbl1.c FROM ... ...@@ -620,6 +669,11 @@ SELECT tbl1.a, tbl2.b, tbl1.c FROM ...
<sect2 id="queries-column-labels"> <sect2 id="queries-column-labels">
<title>Column Labels</title> <title>Column Labels</title>
<indexterm zone="queries-column-labels">
<primary>label</primary>
<secondary>column</secondary>
</indexterm>
<para> <para>
The entries in the select list can be assigned names for further The entries in the select list can be assigned names for further
processing. The <quote>further processing</quote> in this case is processing. The <quote>further processing</quote> in this case is
...@@ -652,6 +706,10 @@ SELECT a AS value, b + c AS sum FROM ... ...@@ -652,6 +706,10 @@ SELECT a AS value, b + c AS sum FROM ...
<sect2 id="queries-distinct"> <sect2 id="queries-distinct">
<title>DISTINCT</title> <title>DISTINCT</title>
<indexterm zone="queries-distinct">
<primary>distinct</primary>
</indexterm>
<para> <para>
After the select list has been processed, the result table may After the select list has been processed, the result table may
optionally be subject to the elimination of duplicates. The optionally be subject to the elimination of duplicates. The
...@@ -700,6 +758,16 @@ SELECT DISTINCT ON (<replaceable>expression</replaceable> <optional>, <replaceab ...@@ -700,6 +758,16 @@ SELECT DISTINCT ON (<replaceable>expression</replaceable> <optional>, <replaceab
<sect1 id="queries-union"> <sect1 id="queries-union">
<title>Combining Queries</title> <title>Combining Queries</title>
<indexterm zone="queries-union">
<primary>union</primary>
</indexterm>
<indexterm zone="queries-union">
<primary>intersection</primary>
</indexterm>
<indexterm zone="queries-union">
<primary>except</primary>
</indexterm>
<para> <para>
The results of two queries can be combined using the set operations The results of two queries can be combined using the set operations
union, intersection, and difference. The syntax is union, intersection, and difference. The syntax is
...@@ -756,6 +824,11 @@ SELECT DISTINCT ON (<replaceable>expression</replaceable> <optional>, <replaceab ...@@ -756,6 +824,11 @@ SELECT DISTINCT ON (<replaceable>expression</replaceable> <optional>, <replaceab
<sect1 id="queries-order"> <sect1 id="queries-order">
<title>Sorting Rows</title> <title>Sorting Rows</title>
<indexterm zone="queries-order">
<primary>sorting</primary>
<secondary>query results</secondary>
</indexterm>
<para> <para>
After a query has produced an output table (after the select list After a query has produced an output table (after the select list
...@@ -817,6 +890,15 @@ SELECT a AS b FROM table1 ORDER BY a; ...@@ -817,6 +890,15 @@ SELECT a AS b FROM table1 ORDER BY a;
<sect1 id="queries-limit"> <sect1 id="queries-limit">
<title>LIMIT and OFFSET</title> <title>LIMIT and OFFSET</title>
<indexterm zone="queries-limit">
<primary>limit</primary>
</indexterm>
<indexterm zone="queries-limit">
<primary>offset</primary>
<secondary>with query results</secondary>
</indexterm>
<synopsis> <synopsis>
SELECT <replaceable>select_list</replaceable> FROM <replaceable>table_expression</replaceable> <optional>ORDER BY <replaceable>sort_spec</replaceable></optional> <optional>LIMIT { <replaceable>number</replaceable> | ALL }</optional> <optional>OFFSET <replaceable>number</replaceable></optional> SELECT <replaceable>select_list</replaceable> FROM <replaceable>table_expression</replaceable> <optional>ORDER BY <replaceable>sort_spec</replaceable></optional> <optional>LIMIT { <replaceable>number</replaceable> | ALL }</optional> <optional>OFFSET <replaceable>number</replaceable></optional>
</synopsis> </synopsis>
......
<Chapter Id="rules"> <Chapter Id="rules">
<Title>The <ProductName>Postgres</ProductName> Rule System</Title> <Title>The <ProductName>Postgres</ProductName> Rule System</Title>
<indexterm zone="rules">
<primary>rules</primary>
</indexterm>
<note> <note>
<title>Author</title> <title>Author</title>
<para> <para>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.66 2001/05/12 22:51:35 petere Exp $
--> -->
<Chapter Id="runtime"> <Chapter Id="runtime">
...@@ -13,6 +13,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 mom ...@@ -13,6 +13,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 mom
<sect1 id="postgres-user"> <sect1 id="postgres-user">
<title>The Postgres user account</title> <title>The Postgres user account</title>
<indexterm>
<primary>postgres user</primary>
</indexterm>
<para> <para>
As with any other server daemon that is connected to the world at As with any other server daemon that is connected to the world at
large, it is advisable to run Postgres under a separate user large, it is advisable to run Postgres under a separate user
...@@ -36,6 +40,15 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 mom ...@@ -36,6 +40,15 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 mom
<sect1 id="creating-cluster"> <sect1 id="creating-cluster">
<title>Creating a database cluster</title> <title>Creating a database cluster</title>
<indexterm>
<primary>database cluster</primary>
</indexterm>
<indexterm>
<primary>data area</primary>
<see>database cluster</see>
</indexterm>
<para> <para>
Before you can do anything, you must initialize a database storage Before you can do anything, you must initialize a database storage
area on disk. We call this a <firstterm>database area on disk. We call this a <firstterm>database
...@@ -70,6 +83,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 mom ...@@ -70,6 +83,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.65 2001/05/08 21:09:47 mom
<tip> <tip>
<para> <para>
<indexterm>
<primary><envar>PGDATA</envar></primary>
</indexterm>
As an alternative to the <option>-D</option> option, you can set As an alternative to the <option>-D</option> option, you can set
the environment variable <envar>PGDATA</envar>. the environment variable <envar>PGDATA</envar>.
</para> </para>
...@@ -129,6 +145,9 @@ NOTICE: Initializing database with en_US collation order. ...@@ -129,6 +145,9 @@ NOTICE: Initializing database with en_US collation order.
<title>Starting the database server</title> <title>Starting the database server</title>
<para> <para>
<indexterm>
<primary>postmaster</primary>
</indexterm>
Before anyone can access the database you must start the database Before anyone can access the database you must start the database
server. The database server is called server. The database server is called
<firstterm>postmaster</firstterm>. <firstterm>postmaster</firstterm>.
...@@ -157,6 +176,9 @@ NOTICE: Initializing database with en_US collation order. ...@@ -157,6 +176,9 @@ NOTICE: Initializing database with en_US collation order.
</para> </para>
<para> <para>
<indexterm>
<primary>TCP/IP</primary>
</indexterm>
The postmaster also takes a number of other command line options. The postmaster also takes a number of other command line options.
For more information see the reference page and below under runtime For more information see the reference page and below under runtime
configuration. In particular, in order for the postmaster to accept configuration. In particular, in order for the postmaster to accept
...@@ -165,6 +187,9 @@ NOTICE: Initializing database with en_US collation order. ...@@ -165,6 +187,9 @@ NOTICE: Initializing database with en_US collation order.
</para> </para>
<para> <para>
<indexterm>
<primary>pg_ctl</primary>
</indexterm>
This shell syntax can get tedious quickly. Therefore the shell This shell syntax can get tedious quickly. Therefore the shell
script wrapper <application>pg_ctl</application> is provided that script wrapper <application>pg_ctl</application> is provided that
encapsulates some of the tasks. E.g., encapsulates some of the tasks. E.g.,
...@@ -410,6 +435,11 @@ connectDBstart() -- connect() failed: No such file or directory ...@@ -410,6 +435,11 @@ connectDBstart() -- connect() failed: No such file or directory
<sect1 id="runtime-config"> <sect1 id="runtime-config">
<Title>Run-time configuration</Title> <Title>Run-time configuration</Title>
<indexterm>
<primary>configuration</primary>
<secondary>server</secondary>
</indexterm>
<para> <para>
There are a lot of configuration parameters that affect the There are a lot of configuration parameters that affect the
behavior of the database system in some way or other. Here we behavior of the database system in some way or other. Here we
...@@ -445,6 +475,9 @@ syslog = 2 ...@@ -445,6 +475,9 @@ syslog = 2
</para> </para>
<para> <para>
<indexterm>
<primary>SIGHUP</primary>
</indexterm>
The configuration file is reread whenever the postmaster receives The configuration file is reread whenever the postmaster receives
a SIGHUP signal. This signal is also propagated to all running a SIGHUP signal. This signal is also propagated to all running
backend processes, so that running sessions get the new default. backend processes, so that running sessions get the new default.
...@@ -549,6 +582,10 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -549,6 +582,10 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<indexterm>
<primary>index scan</primary>
</indexterm>
<term>ENABLE_INDEXSCAN (<type>boolean</type>)</term> <term>ENABLE_INDEXSCAN (<type>boolean</type>)</term>
<listitem> <listitem>
<para> <para>
...@@ -585,6 +622,10 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -585,6 +622,10 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<indexterm>
<primary>sequential scan</primary>
</indexterm>
<term>ENABLE_SEQSCAN (<type>boolean</type>)</term> <term>ENABLE_SEQSCAN (<type>boolean</type>)</term>
<listitem> <listitem>
<para> <para>
...@@ -623,6 +664,14 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -623,6 +664,14 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<indexterm>
<primary>genetic query optimization</primary>
</indexterm>
<indexterm>
<primary>GEQO</primary>
<see>genetic query optimization</see>
</indexterm>
<term>GEQO (<type>boolean</type>)</term> <term>GEQO (<type>boolean</type>)</term>
<listitem> <listitem>
<para> <para>
...@@ -919,6 +968,11 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -919,6 +968,11 @@ env PGOPTIONS='-c geqo=off' psql
<para> <para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<indexterm>
<primary>deadlock</primary>
<secondary>timeout</secondary>
</indexterm>
<term>DEADLOCK_TIMEOUT (<type>integer</type>)</term> <term>DEADLOCK_TIMEOUT (<type>integer</type>)</term>
<listitem> <listitem>
<para> <para>
...@@ -943,6 +997,10 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -943,6 +997,10 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<indexterm>
<primary>fsync</primary>
</indexterm>
<term>FSYNC (<type>boolean</type>)</term> <term>FSYNC (<type>boolean</type>)</term>
<listitem> <listitem>
<para> <para>
...@@ -1101,6 +1159,10 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -1101,6 +1159,10 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<indexterm>
<primary>SSL</primary>
</indexterm>
<term>SSL (<type>boolean</type>)</term> <term>SSL (<type>boolean</type>)</term>
<listitem> <listitem>
<para> <para>
...@@ -1431,6 +1493,14 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -1431,6 +1493,14 @@ env PGOPTIONS='-c geqo=off' psql
<sect2 id="sysvipc"> <sect2 id="sysvipc">
<title>Shared Memory and Semaphores</title> <title>Shared Memory and Semaphores</title>
<indexterm zone="sysvipc">
<primary>shared memory</primary>
</indexterm>
<indexterm zone="sysvipc">
<primary>semaphores</primary>
</indexterm>
<para> <para>
Shared memory and semaphores are collectively referred to as Shared memory and semaphores are collectively referred to as
<quote>System V IPC</> (together with message queues, which are <quote>System V IPC</> (together with message queues, which are
...@@ -1544,6 +1614,7 @@ env PGOPTIONS='-c geqo=off' psql ...@@ -1544,6 +1614,7 @@ env PGOPTIONS='-c geqo=off' psql
<para> <para>
<indexterm><primary>SHMMAX</primary></indexterm>
The most important shared memory parameter is <varname>SHMMAX</>, The most important shared memory parameter is <varname>SHMMAX</>,
the maximum size, in bytes, that a shared memory segment can have. the maximum size, in bytes, that a shared memory segment can have.
If you get an error message from <function>shmget</> along the If you get an error message from <function>shmget</> along the
...@@ -2015,6 +2086,10 @@ default:\ ...@@ -2015,6 +2086,10 @@ default:\
<sect1 id="ssl-tcp"> <sect1 id="ssl-tcp">
<title>Secure TCP/IP Connections with SSL</title> <title>Secure TCP/IP Connections with SSL</title>
<indexterm zone="ssl-tcp">
<primary>SSL</primary>
</indexterm>
<para> <para>
<productname>PostgreSQL</> has native support for connections over <productname>PostgreSQL</> has native support for connections over
<acronym>SSL</> to encrypt <acronym>SSL</> to encrypt
...@@ -2078,6 +2153,10 @@ cp cert.cert <replaceable>$PGDATA</replaceable>/server.crt ...@@ -2078,6 +2153,10 @@ cp cert.cert <replaceable>$PGDATA</replaceable>/server.crt
<sect1 id="ssh-tunnels"> <sect1 id="ssh-tunnels">
<title>Secure TCP/IP Connections with SSH tunnels</title> <title>Secure TCP/IP Connections with SSH tunnels</title>
<indexterm zone="ssh-tunnels">
<primary>ssh</primary>
</indexterm>
<note> <note>
<title>Acknowledgement</title> <title>Acknowledgement</title>
<para> <para>
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/stylesheet.dsl,v 1.7 2001/03/10 16:05:35 petere Exp $ --> <!-- $Header: /cvsroot/pgsql/doc/src/sgml/stylesheet.dsl,v 1.8 2001/05/12 22:51:35 petere Exp $ -->
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [ <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!-- must turn on one of these with -i on the jade command line --> <!-- must turn on one of these with -i on the jade command line -->
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
(define %html-header-tags% (define %html-header-tags%
(list (list "META" '("NAME" "creation") (list "CONTENT" (time->string (time) #t))))) (list (list "META" '("NAME" "creation") (list "CONTENT" (time->string (time) #t)))))
(define html-index #t)
]]> <!-- %output-html --> ]]> <!-- %output-html -->
<![ %output-print; [ <![ %output-print; [
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.41 2001/02/25 16:05:21 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.42 2001/05/12 22:51:35 petere Exp $
--> -->
<chapter id="sql-syntax"> <chapter id="sql-syntax">
<title>SQL Syntax</title> <title>SQL Syntax</title>
<indexterm zone="sql-syntax">
<primary>syntax</primary>
<secondary>SQL</secondary>
</indexterm>
<abstract> <abstract>
<para> <para>
A description of the general syntax of SQL. A description of the general syntax of SQL.
...@@ -70,6 +75,15 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there'); ...@@ -70,6 +75,15 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there');
<sect2 id="sql-syntax-identifiers"> <sect2 id="sql-syntax-identifiers">
<title>Identifiers and Key Words</title> <title>Identifiers and Key Words</title>
<indexterm zone="sql-syntax-identifiers">
<primary>identifiers</primary>
</indexterm>
<indexterm zone="sql-syntax-identifiers">
<primary>key words</primary>
<secondary>syntax</secondary>
</indexterm>
<para> <para>
Tokens such as <token>SELECT</token>, <token>UPDATE</token>, or Tokens such as <token>SELECT</token>, <token>UPDATE</token>, or
<token>VALUES</token> in the example above are examples of <token>VALUES</token> in the example above are examples of
...@@ -107,6 +121,10 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there'); ...@@ -107,6 +121,10 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there');
</para> </para>
<para> <para>
<indexterm>
<primary>case sensitivity</primary>
<secondary>SQL commands</secondary>
</indexterm>
Identifier and key word names are case insensitive. Therefore Identifier and key word names are case insensitive. Therefore
<programlisting> <programlisting>
UPDATE MY_TABLE SET A = 5; UPDATE MY_TABLE SET A = 5;
...@@ -123,6 +141,10 @@ UPDATE my_table SET a = 5; ...@@ -123,6 +141,10 @@ UPDATE my_table SET a = 5;
</para> </para>
<para> <para>
<indexterm>
<primary>quotes</primary>
<secondary>and identifiers</secondary>
</indexterm>
There is a second kind of identifier: the <firstterm>delimited There is a second kind of identifier: the <firstterm>delimited
identifier</firstterm> or <firstterm>quoted identifier</firstterm> or <firstterm>quoted
identifier</firstterm>. It is formed by enclosing an arbitrary identifier</firstterm>. It is formed by enclosing an arbitrary
...@@ -173,6 +195,10 @@ UPDATE "my_table" SET "a" = 5; ...@@ -173,6 +195,10 @@ UPDATE "my_table" SET "a" = 5;
<sect2 id="sql-syntax-constants"> <sect2 id="sql-syntax-constants">
<title>Constants</title> <title>Constants</title>
<indexterm zone="sql-syntax-constants">
<primary>constants</primary>
</indexterm>
<para> <para>
There are four kinds of <firstterm>implicitly typed There are four kinds of <firstterm>implicitly typed
constants</firstterm> in <productname>Postgres</productname>: constants</firstterm> in <productname>Postgres</productname>:
...@@ -186,7 +212,16 @@ UPDATE "my_table" SET "a" = 5; ...@@ -186,7 +212,16 @@ UPDATE "my_table" SET "a" = 5;
<sect3 id="sql-syntax-strings"> <sect3 id="sql-syntax-strings">
<title>String Constants</title> <title>String Constants</title>
<indexterm zone="sql-syntax-strings">
<primary>character strings</primary>
<secondary>constants</secondary>
</indexterm>
<para> <para>
<indexterm>
<primary>quotes</primary>
<secondary>escaping</secondary>
</indexterm>
A string constant in SQL is an arbitrary sequence of characters A string constant in SQL is an arbitrary sequence of characters
bounded by single quotes (<quote>'</quote>), e.g., <literal>'This bounded by single quotes (<quote>'</quote>), e.g., <literal>'This
is a string'</literal>. SQL allows single quotes to be embedded is a string'</literal>. SQL allows single quotes to be embedded
...@@ -237,6 +272,11 @@ SELECT 'foo' 'bar'; ...@@ -237,6 +272,11 @@ SELECT 'foo' 'bar';
<sect3 id="sql-syntax-bit-strings"> <sect3 id="sql-syntax-bit-strings">
<title>Bit String Constants</title> <title>Bit String Constants</title>
<indexterm zone="sql-syntax-bit-strings">
<primary>bit strings</primary>
<secondary>constants</secondary>
</indexterm>
<para> <para>
Bit string constants look like string constants with a Bit string constants look like string constants with a
<literal>B</literal> (upper or lower case) immediately before the <literal>B</literal> (upper or lower case) immediately before the
...@@ -264,6 +304,11 @@ SELECT 'foo' 'bar'; ...@@ -264,6 +304,11 @@ SELECT 'foo' 'bar';
<sect3> <sect3>
<title>Floating Point Constants</title> <title>Floating Point Constants</title>
<indexterm>
<primary>floating point</primary>
<secondary>constants</secondary>
</indexterm>
<para> <para>
Floating point constants are accepted in these general forms: Floating point constants are accepted in these general forms:
<synopsis> <synopsis>
...@@ -309,6 +354,11 @@ REAL '1.23' -- string style ...@@ -309,6 +354,11 @@ REAL '1.23' -- string style
<sect3 id="sql-syntax-constants-generic"> <sect3 id="sql-syntax-constants-generic">
<title>Constants of Other Types</title> <title>Constants of Other Types</title>
<indexterm>
<primary>data types</primary>
<secondary>constants</secondary>
</indexterm>
<para> <para>
A constant of an <emphasis>arbitrary</emphasis> type can be A constant of an <emphasis>arbitrary</emphasis> type can be
entered using any one of the following notations: entered using any one of the following notations:
...@@ -351,6 +401,11 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -351,6 +401,11 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
<sect3> <sect3>
<title>Array constants</title> <title>Array constants</title>
<indexterm>
<primary>arrays</primary>
<secondary>constants</secondary>
</indexterm>
<para> <para>
The general format of an array constant is the following: The general format of an array constant is the following:
<synopsis> <synopsis>
...@@ -390,6 +445,11 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -390,6 +445,11 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
<sect2 id="sql-syntax-operators"> <sect2 id="sql-syntax-operators">
<title>Operators</title> <title>Operators</title>
<indexterm zone="sql-syntax-operators">
<primary>operators</primary>
<secondary>syntax</secondary>
</indexterm>
<para> <para>
An operator is a sequence of up to <symbol>NAMEDATALEN</symbol>-1 An operator is a sequence of up to <symbol>NAMEDATALEN</symbol>-1
(31 by default) characters from the following list: (31 by default) characters from the following list:
...@@ -524,6 +584,11 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -524,6 +584,11 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
<sect2 id="sql-syntax-comments"> <sect2 id="sql-syntax-comments">
<title>Comments</title> <title>Comments</title>
<indexterm zone="sql-syntax-comments">
<primary>comments</primary>
<secondary>in SQL</secondary>
</indexterm>
<para> <para>
A comment is an arbitrary sequence of characters beginning with A comment is an arbitrary sequence of characters beginning with
double dashes and extending to the end of the line, e.g.: double dashes and extending to the end of the line, e.g.:
...@@ -562,11 +627,19 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -562,11 +627,19 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
is either a user-defined column of a given table or one of the is either a user-defined column of a given table or one of the
following system-defined columns: following system-defined columns:
<indexterm>
<primary>columns</primary>
<secondary>system columns</secondary>
</indexterm>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>oid</term> <term>oid</term>
<listitem> <listitem>
<para> <para>
<indexterm>
<primary>OID</primary>
</indexterm>
The unique identifier (object ID) of a row. This is a serial number The unique identifier (object ID) of a row. This is a serial number
that is added by Postgres to all rows automatically. OIDs are not that is added by Postgres to all rows automatically. OIDs are not
reused and are 32-bit quantities. reused and are 32-bit quantities.
...@@ -841,6 +914,10 @@ sqrt(2) ...@@ -841,6 +914,10 @@ sqrt(2)
<sect2 id="syntax-aggregates"> <sect2 id="syntax-aggregates">
<title>Aggregate Expressions</title> <title>Aggregate Expressions</title>
<indexterm zone="syntax-aggregates">
<primary>aggregate functions</primary>
</indexterm>
<para> <para>
An <firstterm>aggregate expression</firstterm> represents the An <firstterm>aggregate expression</firstterm> represents the
application of an aggregate function across the rows selected by a application of an aggregate function across the rows selected by a
...@@ -896,6 +973,11 @@ sqrt(2) ...@@ -896,6 +973,11 @@ sqrt(2)
<sect1 id="sql-precedence"> <sect1 id="sql-precedence">
<title>Lexical Precedence</title> <title>Lexical Precedence</title>
<indexterm zone="sql-precedence">
<primary>operators</primary>
<secondary>precedence</secondary>
</indexterm>
<para> <para>
The precedence and associativity of the operators is hard-wired The precedence and associativity of the operators is hard-wired
into the parser. Most operators have the same precedence and are into the parser. Most operators have the same precedence and are
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/user.sgml,v 1.28 2001/02/04 15:28:18 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/user.sgml,v 1.29 2001/05/12 22:51:36 petere Exp $
--> -->
<book id="user"> <book id="user">
...@@ -34,6 +34,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/user.sgml,v 1.28 2001/02/04 15:28:18 ...@@ -34,6 +34,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/user.sgml,v 1.28 2001/02/04 15:28:18
&biblio; &biblio;
<![%single-book;[
&bookindex;
]]>
</book> </book>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/xaggr.sgml,v 1.11 2001/03/24 23:03:26 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/xaggr.sgml,v 1.12 2001/05/12 22:51:36 petere Exp $
--> -->
<chapter id="xaggr"> <chapter id="xaggr">
<title>Extending <acronym>SQL</acronym>: Aggregates</title> <title>Extending <acronym>SQL</acronym>: Aggregates</title>
<indexterm zone="xaggr">
<primary>aggregate functions</primary>
<secondary>extending</secondary>
</indexterm>
<para> <para>
Aggregate functions in <productname>Postgres</productname> Aggregate functions in <productname>Postgres</productname>
are expressed as <firstterm>state values</firstterm> are expressed as <firstterm>state values</firstterm>
......
<chapter id="xtypes"> <chapter id="xtypes">
<title>Extending <acronym>SQL</acronym>: Types</title> <title>Extending <acronym>SQL</acronym>: Types</title>
<indexterm zone="xtypes">
<primary>data types</primary>
<secondary>extending</secondary>
</indexterm>
<para> <para>
As previously mentioned, there are two kinds of types As previously mentioned, there are two kinds of types
in <productname>Postgres</productname>: base types (defined in a programming language) in <productname>Postgres</productname>: base types (defined in a programming language)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment