1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2000-06-09 03:44:34 +02:00
|
|
|
<<<<<<< set.sgml
|
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.44 2000/06/09 01:44:00 momjian Exp $
|
|
|
|
=======
|
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.44 2000/06/09 01:44:00 momjian Exp $
|
|
|
|
>>>>>>> 1.43
|
1999-07-22 17:09:15 +02:00
|
|
|
Postgres documentation
|
|
|
|
-->
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refentry id="SQL-SET">
|
|
|
|
<refmeta>
|
1999-07-22 17:09:15 +02:00
|
|
|
<refentrytitle id="SQL-SET-TITLE">
|
1999-05-20 07:40:27 +02:00
|
|
|
SET
|
1999-06-04 17:50:44 +02:00
|
|
|
</refentrytitle>
|
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
1999-07-22 17:09:15 +02:00
|
|
|
<refname>
|
1999-05-20 07:40:27 +02:00
|
|
|
SET
|
1999-06-04 17:50:44 +02:00
|
|
|
</refname>
|
|
|
|
<refpurpose>
|
1998-09-01 17:53:09 +02:00
|
|
|
Set run-time parameters for session
|
1999-06-04 17:50:44 +02:00
|
|
|
</refpurpose>
|
1999-05-20 07:40:27 +02:00
|
|
|
</refnamediv>
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsynopsisdiv>
|
|
|
|
<refsynopsisdivinfo>
|
1999-07-22 17:09:15 +02:00
|
|
|
<date>1999-07-20</date>
|
1999-06-04 17:50:44 +02:00
|
|
|
</refsynopsisdivinfo>
|
|
|
|
<synopsis>
|
2000-03-31 05:20:17 +02:00
|
|
|
SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
|
2000-04-14 17:17:28 +02:00
|
|
|
SET CONSTRAINTS {ALL | <replaceable class="parameter">constraintlist</replaceable>} <replaceable>mode</replaceable>
|
1999-07-06 19:17:31 +02:00
|
|
|
SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL | DEFAULT }
|
1999-07-15 18:31:16 +02:00
|
|
|
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE }
|
1999-06-04 17:50:44 +02:00
|
|
|
</synopsis>
|
1998-09-01 17:53:09 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect2 id="R2-SQL-SET-1">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-24</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
Inputs
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1998-12-29 03:24:47 +01:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term><replaceable class="PARAMETER">variable</replaceable></term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
|
|
|
Settable global parameter.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term><replaceable class="PARAMETER">value</replaceable></term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
2000-02-19 09:14:54 +01:00
|
|
|
New value of parameter. <option>DEFAULT</option> can be
|
2000-03-31 05:20:17 +02:00
|
|
|
used to specify resetting the parameter to its default
|
|
|
|
value. Lists of strings are allowed, but more complex
|
|
|
|
constructs may need to be single or double quoted.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
|
|
|
The possible variables and allowed values are:
|
1998-12-29 03:24:47 +01:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>CLIENT_ENCODING | NAMES</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-07-06 19:17:31 +02:00
|
|
|
Sets the multi-byte client encoding. Parameters are:
|
1999-05-20 07:40:27 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term><replaceable class="parameter">value</replaceable></term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the multi-byte client encoding to
|
|
|
|
<replaceable class="parameter">value</replaceable>.
|
|
|
|
The specified encoding must be supported by the backend.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
This option is only available if MULTIBYTE support was enabled
|
|
|
|
during the configure step of building Postgres.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-04-14 17:17:28 +02:00
|
|
|
<term>DATESTYLE</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-07-06 19:17:31 +02:00
|
|
|
Set the date/time representation style. Affects the output format,
|
|
|
|
and in some cases it can affect the interpretation of input.
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>ISO</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-05-20 07:40:27 +02:00
|
|
|
use ISO 8601-style dates and times
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>SQL</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-05-20 07:40:27 +02:00
|
|
|
use Oracle/Ingres-style dates and times
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>Postgres</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-05-20 07:40:27 +02:00
|
|
|
use traditional <productname>Postgres</productname> format
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>European</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-03-31 05:20:17 +02:00
|
|
|
use <literal>dd/mm/yyyy</literal> for numeric date representations.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>NonEuropean</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-03-31 05:20:17 +02:00
|
|
|
use <literal>mm/dd/yyyy</literal> for numeric date representations.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>German</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-03-31 05:20:17 +02:00
|
|
|
use <literal>dd.mm.yyyy</literal> for numeric date representations.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>US</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-03-31 05:20:17 +02:00
|
|
|
same as <literal>NonEuropean</literal>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>DEFAULT</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-04-09 01:12:01 +02:00
|
|
|
restores the default values (<literal>ISO</literal>)
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
|
|
|
<para>
|
1999-07-06 19:17:31 +02:00
|
|
|
Date format initialization may be done by:
|
1999-06-04 17:50:44 +02:00
|
|
|
<simplelist>
|
|
|
|
<member>
|
1999-07-06 19:17:31 +02:00
|
|
|
Setting the <envar>PGDATESTYLE</envar> environment variable.
|
2000-02-15 21:49:31 +01:00
|
|
|
If PGDATESTYLE is set in the frontend environment of a client
|
|
|
|
based on libpq, libpq will automatically set DATESTYLE to the
|
|
|
|
value of PGDATESTYLE during connection startup.
|
1999-06-04 17:50:44 +02:00
|
|
|
</member>
|
|
|
|
<member>
|
1999-07-14 22:32:59 +02:00
|
|
|
Running postmaster using the option <option>-o -e</option> to set
|
1999-07-06 19:17:31 +02:00
|
|
|
dates to the <literal>European</literal> convention.
|
1999-07-14 22:32:59 +02:00
|
|
|
Note that this affects only some combinations of date styles; for example
|
1999-06-04 17:50:44 +02:00
|
|
|
the ISO style is not affected by this parameter.
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
Changing variables in
|
|
|
|
<filename>src/backend/utils/init/globals.c</filename>.
|
|
|
|
</member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The variables in <filename>globals.c</filename> which can be changed are:
|
|
|
|
<simplelist>
|
|
|
|
<member>
|
|
|
|
bool EuroDates = false | true
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
int DateStyle = USE_ISO_DATES | USE_POSTGRES_DATES | USE_SQL_DATES | USE_GERMAN_DATES
|
|
|
|
</member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-04-14 17:17:28 +02:00
|
|
|
<term>SEED</term>
|
2000-04-07 15:31:18 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the internal seed for the random number generator.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">value</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The value for the seed to be used by the
|
|
|
|
<function>random</function> catalog function. Significant
|
|
|
|
values are floating point numbers between 0 and 1, which
|
|
|
|
are then multiplied by RAND_MAX. This product will
|
|
|
|
silently overflow if a number outside the range is used.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The seed can also be set by invoking the
|
|
|
|
<function>setseed</function> SQL function:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
SELECT setseed(<replaceable>value</replaceable>);
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This option is only available if MULTIBYTE support was enabled
|
|
|
|
during the configure step of building Postgres.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>SERVER_ENCODING</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-04-14 17:17:28 +02:00
|
|
|
Sets the multi-byte server encoding to:
|
1999-06-04 17:50:44 +02:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term><replaceable class="parameter">value</replaceable></term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-04-14 17:17:28 +02:00
|
|
|
The identifying value for the server encoding.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
This option is only available if MULTIBYTE support was enabled
|
|
|
|
during the configure step of building Postgres.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
1999-05-20 07:40:27 +02:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2000-04-18 17:23:34 +02:00
|
|
|
<term>CONSTRAINTS</term>
|
2000-04-14 17:17:28 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-04-18 17:23:34 +02:00
|
|
|
SET CONSTRAINTS affects the behavior of constraint evaluation
|
|
|
|
in the current transaction.
|
|
|
|
SET CONSTRAINTS, specified
|
|
|
|
in SQL3, has these allowed parameters:
|
|
|
|
|
2000-04-14 17:17:28 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">constraintlist</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Comma separated list of deferrable constraint names.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">mode</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The constraint mode. Allowed values are
|
|
|
|
<option>DEFERRED</option> and <option>IMMEDIATE</option>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2000-04-15 01:12:29 +02:00
|
|
|
In <option>IMMEDIATE</option> mode, foreign key constraints
|
|
|
|
are checked at the end of each query.
|
2000-04-14 17:17:28 +02:00
|
|
|
</para>
|
2000-04-18 17:23:34 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
In <option>DEFERRED</option> mode, foreign key constraints
|
|
|
|
marked as <option>DEFERRABLE</option> are checked only at
|
|
|
|
transaction commit or until its mode is explicitly set to
|
|
|
|
<option>IMMEDIATE</option>.
|
|
|
|
This is actually only done for foreign key
|
|
|
|
constraints, so it does not apply to UNIQUE or other
|
|
|
|
constraints.
|
|
|
|
</para>
|
2000-04-14 17:17:28 +02:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>TIME ZONE</term>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>TIMEZONE</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The possible values for timezone depends on your operating
|
|
|
|
system. For example on Linux /usr/lib/zoneinfo contains the
|
|
|
|
database of timezones.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Here are some valid values for timezone:
|
1998-12-29 03:24:47 +01:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2000-03-31 05:20:17 +02:00
|
|
|
<term>PST8PDT</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
set the timezone for California
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2000-03-31 05:20:17 +02:00
|
|
|
<term>Portugal</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
set time zone for Portugal.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>'Europe/Rome'</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
set time zone for Italy.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>DEFAULT</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
set time zone to your local timezone
|
|
|
|
(value of the TZ environment variable).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If an invalid time zone is specified, the time zone
|
|
|
|
becomes GMT (on most systems anyway).
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The second syntax shown above, allows one to set the timezone
|
|
|
|
with a syntax similar to SQL92 <command>SET TIME ZONE</command>.
|
|
|
|
The LOCAL keyword is just an alternate form
|
|
|
|
of DEFAULT for SQL92 compatibility.
|
|
|
|
</para>
|
2000-02-15 21:49:31 +01:00
|
|
|
<para>
|
|
|
|
If the PGTZ environment variable is set in the frontend
|
|
|
|
environment of a client based on libpq, libpq will automatically
|
|
|
|
set TIMEZONE to the value of PGTZ during connection startup.
|
|
|
|
</para>
|
1999-05-20 07:40:27 +02:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>TRANSACTION ISOLATION LEVEL</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the isolation level for the current transaction.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>READ COMMITTED</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-06-08 22:01:01 +02:00
|
|
|
The current transaction queries read only rows committed
|
|
|
|
before a query began. READ COMMITTED is the default.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
1999-06-08 22:01:01 +02:00
|
|
|
|
|
|
|
<note>
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
1999-06-08 22:01:01 +02:00
|
|
|
<acronym>SQL92</acronym> standard requires
|
|
|
|
SERIALIZABLE to be the default isolation level.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
1999-06-08 22:01:01 +02:00
|
|
|
</note>
|
1999-06-04 17:50:44 +02:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>SERIALIZABLE</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-06-08 22:01:01 +02:00
|
|
|
The current transaction queries read only rows committed
|
|
|
|
before first DML statement
|
|
|
|
(<command>SELECT/INSERT/DELETE/UPDATE/FETCH/COPY_TO</command>)
|
|
|
|
was executed in this transaction.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-08 22:01:01 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-05-20 07:40:27 +02:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
|
|
|
There are also several internal or optimization
|
|
|
|
parameters which can be specified
|
|
|
|
by the <command>SET</command> command:
|
|
|
|
|
|
|
|
<variablelist>
|
2000-04-11 05:49:04 +02:00
|
|
|
<varlistentry>
|
2000-04-11 19:23:35 +02:00
|
|
|
<term>PG_OPTIONS</term>
|
2000-04-11 05:49:04 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets various backend parameters.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>RANDOM_PAGE_COST</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Sets the optimizer's estimate of the cost of a nonsequentially
|
|
|
|
fetched disk page. This is measured as a multiple of the cost
|
|
|
|
of a sequential page fetch.
|
1999-05-20 07:40:27 +02:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term><replaceable class="parameter">float8</replaceable></term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Set the cost of a random page access
|
|
|
|
to the specified floating-point value.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>CPU_TUPLE_COST</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the optimizer's estimate of the cost of processing each
|
|
|
|
tuple during a query. This is measured as a fraction of the cost
|
|
|
|
of a sequential page fetch.
|
|
|
|
|
|
|
|
<variablelist>
|
1999-05-20 07:40:27 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term><replaceable class="parameter">float8</replaceable></term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Set the cost of per-tuple CPU processing
|
|
|
|
to the specified floating-point value.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
2000-02-15 21:49:31 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>CPU_INDEX_TUPLE_COST</term>
|
|
|
|
<listitem>
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Sets the optimizer's estimate of the cost of processing each
|
|
|
|
index tuple during an index scan. This is measured as a fraction
|
|
|
|
of the cost of a sequential page fetch.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">float8</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the cost of per-index-tuple CPU processing
|
|
|
|
to the specified floating-point value.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>CPU_OPERATOR_COST</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the optimizer's estimate of the cost of processing each
|
|
|
|
operator in a WHERE clause. This is measured as a fraction
|
|
|
|
of the cost of a sequential page fetch.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">float8</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the cost of per-operator CPU processing
|
|
|
|
to the specified floating-point value.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>EFFECTIVE_CACHE_SIZE</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the optimizer's assumption about the effective size of the
|
|
|
|
disk cache (that is, the portion of the kernel's disk cache that
|
|
|
|
will be used for Postgres data files). This is measured in disk
|
|
|
|
pages, which are normally 8Kb apiece.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">float8</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the assumed cache size
|
|
|
|
to the specified floating-point value.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
2000-06-09 03:44:34 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>EXAMINE_SUBCLASS</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Changes the behaviour of SELECT so that it no longer automatically
|
|
|
|
examines sub-classes. (See SELECT). By default a SELECT on a table
|
|
|
|
will also return subclass tuples unless specifying ONLY tablename.
|
|
|
|
Setting this returns postgres to the traditional behaviour of
|
|
|
|
only returning subclasses when appending "*" to the tablename.
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Returns SELECT to the behaviour of automatically returning
|
|
|
|
results from sub-classes.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Prevents SELECT from returning sub-classes unless the "*" follows the table name
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>ENABLE_SEQSCAN</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Enables or disables the planner's use of sequential scan plan types.
|
|
|
|
(It's not possible to suppress sequential scans entirely, but turning
|
|
|
|
this variable OFF discourages the planner from using one if there is
|
|
|
|
any other method available.)
|
1999-06-04 17:50:44 +02:00
|
|
|
|
2000-02-15 21:49:31 +01:00
|
|
|
<variablelist>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>ON</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
enables use of sequential scans (default setting).
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>OFF</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
disables use of sequential scans.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
2000-02-15 21:49:31 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
2000-02-15 21:49:31 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term>ENABLE_INDEXSCAN</term>
|
|
|
|
<listitem>
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Enables or disables the planner's use of index scan plan types.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
enables use of index scans (default setting).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
disables use of index scans.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-03 20:18:43 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>ENABLE_TIDSCAN</term>
|
1999-06-03 20:18:43 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Enables or disables the planner's use of TID scan plan types.
|
1999-07-15 18:31:16 +02:00
|
|
|
|
1999-06-03 20:18:43 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>ON</term>
|
1999-06-03 20:18:43 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
enables use of TID scans (default setting).
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
disables use of TID scans.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
|
2000-02-15 21:49:31 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term>ENABLE_SORT</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Enables or disables the planner's use of explicit sort steps.
|
|
|
|
(It's not possible to suppress explicit sorts entirely, but turning
|
|
|
|
this variable OFF discourages the planner from using one if there is
|
|
|
|
any other method available.)
|
|
|
|
|
|
|
|
<variablelist>
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>ON</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
enables use of sorts (default setting).
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
disables use of sorts.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
|
2000-02-15 21:49:31 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term>ENABLE_NESTLOOP</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Enables or disables the planner's use of nested-loop join plans.
|
|
|
|
(It's not possible to suppress nested-loop joins entirely, but turning
|
|
|
|
this variable OFF discourages the planner from using one if there is
|
|
|
|
any other method available.)
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
enables use of nested-loop joins (default setting).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>OFF</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
disables use of nested-loop joins.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>ENABLE_MERGEJOIN</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Enables or disables the planner's use of mergejoin plans.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
enables use of merge joins (default setting).
|
1999-06-03 20:18:43 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
1999-06-03 20:18:43 +02:00
|
|
|
<varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
disables use of merge joins.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>ENABLE_HASHJOIN</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Enables or disables the planner's use of hashjoin plans.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON</term>
|
1999-06-03 20:18:43 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
enables use of hash joins (default setting).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
disables use of hash joins.
|
1999-06-03 20:18:43 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
2000-02-15 21:49:31 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-03 20:38:00 +02:00
|
|
|
|
2000-02-15 21:49:31 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term>GEQO</term>
|
|
|
|
<listitem>
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
Sets the threshold for using the genetic optimizer algorithm.
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
enables the genetic optimizer algorithm
|
|
|
|
for statements with 11 or more tables.
|
|
|
|
(This is also the DEFAULT setting.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>ON=<replaceable class="parameter">#</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Takes an integer argument to enable the genetic optimizer algorithm
|
|
|
|
for statements with <replaceable class="parameter">#</replaceable>
|
|
|
|
or more tables in the query.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>OFF</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
disables the genetic optimizer algorithm.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
See the chapter on GEQO in the Programmer's Guide
|
|
|
|
for more information about query optimization.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
If the PGGEQO environment variable is set in the frontend
|
|
|
|
environment of a client based on libpq, libpq will automatically
|
|
|
|
set GEQO to the value of PGGEQO during connection startup.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-06-03 20:38:00 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>KSQO</term>
|
1999-06-03 20:38:00 +02:00
|
|
|
<listitem>
|
1999-06-03 20:18:43 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
<firstterm>Key Set Query Optimizer</firstterm> causes the query
|
|
|
|
planner to convert queries whose WHERE clause contains many
|
|
|
|
OR'ed AND clauses (such as "WHERE (a=1 AND b=2) OR (a=2 AND b=3) ...")
|
|
|
|
into a UNION query. This method can be faster than the default
|
|
|
|
implementation, but it doesn't necessarily give exactly the same
|
|
|
|
results, since UNION implicitly adds a SELECT DISTINCT clause to
|
|
|
|
eliminate identical output rows. KSQO is commonly used when
|
|
|
|
working with products like <productname>MicroSoft
|
|
|
|
Access</productname>, which tend to generate queries of this form.
|
|
|
|
|
1999-06-03 20:38:00 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>ON</term>
|
1999-06-03 20:38:00 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
1999-06-04 17:50:44 +02:00
|
|
|
enables this optimization.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>OFF</term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
disables this optimization (default setting).
|
1999-06-03 20:38:00 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term>DEFAULT</term>
|
1999-06-03 20:38:00 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-03-31 05:20:17 +02:00
|
|
|
Equivalent to specifying <command>SET KSQO=OFF</command>.
|
1999-06-03 20:38:00 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
1999-06-03 20:38:00 +02:00
|
|
|
<para>
|
2000-02-15 21:49:31 +01:00
|
|
|
The KSQO algorithm used to be absolutely essential for queries
|
|
|
|
with many OR'ed AND clauses, but in Postgres 7.0 and later
|
|
|
|
the standard planner handles these queries fairly successfully.
|
1999-06-04 17:50:44 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-06-03 20:38:00 +02:00
|
|
|
|
2000-03-17 06:29:07 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term>MAX_EXPR_DEPTH</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sets the maximum expression nesting depth that the parser will
|
|
|
|
accept. The default value is high enough for any normal query,
|
|
|
|
but you can raise it if you need to. (But if you raise it too high,
|
|
|
|
you run the risk of backend crashes due to stack overflow.)
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">integer</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Maximum depth.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
1999-06-03 20:18:43 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect2 id="R2-SQL-SET-2">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-24</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
Outputs
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1999-05-20 07:40:27 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term><computeroutput>
|
|
|
|
SET VARIABLE
|
|
|
|
</computeroutput></term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-04-14 17:17:28 +02:00
|
|
|
Message returned if successful.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
<term><computeroutput>
|
2000-05-18 16:24:38 +02:00
|
|
|
NOTICE: Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)
|
1999-07-15 18:31:16 +02:00
|
|
|
</computeroutput></term>
|
1999-06-04 17:50:44 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
If the command fails to set the specified variable.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
</variablelist>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
</refsect2>
|
|
|
|
</refsynopsisdiv>
|
1999-05-20 07:40:27 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect1 id="R1-SQL-SET-1">
|
|
|
|
<refsect1info>
|
|
|
|
<date>1998-09-24</date>
|
|
|
|
</refsect1info>
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
Description
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1999-05-20 07:40:27 +02:00
|
|
|
<command>SET</command> will modify configuration parameters for variable during
|
|
|
|
a session.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Current values can be obtained using <command>SHOW</command>, and values
|
|
|
|
can be restored to the defaults using <command>RESET</command>.
|
|
|
|
Parameters and values are case-insensitive. Note that the value
|
|
|
|
field is always specified as a string, so is enclosed in
|
|
|
|
single-quotes.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<command>SET TIME ZONE</command> changes the session's
|
|
|
|
default time zone offset.
|
1999-06-04 17:50:44 +02:00
|
|
|
An SQL-session always begins with an initial default time zone
|
1999-05-20 07:40:27 +02:00
|
|
|
offset.
|
|
|
|
The <command>SET TIME ZONE</command> statement is used to change the default
|
|
|
|
time zone offset for the current SQL session.
|
|
|
|
</para>
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect2 id="R2-SQL-SET-3">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-24</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
Notes
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1999-05-20 07:40:27 +02:00
|
|
|
The <command>SET <replaceable class="parameter">variable</replaceable></command>
|
|
|
|
statement is a <productname>Postgres</productname> language extension.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Refer to <command>SHOW</command> and <command>RESET</command> to
|
|
|
|
display or reset the current values.
|
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
</refsect2>
|
|
|
|
</refsect1>
|
1999-05-20 07:40:27 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect1 id="R1-SQL-SET-2">
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
Usage
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
2000-03-31 05:20:17 +02:00
|
|
|
Set the style of date to ISO (no quotes on the argument is required):
|
|
|
|
|
1999-07-06 19:17:31 +02:00
|
|
|
<programlisting>
|
2000-03-31 05:20:17 +02:00
|
|
|
SET DATESTYLE TO ISO;
|
1999-07-06 19:17:31 +02:00
|
|
|
</programlisting>
|
|
|
|
|
2000-03-31 05:20:17 +02:00
|
|
|
Enable GEQO for queries with 4 or more tables (note the use of
|
|
|
|
single quotes to handle the equal sign inside the value argument):
|
1999-07-06 19:17:31 +02:00
|
|
|
|
|
|
|
<programlisting>
|
2000-02-27 22:07:03 +01:00
|
|
|
SET GEQO = 'ON=4';
|
1999-07-06 19:17:31 +02:00
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
Set GEQO to default:
|
|
|
|
|
|
|
|
<programlisting>
|
1999-07-15 18:31:16 +02:00
|
|
|
SET GEQO = DEFAULT;
|
1999-07-06 19:17:31 +02:00
|
|
|
</programlisting>
|
|
|
|
|
2000-03-31 05:20:17 +02:00
|
|
|
Set the timezone for Berkeley, California, using double quotes to
|
|
|
|
preserve the uppercase
|
|
|
|
attributes of the time zone specifier:
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2000-03-26 20:32:30 +02:00
|
|
|
<programlisting>
|
2000-03-31 05:20:17 +02:00
|
|
|
SET TIME ZONE "PST8PDT";
|
1999-07-15 18:31:16 +02:00
|
|
|
SELECT CURRENT_TIMESTAMP AS today;
|
1999-05-20 07:40:27 +02:00
|
|
|
|
2000-03-26 20:32:30 +02:00
|
|
|
today
|
|
|
|
------------------------
|
|
|
|
1998-03-31 07:41:21-08
|
|
|
|
</programlisting>
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2000-03-31 05:20:17 +02:00
|
|
|
Set the timezone for Italy (note the required single or double quotes to handle
|
|
|
|
the special characters):
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2000-03-26 20:32:30 +02:00
|
|
|
<programlisting>
|
1999-07-15 18:31:16 +02:00
|
|
|
SET TIME ZONE 'Europe/Rome';
|
|
|
|
SELECT CURRENT_TIMESTAMP AS today;
|
1999-05-20 07:40:27 +02:00
|
|
|
|
2000-03-26 20:32:30 +02:00
|
|
|
today
|
|
|
|
------------------------
|
|
|
|
1998-03-31 17:41:31+02
|
|
|
|
</programlisting>
|
1999-07-06 19:17:31 +02:00
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
</refsect1>
|
1998-12-29 03:24:47 +01:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect1 id="R1-SQL-SET-3">
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
Compatibility
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
1999-05-20 07:40:27 +02:00
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsect2 id="R2-SQL-SET-4">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-09-24</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
1999-05-20 07:40:27 +02:00
|
|
|
SQL92
|
1999-06-04 17:50:44 +02:00
|
|
|
</title>
|
|
|
|
<para>
|
1999-07-15 18:31:16 +02:00
|
|
|
There is no general
|
1999-05-20 07:40:27 +02:00
|
|
|
<command>SET <replaceable class="parameter">variable</replaceable></command>
|
1999-07-15 18:31:16 +02:00
|
|
|
in <acronym>SQL92</acronym> (with the exception of
|
|
|
|
<command>SET TRANSACTION ISOLATION LEVEL</command>).
|
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
The <acronym>SQL92</acronym> syntax for <command>SET TIME ZONE</command>
|
|
|
|
is slightly different,
|
|
|
|
allowing only a single integer value for time zone specification:
|
|
|
|
|
1999-07-15 18:31:16 +02:00
|
|
|
<synopsis>
|
|
|
|
SET TIME ZONE { interval_value_expression | LOCAL }
|
|
|
|
</synopsis>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</refsect2>
|
|
|
|
</refsect1>
|
1999-06-04 17:50:44 +02:00
|
|
|
</refentry>
|
1999-05-20 07:40:27 +02:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
2000-03-31 05:20:17 +02:00
|
|
|
mode:sgml
|
1999-05-20 07:40:27 +02:00
|
|
|
sgml-omittag:nil
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../reference.ced"
|
|
|
|
sgml-exposed-tags:nil
|
2000-03-31 05:20:17 +02:00
|
|
|
sgml-local-catalogs:("/usr/lib/sgml/catalog")
|
1999-05-20 07:40:27 +02:00
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|