-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v 2.17 2001/10/04 04:46:43 momjian Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v 2.18 2001/11/12 19:19:39 petere Exp $ -->
<chapter id="backup">
<title>Backup and Restore</title>
+ <indexterm zone="backup"><primary>backup</></>
+
<para>
As everything that contains valuable data, <productname>Postgres</>
databases should be backed up regularly. While the procedure is
<sect1 id="migration">
<title>Migration between releases</title>
+ <indexterm zone="migration"><primary>upgrading</></>
<para>
As a general rule, the internal data storage format is subject to
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/charset.sgml,v 2.13 2001/10/31 20:35:01 petere Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/charset.sgml,v 2.14 2001/11/12 19:19:39 petere Exp $ -->
<chapter id="charset">
<title>Localization</>
<sect1 id="locale">
<title>Locale Support</title>
+ <indexterm zone="locale"><primary>locale</></>
+
<para>
<firstterm>Locale</> support refers to an application respecting
cultural preferences regarding alphabets, sorting, number
<listitem>
<para>
Sort order in <command>ORDER BY</> queries.
+ <indexterm><primary>ORDER BY</></>
</para>
</listitem>
<sect1 id="multibyte">
<title>Multibyte Support</title>
+ <indexterm zone="multibyte"><primary>multibyte</></>
+
<note>
<title>Author</title>
<sect2>
<title>About Unicode</title>
+ <indexterm><primary>Unicode</></>
+
<para>
An automatic encoding translation between Unicode and other
encodings has been supported since PostgreSQL 7.1.
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.25 2001/11/12 02:35:16 momjian Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.26 2001/11/12 19:19:39 petere Exp $ -->
<chapter id="client-authentication">
<title>Client Authentication</title>
The following describes the authentication methods in detail.
</para>
- <sect2>
+ <sect2 id="auth-password">
<title>Password authentication</title>
<indexterm>
<primary>password</primary>
</indexterm>
+ <indexterm>
+ <primary>MD5</>
+ </indexterm>
<para>
<productname>Postgres</> database passwords are separate from any
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.15 2001/10/26 19:58:12 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.16 2001/11/12 19:19:39 petere Exp $
-->
<sect2 id="dfunc">
</para>
<para>
+ <indexterm><primary>PIC</></>
Creating shared libraries is generally analoguous to linking
executables: first the source files are compiled into object files,
then the object files are linked together. The object files need to
<variablelist>
<varlistentry>
<term><productname>BSD/OS</productname></term>
+ <indexterm><primary>BSD/OS</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
<varlistentry>
<term><productname>FreeBSD</productname></term>
+ <indexterm><primary>FreeBSD</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
<varlistentry>
<term><productname>HP-UX</productname></term>
+ <indexterm><primary>HP-UX</></>
<listitem>
<para>
The compiler flag of the system compiler to create
<varlistentry>
<term><productname>Irix</productname></term>
+ <indexterm><primary>Irix</></>
<listitem>
<para>
<acronym>PIC</acronym> is the default, no special compiler
<varlistentry>
<term><productname>Linux</productname></term>
+ <indexterm><primary>Linux</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
<varlistentry>
<term><productname>NetBSD</productname></term>
+ <indexterm><primary>NetBSD</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
<varlistentry>
<term><productname>OpenBSD</productname></term>
+ <indexterm><primary>OpenBSD</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
</varlistentry>
<varlistentry>
- <term>Digital Unix/Tru64 UNIX</term>
-
- <listitem>
- <para>
- <acronym>PIC</acronym> is the default, so the compilation command
- is the usual one. <command>ld</command> with special options is
- used to do the linking:
-<programlisting>
-cc -c foo.c
-ld -shared -expect_unresolved '*' -o foo.so foo.o
-</programlisting>
- The same procedure is used with GCC instead of the system
- compiler; no special options are required.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term><productname>Solaris</productname></term>
+ <indexterm><primary>Solaris</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
</varlistentry>
<varlistentry>
+ <term>Tru64 UNIX</term>
+ <indexterm><primary>Tru64 UNIX</></>
+ <indexterm><primary>Digital UNIX</><see>Tru64 UNIX</></>
+ <listitem>
+ <para>
+ <acronym>PIC</acronym> is the default, so the compilation command
+ is the usual one. <command>ld</command> with special options is
+ used to do the linking:
+<programlisting>
+cc -c foo.c
+ld -shared -expect_unresolved '*' -o foo.so foo.o
+</programlisting>
+ The same procedure is used with GCC instead of the system
+ compiler; no special options are required.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><productname>Unixware</productname></term>
+ <indexterm><primary>Unixware</></>
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is <option>-K
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ecpg.sgml,v 1.29 2001/11/08 23:37:50 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ecpg.sgml,v 1.30 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="ecpg">
<title><application>ecpg</application> - Embedded <acronym>SQL</acronym>
in <acronym>C</acronym></title>
+ <indexterm zone="ecpg"><primary>embedded SQL</primary><secondary>in C</secondary></indexterm>
+
<para>
This describes the embedded <acronym>SQL</acronym> package for
<productname>Postgres</productname>. It works with
<variablelist>
<varlistentry>
<term>Syntax of FETCH</term>
+ <indexterm><primary>FETCH</><secondary>embedded SQL</></indexterm>
<listitem>
<para>
The standard syntax for FETCH is:
FETCH [direction] [amount] IN|FROM <replaceable>cursor</replaceable>.
</para>
<para>
- <application>ORACLE</application>, however, does not use the keywords IN
+ <indexterm><primary>Oracle</></>
+ <application>Oracle</application>, however, does not use the keywords IN
or FROM. This feature cannot be added since it would create parsing
conflicts.
</para>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.74 2001/10/31 20:39:30 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.75 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="libpq">
This routine opens a new database connection using the parameters taken
from the string <literal>conninfo</literal>. Unlike <function>PQsetdbLogin</> below,
the parameter set can be extended without changing the function signature,
- so use either of this routine or the non-blocking analogues <function>PQconnectStart</>
+ so use either of this routine or the nonblocking analogues <function>PQconnectStart</>
and <function>PQconnectPoll</function> is preferred for application programming. The passed string
can be empty to use all default parameters, or it can contain one or more
parameter settings separated by whitespace.
<para>
IP address of host to connect to. This should be in standard
numbers-and-dots form, as used by the BSD functions <function>inet_aton</> et al. If
- a non-zero-length string is specified, TCP/IP communication is used.
+ a nonzero-length string is specified, TCP/IP communication is used.
</para>
<para>
Using <literal>hostaddr</> instead of host allows the application to avoid a host
<para>
<function>PQconnectStart</function>,
<function>PQconnectPoll</function>
- Make a connection to the database server in a non-blocking manner.
+ <indexterm><primary>nonblocking connection</primary></indexterm>
+ Make a connection to the database server in a nonblocking manner.
<synopsis>
PGconn *PQconnectStart(const char *conninfo)
</synopsis>
</para>
<para>
- To begin, call <literal>conn=PQconnectStart("<connection_info_string>")</literal>.
+ To begin, call <literal>conn=PQconnectStart("<replaceable>connection_info_string</>")</literal>.
If <varname>conn</varname> is NULL, then <application>libpq</> has been unable to allocate a new <structname>PGconn</>
structure. Otherwise, a valid <structname>PGconn</> pointer is returned (though not yet
representing a valid connection to the database). On return from
</para>
<para>
- These functions leave the socket in a non-blocking state as if
+ These functions leave the socket in a nonblocking state as if
<function>PQsetnonblocking</function> had been called.
</para>
</listitem>
<para>
<function>PQresetStart</function>
<function>PQresetPoll</function>
- Reset the communication port with the backend, in a non-blocking manner.
+ Reset the communication port with the backend, in a nonblocking manner.
<synopsis>
int PQresetStart(PGconn *conn);
</synopsis>
reestablish a new connection to the same postmaster, using all the same
parameters previously used. This may be useful for error recovery if a
working connection is lost. They differ from <function>PQreset</function> (above) in that they
- act in a non-blocking manner. These functions suffer from the same
+ act in a nonblocking manner. These functions suffer from the same
restrictions as <function>PQconnectStart</> and <function>PQconnectPoll</>.
</para>
<para>
</para>
<para>
+<indexterm><primary>libpq-fe.h</></>
+<indexterm><primary>libpq-int.h</></>
<application>libpq</application> application programmers should be careful to
maintain the <structname>PGconn</structname> abstraction. Use the accessor functions below to get
at the contents of <structname>PGconn</structname>. Avoid directly referencing the fields of the
If you have old code that accesses <structname>PGconn</structname> fields directly, you can keep using it
by including <filename>libpq-int.h</filename> too, but you are encouraged to fix the code
soon.)
+
<itemizedlist>
<listitem>
<para>
<listitem>
<para>
<function>PQerrorMessage</function>
+ <indexterm><primary>error message</></>
Returns the error message most recently generated by
an operation on the connection.
<synopsis>
<listitem>
<para>
<function>PQgetssl</function>
+ <indexterm><primary>SSL</></>
Returns the SSL structure used in the connection, or NULL
if SSL is not in use.
<synopsis>
<sect2 id="libpq-exec-escape-string">
<title>Escaping strings for inclusion in SQL queries</title>
+
+ <indexterm zone="libpq-exec-escape-string"><primary>escaping strings</></>
+
<para>
<function>PQescapeString</function>
Escapes a string for use within an SQL query.
<synopsis>
size_t PQescapeString (char *to, const char *from, size_t length);
</synopsis>
-If you want to include strings which have been received
-from a source which is not trustworthy (for example, because they were
+If you want to include strings that have been received
+from a source that is not trustworthy (for example, because they were
transmitted across a network), you cannot directly include them in SQL
queries for security reasons. Instead, you have to quote special
-characters which are otherwise interpreted by the SQL parser.
+characters that are otherwise interpreted by the SQL parser.
</para>
<para>
<function>PQescapeString</> performs this operation. The
-<parameter>from</> points to the first character of the string which
+<parameter>from</> points to the first character of the string that
is to be escaped, and the <parameter>length</> parameter counts the
number of characters in this string (a terminating NUL character is
neither necessary nor counted). <parameter>to</> shall point to a
-buffer which is able to hold at least one more character than twice
+buffer that is able to hold at least one more character than twice
the value of <parameter>length</>, otherwise the behavior is
undefined. A call to <function>PQescapeString</> writes an escaped
version of the <parameter>from</> string to the <parameter>to</>
buffer, replacing special characters so that they cannot cause any
-harm, and adding a terminating NUL character. The single quotes which
+harm, and adding a terminating NUL character. The single quotes that
must surround PostgreSQL string literals are not part of the result
string.
</para>
<sect1 id="libpq-async">
<title>Asynchronous Query Processing</title>
+ <indexterm zone="libpq-async"><primary>nonblocking connection</></>
+
<para>
The <function>PQexec</function> function is adequate for submitting queries in
simple synchronous
<para>
Old applications can neglect to use <function>PQsetnonblocking</function>
and get the older potentially blocking behavior. Newer programs can use
-<function>PQsetnonblocking</function> to achieve a completely non-blocking
+<function>PQsetnonblocking</function> to achieve a completely nonblocking
connection to the backend.
<itemizedlist>
<synopsis>
int PQisnonblocking(const PGconn *conn)
</synopsis>
- Returns 1 if the connection is set to non-blocking mode,
+ Returns 1 if the connection is set to nonblocking mode,
0 if blocking.
</para>
</listitem>
<synopsis>
int PQflush(PGconn *conn);
</synopsis>
-<function>PQflush</function> needs to be called on a non-blocking connection
+<function>PQflush</function> needs to be called on a nonblocking connection
before calling <function>select</function> to determine if a response has
arrived. If 0 is returned it ensures that there is no data queued to the
backend that has not actually been sent. Only applications that have used
and/or <function>PQnotifies</function> can be used to process the response.
</para>
<para>
-Non-blocking connections (that have used <function>PQsetnonblocking</function>)
+Nonblocking connections (that have used <function>PQsetnonblocking</function>)
should not use <function>select</function> until <function>PQflush</function>
has returned 0 indicating that there is no buffered data waiting to be sent
to the backend.
<sect1 id="libpq-notify">
<title>Asynchronous Notification</title>
+ <indexterm zone="libpq-notify"><primary>NOTIFY</primary></indexterm>
+
<para>
<productname>PostgreSQL</productname> supports asynchronous notification via the
<command>LISTEN</command> and <command>NOTIFY</command> commands. A backend registers its interest in a particular
</sect1>
<sect1 id="libpq-control">
-<title>
-<application>libpq</application> Control Functions</title>
+<title><application>libpq</application> Control Functions</title>
<para>
<itemizedlist>
<listitem>
<para>
<function>PQsetNoticeProcessor</function>
+<indexterm><primary>notice processor</></>
Control reporting of notice and warning messages generated by libpq.
<synopsis>
typedef void (*PQnoticeProcessor) (void *arg, const char *message);
</para>
<para>
+ <indexterm><primary>pg_config</></>
If there is any chance that your program might be compiled by
other users then you should not hardcode the directory location
like that. Instead, you can run the utility
</para>
<para>
+ <indexterm><primary>libpq-int.h</></>
If your codes references the header file
<filename>libpq-int.h</filename> and you refuse to fix your code to
not use it, starting in PostgreSQL 7.2, this file will be found in
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/lobj.sgml,v 1.23 2001/10/09 18:46:00 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/lobj.sgml,v 1.24 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="largeObjects">
<title id="largeObjects-title">Large Objects</title>
+ <indexterm zone="largeobjects"><primary>large object</></>
+ <indexterm><primary>BLOB</><see>large object</></>
+
<sect1 id="lo-intro">
<title>Introduction</title>
</para>
<para>
+ <indexterm><primary>TOAST</></>
+ <indexterm><primary>sliced bread</><see>TOAST</></indexterm>
<productname>PostgreSQL 7.1</productname> introduced a mechanism
(nicknamed <quote><acronym>TOAST</acronym></quote>) that allows
data rows to be much larger than individual data pages. This
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/maintenance.sgml,v 1.5 2001/10/12 23:32:34 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/maintenance.sgml,v 1.6 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="maintenance">
<sect1 id="routine-vacuuming">
<title>Routine Vacuuming</title>
+ <indexterm zone="routine-vacuuming">
+ <primary>vacuum</primary>
+ </indexterm>
+
<para>
<productname>PostgreSQL</productname>'s <command>VACUUM</> command must be
run on a regular basis for several reasons:
<sect2 id="vacuum-for-space-recovery">
<title>Recovering disk space</title>
+ <indexterm zone="vacuum-for-space-recovery">
+ <primary>disk space</primary>
+ </indexterm>
+
<para>
In normal <productname>PostgreSQL</productname> operation, an UPDATE or
DELETE of a row does not immediately remove the old <firstterm>tuple</>
<sect2 id="vacuum-for-wraparound">
<title>Preventing transaction ID wraparound failures</title>
+ <indexterm zone="vacuum-for-wraparound">
+ <primary>transaction ID</primary>
+ <secondary>wraparound</secondary>
+ </indexterm>
+
<para>
<productname>PostgreSQL</productname>'s MVCC transaction semantics
depend on being able to compare transaction ID (<firstterm>XID</>)
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v 2.16 2001/10/09 18:46:00 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v 2.17 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="managing-databases">
<title>Managing Databases</title>
+ <indexterm zone="managing-databases"><primary>database</></>
+
<para>
A database is a named collection of SQL objects (<quote>database
objects</quote>); every database object (tables, function, etc.)
</para>
<formalpara>
- <title>Bootstrapping</title>
+ <title>Bootstrapping:</title>
<para>
Since you need to be connected to the database server in order to
execute the <command>CREATE DATABASE</command> command, the
</para>
<para>
+ <indexterm><primary>initlocation</></>
To create a data storage area in <envar>PGDATA2</>, ensure that
<filename>/home/postgres</filename> already exists and is writable
by the user account that runs the server (see <xref
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.3 2001/11/08 23:39:22 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.4 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="monitoring">
<sect1 id="monitoring-ps">
<title>Standard Unix Tools</Title>
+ <indexterm zone="monitoring-ps">
+ <primary>ps</primary>
+ <secondary>to monitor activity</secondary>
+ </indexterm>
+
<para>
On most platforms, <productname>PostgreSQL</productname> modifies its
command title as reported by <command>ps</>, so that individual server
<sect1 id="monitoring-stats">
<title>Statistics Collector</Title>
+ <indexterm zone="monitoring-stats">
+ <primary>statistics</primary>
+ </indexterm>
+
<para>
<productname>PostgreSQL</productname>'s <firstterm>statistics collector</>
is a subsystem that supports collection and reporting of information about
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.26 2001/10/31 20:39:30 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/Attic/odbc.sgml,v 1.27 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="odbc">
</para>
<para>
+ <indexterm><primary>odbc.sql</></>
Additionally, you should install the ODBC catalog extensions. That will
provide a number of functions mandated by the ODBC standard that are not
supplied by <productname>PostgreSQL</> by default. The file
<sect1 id="odbc-config">
<title>Configuration Files</title>
+ <indexterm zone="odbc-config"><primary>.odbc.ini</></>
+
<para>
<filename>~/.odbc.ini</filename> contains user-specified access information
for the <productname>psqlODBC</productname> driver.
<para>
Playing around with MS Access will help you sort this out. Try using
- <literal>File->Get External Data</literal>.
+ <menuchoice><guimenu>File</><guimenuitem>Get External Data</></menuchoice>.
</para>
<tip>
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.4 2001/09/13 15:55:23 petere Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.5 2001/11/12 19:19:39 petere Exp $ -->
<chapter id="plpython">
<title>PL/Python - Python Procedural Language</title>
+ <indexterm zone="plpython"><primary>PL/Python</></>
+ <indexterm zone="plpython"><primary>Python</></>
+
<note>
<para>
This chapter is not fully developed yet.
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/rules.sgml,v 1.17 2001/09/13 15:55:23 petere Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/rules.sgml,v 1.18 2001/11/12 19:19:39 petere Exp $ -->
<Chapter Id="rules">
-<Title>The <ProductName>Postgres</ProductName> Rule System</Title>
+<Title>The Rule System</Title>
<indexterm zone="rules">
<primary>rules</primary>
them. Some of these points and
the theoretical foundations of the <ProductName>Postgres</ProductName>
rule system can be found in
-[<XRef LinkEnd="STON90b" EndTerm="STON90b">].
+<XRef LinkEnd="STON90b">.
</Para>
<Para>
is very powerful, and can be used for many things such
as query language procedures, views, and versions. The
power of this rule system is discussed in
-[<XRef LinkEnd="ONG90" EndTerm="ONG90">]
+<XRef LinkEnd="ONG90">
as well as
-[<XRef LinkEnd="STON90b" EndTerm="STON90b">].
+<XRef LinkEnd="STON90b">.
</para>
<Sect1 id="querytree">
<Title>What is a Query Tree?</Title>
<Term>
the range table
</Term>
+ <indexterm><primary>range table</></>
<ListItem>
<Para>
The range table is a list of relations that are used in the query.
<Sect1 id="rules-views">
<Title>Views and the Rule System</Title>
+<indexterm zone="rules-views"><primary>rules</><secondary>and views</></>
<Sect2>
<Title>Implementation of Views in <ProductName>Postgres</ProductName></Title>
</Sect3>
</Sect2>
-<Sect2>
+<Sect2 id="rules-views-update">
<Title>What about updating a view?</Title>
+<indexterm zone="rules-views-update"><primary>views</><secondary>updating</></>
<Para>
What happens if a view is named as the target relation for an INSERT,
I think there are only a few situations out in the real
world, where such a construct is necessary. But
it makes me feel comfortable that it works.
+</Para>
- <Note>
- <Title>The truth is</Title>
+ <formalpara>
+ <Title>The truth is:</Title>
<Para>
Doing this I found one more bug while writing this document.
But after fixing that I was a little amazed that it works at all.
</Para>
- </Note>
-</Para>
+ </formalpara>
</Sect2>
</Sect1>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.93 2001/11/08 23:39:22 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.94 2001/11/12 19:19:39 petere Exp $
-->
<Chapter Id="runtime">
</para>
<para>
+ <indexterm><primary>LC_COLLATE</></>
One surprise you might encounter while running <command>initdb</command> is
a notice similar to this one:
<screen>
For <productname>FreeBSD</productname>, take a look at the file
<filename>contrib/start-scripts/freebsd</filename> in the
<productname>PostgreSQL</productname> source distribution.
+ <indexterm><primary>FreeBSD</></>
</para>
</listitem>
<para>
On <productname>OpenBSD</productname>, add the following lines
to the file <filename>/etc/rc.local</filename>:
+ <indexterm><primary>OpenBSD</></>
<programlisting>
if [ -x /usr/local/pgsql/bin/pg_ctl -a -x /usr/local/pgsql/bin/postmaster ]; then
su - -c '/usr/local/pgsql/bin/pg_ctl start -l /var/postgresql/log -s' postgres
<listitem>
<para>
On <productname>Linux</productname> systems either add
+ <indexterm><primary>Linux</></>
<programlisting>
/usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgsql/data
</programlisting>
<productname>Linux</productname> start scripts, depending on
preference, as an example and place the file at
<filename>/usr/local/etc/rc.d/postgresql</filename>.
+ <indexterm><primary>NetBSD</></>
</para>
</listitem>
On <productname>Solaris</productname>, create a file called
<filename>/etc/init.d/postgresql</filename> to contain the following
single line:
+ <indexterm><primary>Solaris</></>
<programlisting>
su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgsql/data"
</programlisting>
<variablelist>
<varlistentry>
<term><varname>AUSTRALIAN_TIMEZONES</varname> (<type>bool</type>)</term>
+ <indexterm><primary>Australian time zones</></>
<listitem>
<para>
If set to true, <literal>CST</literal>, <literal>EST</literal>,
<varlistentry>
<term><varname>AUTHENTICATION_TIMEOUT</varname> (<type>integer</type>)</term>
+ <indexterm><primary>timeout</><secondary>authentication</></indexterm>
<listitem>
<para>
Maximum time to complete client authentication, in seconds.
<primary>deadlock</primary>
<secondary>timeout</secondary>
</indexterm>
+ <indexterm>
+ <primary>timeout</primary>
+ <secondary>deadlock</secondary>
+ </indexterm>
<term><varname>DEADLOCK_TIMEOUT</varname> (<type>integer</type>)</term>
<listitem>
<varlistentry>
<term><varname>DYNAMIC_LIBRARY_PATH</varname> (<type>string</type>)</term>
+ <indexterm><primary>dynamic_library_path</></>
+ <indexterm><primary>dynamic loading</></>
<listitem>
<para>
If a dynamically loadable module needs to be opened and the
<varlistentry>
<term><varname>PORT</varname> (<type>integer</type>)</term>
+ <indexterm><primary>port</></>
<listitem>
<para>
The TCP port the server listens on; 5432 by default. This
<varlistentry>
<term><varname>SQL_INHERITANCE</varname> (<type>bool</type>)</term>
+ <indexterm><primary>inheritance</></>
<listitem>
<para>
This controls the inheritance semantics, in particular whether
<varlistentry>
<term><varname>TRANSFORM_NULL_EQUALS</varname> (<type>boolean</type>)</term>
+ <indexterm><primary>IS NULL</></>
<listitem>
<para>
When turned on, expressions of the form
<varlistentry>
<term><systemitem class="osname">BSD/OS</></term>
+ <indexterm><primary>BSD/OS</></>
<listitem>
<formalpara>
<title>Shared Memory</>
<term><systemitem class="osname">FreeBSD</></term>
<term><systemitem class="osname">NetBSD</></term>
<term><systemitem class="osname">OpenBSD</></term>
+ <indexterm><primary>FreeBSD</></>
+ <indexterm><primary>NetBSD</></>
+ <indexterm><primary>OpenBSD</></>
<listitem>
<para>
The options <varname>SYSVSHM</> and <varname>SYSVSEM</> need
<varlistentry>
<term><systemitem class="osname">HP-UX</></term>
+ <indexterm><primary>HP-UX</></>
<listitem>
<para>
The default settings tend to suffice for normal installations.
<varlistentry>
<term><systemitem class="osname">Linux</></term>
+ <indexterm><primary>Linux</></>
<listitem>
<para>
The default shared memory limit (both
<varlistentry>
<term><systemitem class="osname">SCO OpenServer</></term>
+ <indexterm><primary>SCO OpenServer</></>
<listitem>
<para>
In the default configuration, only 512 kB of shared memory per
<varlistentry>
<term><systemitem class="osname">Solaris</></term>
+ <indexterm><primary>Solaris</></>
<listitem>
<para>
At least in version 2.6, the maximum size of a shared memory
<varlistentry>
<term><systemitem class="osname">UnixWare</></term>
+ <indexterm><primary>Unixware</></>
<listitem>
<para>
On <productname>UnixWare</> 7, the maximum size for shared
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.41 2001/11/01 04:07:29 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.42 2001/11/12 19:19:39 petere Exp $
-->
<chapter id="xfunc">
<title id="xfunc-title">Extending <acronym>SQL</acronym>: Functions</title>
+ <indexterm zone="xfunc"><primary>function</></>
+
<sect1 id="xfunc-intro">
<title>Introduction</title>
<sect1 id="xfunc-sql">
<title>Query Language (<acronym>SQL</acronym>) Functions</title>
+ <indexterm zone="xfunc-sql"><primary>function</><secondary>SQL</></>
+
<para>
SQL functions execute an arbitrary list of SQL statements, returning
the result of the last query in the list, which must be a
</para>
<para>
+ <indexterm><primary>SETOF</><seealso>function</></>
Alternatively, an SQL function may be declared to return a set,
by specifying the function's return type
as <literal>SETOF</literal> <replaceable>sometype</>. In this case
<sect1 id="xfunc-internal">
<title>Internal Functions</title>
+ <indexterm zone="xfunc-internal"><primary>function</><secondary>internal</></>
+
<para>
Internal functions are functions written in C that have been statically
linked into the <productname>PostgreSQL</productname> server.
<para>
If the name starts with the string <literal>$libdir</literal>,
that part is replaced by the PostgreSQL package library directory
- name, which is determined at build time.
+ name, which is determined at build time.<indexterm><primary>$libdir</></>
</para>
</listitem>
<para>
If the name does not contain a directory part, the file is
searched for in the path specified by the configuration variable
- <varname>dynamic_library_path</varname>.
+ <varname>dynamic_library_path</varname>.<indexterm><primary>dynamic_library_path</></>
</para>
</listitem>
<itemizedlist>
<listitem>
<para>
- Use <literal>pg_config --includedir-server</literal> to find
+ Use <literal>pg_config --includedir-server</literal><indexterm><primary>pg_config</></> to find
out where the PostgreSQL server header files are installed on
your system (or the system that your users will be running
on). This option is new with PostgreSQL 7.2. For PostgreSQL
<sect1 id="xfunc-overload">
<title>Function Overloading</title>
+ <indexterm zone="xfunc-overload"><primary>overloading</></>
+
<para>
More than one function may be defined with the same SQL name, so long
as the arguments they take are different. In other words,