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