Commit ebfbb79f authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Add input parameters for LOCK TABLE. Still needs explanation from Vadim.

Fix markup.
parent 39fc8139
<REFENTRY ID="SQL-LOCK"> <refentry id="SQL-LOCK">
<REFMETA> <refmeta>
<REFENTRYTITLE> <refentrytitle>
LOCK LOCK
</REFENTRYTITLE> </refentrytitle>
<REFMISCINFO>SQL - Language Statements</REFMISCINFO> <refmiscinfo>SQL - Language Statements</refmiscinfo>
</REFMETA> </refmeta>
<REFNAMEDIV> <refnamediv>
<REFNAME> <refname>
LOCK LOCK
</REFNAME> </refname>
<REFPURPOSE> <refpurpose>
Explicit lock of a table inside a transaction Explicit lock of a table inside a transaction
</REFPURPOSE> </refpurpose>
</refnamediv> </refnamediv>
<REFSYNOPSISDIV> <refsynopsisdiv>
<REFSYNOPSISDIVINFO> <refsynopsisdivinfo>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSYNOPSISDIVINFO> </refsynopsisdivinfo>
<SYNOPSIS> <synopsis>
LOCK [ TABLE ] [IN [ROW|ACCESS] [SHARE|EXCLUSIVE] | [SHARE ROW EXCLUSIVE] MODE] LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable>
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN [ ROW | ACCESS ] { SHARE | EXCLUSIVE } MODE
</SYNOPSIS> LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW EXCLUSIVE MODE
</synopsis>
<REFSECT2 ID="R2-SQL-LOCK-1"> <refsect2 id="R2-SQL-LOCK-1">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-01</DATE> <date>1998-09-01</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
Inputs Inputs
</TITLE> </title>
<PARA> <para>
</PARA>
<VARIABLELIST> <variablelist>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> <replaceable class="PARAMETER">table</replaceable>
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
The name of an existing table to lock. The name of an existing table to lock.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</VARIABLELIST>
<varlistentry>
</REFSECT2> <term>
SHARE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
ROW SHARE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
ROW EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<REFSECT2 ID="R2-SQL-LOCK-2"> <varlistentry>
<REFSECT2INFO> <term>
<DATE>1998-09-24</DATE> ACCESS SHARE MODE
</REFSECT2INFO> </term>
<TITLE> <listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
ACCESS EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
SHARE ROW EXCLUSIVE MODE
</term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
<refsect2 id="R2-SQL-LOCK-2">
<refsect2info>
<date>1998-09-24</date>
</refsect2info>
<title>
Outputs Outputs
</TITLE> </title>
<PARA> <para>
<VARIABLELIST> <variablelist>
<TERM> <varlistentry>
ERROR <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>: Table does not exist. <term>
</TERM> ERROR <replaceable class="PARAMETER">table</replaceable>: Table does not exist.
<LISTITEM> </term>
<PARA> <listitem>
Message returned if <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> <para>
Message returned if <replaceable class="PARAMETER">table</replaceable>
does not exist. does not exist.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</VARIABLELIST> </variablelist>
</para> </para>
</REFSECT2> </refsect2>
</REFSYNOPSISDIV> </refsynopsisdiv>
<REFSECT1 ID="R1-SQL-LOCK-1"> <refsect1 id="R1-SQL-LOCK-1">
<REFSECT1INFO> <refsect1info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT1INFO> </refsect1info>
<TITLE> <title>
Description Description
</TITLE> </title>
<PARA> <para>
By default, <command>LOCK</command> locks in exclusive mode a table inside By default, <command>LOCK</command> locks in exclusive mode a table inside
a transaction. Various options allow shared access, or row-level locking a transaction. Various options allow shared access, or row-level locking
control. The classic use for this is control. The classic use for this is
...@@ -112,13 +184,13 @@ ...@@ -112,13 +184,13 @@
</para> </para>
</note> </note>
<REFSECT2 ID="R2-SQL-LOCK-3"> <refsect2 id="R2-SQL-LOCK-3">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
Notes Notes
</TITLE> </title>
<para> <para>
<command>LOCK</command> is a <productname>Postgres</productname> <command>LOCK</command> is a <productname>Postgres</productname>
language extension. language extension.
...@@ -134,16 +206,16 @@ ...@@ -134,16 +206,16 @@
</para> </para>
</note> </note>
</para> </para>
</REFSECT2> </refsect2>
</refsect1> </refsect1>
<REFSECT1 ID="R1-SQL-LOCK-2"> <refsect1 id="R1-SQL-LOCK-2">
<TITLE> <title>
Usage Usage
</TITLE> </title>
<PARA> <para>
</PARA> </para>
<ProgramListing> <programlisting>
--Explicit locking to prevent deadlock: --Explicit locking to prevent deadlock:
-- --
BEGIN WORK; BEGIN WORK;
...@@ -152,30 +224,30 @@ ...@@ -152,30 +224,30 @@
UPDATE films SET len = INTERVAL '100 minute' UPDATE films SET len = INTERVAL '100 minute'
WHERE len = INTERVAL '117 minute'; WHERE len = INTERVAL '117 minute';
COMMIT WORK; COMMIT WORK;
</ProgramListing> </programlisting>
</REFSECT1> </refsect1>
<REFSECT1 ID="R1-SQL-LOCK-3"> <refsect1 id="R1-SQL-LOCK-3">
<TITLE> <title>
Compatibility Compatibility
</TITLE> </title>
<REFSECT2 ID="R2-SQL-LOCK-4"> <refsect2 id="R2-SQL-LOCK-4">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
SQL92 SQL92
</TITLE> </title>
<PARA> <para>
There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>, There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>,
which instead uses <command>SET TRANSACTION</command> to specify which instead uses <command>SET TRANSACTION</command> to specify
concurrency level on transactions. We support that too. concurrency level on transactions. We support that too.
</para> </para>
</refsect2> </refsect2>
</refsect1> </refsect1>
</REFENTRY> </refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
......
<REFENTRY ID="SQL-SET"> <refentry id="SQL-SET">
<REFMETA> <refmeta>
<REFENTRYTITLE> <refentrytitle>
SET SET
</REFENTRYTITLE> </refentrytitle>
<REFMISCINFO>SQL - Language Statements</REFMISCINFO> <refmiscinfo>SQL - Language Statements</refmiscinfo>
</REFMETA> </refmeta>
<REFNAMEDIV> <refnamediv>
<REFNAME> <refname>
SET SET
</REFNAME> </refname>
<REFPURPOSE> <refpurpose>
Set run-time parameters for session Set run-time parameters for session
</REFPURPOSE> </refpurpose>
</refnamediv> </refnamediv>
<REFSYNOPSISDIV> <refsynopsisdiv>
<REFSYNOPSISDIVINFO> <refsynopsisdivinfo>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSYNOPSISDIVINFO> </refsynopsisdivinfo>
<SYNOPSIS> <synopsis>
SET <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> { TO | = } { '<REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>' | DEFAULT } SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } { '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL }; SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL | DEFAULT };
</SYNOPSIS> SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZED | DEFAULT }
</synopsis>
<REFSECT2 ID="R2-SQL-SET-1"> <refsect2 id="R2-SQL-SET-1">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
Inputs Inputs
</TITLE> </title>
<PARA> <para>
<VARIABLELIST> <variablelist>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> <replaceable class="PARAMETER">variable</replaceable>
</TERM> </term>
<LISTITEM> <listitem>
<para> <para>
Settable global parameter. Settable global parameter.
</para> </para>
...@@ -44,146 +45,222 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -44,146 +45,222 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE> <replaceable class="PARAMETER">value</replaceable>
</term> </term>
<listitem> <listitem>
<PARA> <para>
New value of parameter. New value of parameter.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<para> <para>
The possible variables and allowed values are: The possible variables and allowed values are:
<VARIABLELIST> <variablelist>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
DateStyle CLIENT_ENCODING | NAMES
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
Sets the multi-byte client encoding
<VARIABLELIST> <variablelist>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
<replaceable class="parameter">value</replaceable>
</term>
<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>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the multi-byte client encoding.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
This is only enabled if multi-byte was specified to configure.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DateStyle
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
ISO ISO
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
use ISO 8601-style dates and times use ISO 8601-style dates and times
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
SQL SQL
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
use Oracle/Ingres-style dates and times use Oracle/Ingres-style dates and times
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
Postgres Postgres
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
use traditional <productname>Postgres</productname> format use traditional <productname>Postgres</productname> format
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
European European
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
use dd/mm/yyyy for numeric date representations. use dd/mm/yyyy for numeric date representations.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
NonEuropean NonEuropean
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
use mm/dd/yyyy for numeric date representations. use mm/dd/yyyy for numeric date representations.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
German German
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
use dd.mm.yyyy for numeric date representations. use dd.mm.yyyy for numeric date representations.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
US US
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
same as 'NonEuropean' same as 'NonEuropean'
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
default default
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
restores the default values ('US,Postgres') restores the default values ('US,Postgres')
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<para>
Date format initialization my be done by:
<simplelist>
<member>
Setting PGDATESTYLE environment variable.
</member>
<member>
Running postmaster using -oe parameter to set
dates to the 'European' convention.
Note that this affects only the some combinations of date styles; for example
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>
<term>
SERVER_ENCODING
</term>
<listitem>
<para>
Sets the multi-byte server encoding
<variablelist>
<varlistentry>
<term>
<replaceable class="parameter">value</replaceable>
</term>
<listitem>
<para>
Sets the multi-byte server encoding.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the multi-byte server encoding.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
This is only enabled if multi-byte was specified to configure.
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist>
</para>
<para>
Date format initialization my be done by:
<simplelist>
<member>
Setting PGDATESTYLE environment variable.
</member>
<member>
Running postmaster using -oe parameter to set
dates to the 'European' convention.
Note that this affects only the some combinations of date styles; for example
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>
<para>
<variablelist>
<varlistentry> <varlistentry>
<term> <term>
TIMEZONE TIMEZONE
...@@ -257,8 +334,59 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -257,8 +334,59 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
TRANSACTION ISOLATION LEVEL
</term>
<listitem>
<para>
Sets the isolation level for the current transaction.
<variablelist>
<varlistentry>
<term>
READ COMMITTED
</term>
<listitem>
<para>
The current transaction reads only
committed rows. READ COMMITTED is the default.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
SERIALIZABLE
</term>
<listitem>
<para>
The current transaction will place a
lock on every row read, so later reads in that transaction
see the rows unmodified by other transactions.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the isolation level for the current transaction to
<option>READ COMMITTED</option>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</para> </para>
<para> <para>
There are also several internal or optimization There are also several internal or optimization
parameters which can be specified parameters which can be specified
...@@ -301,295 +429,154 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -301,295 +429,154 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
The frontend may be initialized by setting the PGCOSTHEAP The frontend may be initialized by setting the PGCOSTHEAP
environment variable. environment variable.
</para> </para>
<variablelist>
<varlistentry>
<term>
COST_INDEX
</term>
<listitem>
<para>
Sets the default cost of an index scan for use by the optimizer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable class="parameter">float4</replaceable>
</term>
<listitem>
<para>
Set the cost of an index scan to the specified floating point value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the cost of an index scan to the default value.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
The frontend may be initialized by setting the PGCOSTINDEX
environment variable.
<variablelist>
<varlistentry>
<term>
GEQO
</term>
<listitem>
<para>
Sets the threshold for using the genetic optimizer algorithm.
</para>
<variablelist>
<varlistentry>
<term>
On
</term>
<listitem>
<para>
enables the genetic optimizer algorithm
for statements with 6 or more tables.
</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>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Equivalent to specifying <command>SET GEQO='on'</command>
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist>
</para>
<para>
This algorithm is on by default, which used GEQO for
statements of eleven or more tables.
(See the chapter on GEQO in the Programmer's Guide
for more information).
</para>
<para>
The frontend may be initialized by setting PGGEQO
environment variable.
</para>
<para>
It may be useful when joining big relations with
small ones. This algorithm is off by default.
It's not used by GEQO anyway.
<variablelist>
<varlistentry>
<term>
KSQO
</term>
<listitem>
<para>
<firstterm>Key Set Query Optimizer</firstterm> forces the query optimizer
to optimize repetative OR clauses such as generated by
<productname>MicroSoft Access</productname>:
</para>
<variablelist>
<varlistentry>
<term>
On
</term>
<listitem>
<para>
enables this optimization.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Off
</term>
<listitem>
<para>
disables this optimization.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Equivalent to specifying <command>SET KSQO='off'</command>.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
It may be useful when joining big relations with
small ones. This algorithm is off by default.
It's not used by GEQO anyway.
</para>
<para>
The frontend may be initialized by setting the PGKSQO
environment variable.
<variablelist>
<varlistentry> <varlistentry>
<term> <term>
QUERY_LIMIT COST_INDEX
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the number of rows returned by a query. Sets the default cost of an index scan for use by the optimizer.
<variablelist>
<varlistentry>
<term>
<replaceable class="parameter">float4</replaceable>
</term>
<listitem>
<para>
Set the cost of an index scan to the specified floating point value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the cost of an index scan to the default value.
</para>
</listitem>
</varlistentry>
</variablelist>
</para> </para>
<variablelist>
<varlistentry>
<term>
Value
</term>
<listitem>
<para>
Maximum number of rows to return for a query. The default is to allow
an unlimited number of rows.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable class="parameter">#</replaceable>
</term>
<listitem>
<para>
Sets the maximum number of rows returned by a
query to <replaceable class="parameter">#</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
DEFAULT
</term>
<listitem>
<para>
Sets the maximum number of rows returned by a query to be unlimited.
</para>
</listitem>
</varlistentry>
</variablelist>
<para> <para>
By default, there is no limit to the number of rows The frontend may be initialized by setting the PGCOSTINDEX
returned by a query. environment variable.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist>
<variablelist>
<varlistentry> <varlistentry>
<term> <term>
TRANSACTION ISOLATION LEVEL GEQO
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the isolation level for the current transaction. Sets the threshold for using the genetic optimizer algorithm.
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
<replaceable class="parameter">value</replaceable> ON
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the isolation level for the current transaction to enables the genetic optimizer algorithm
'SERIALIZABLE' or 'READ COMMITTED'. for statements with 6 or more tables.
SERIALIZABLE means that the current transaction will place a </para>
lock on every row read, so later reads in that transaction </listitem>
see the rows unmodified by other transactions. </varlistentry>
READ COMMITTED means that the current transaction reads only <varlistentry>
committed rows. READ COMMITTED is the default. <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> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</para>
<varlistentry> <varlistentry>
<term> <term>
DEFAULT DEFAULT
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the isolation level for the current transaction to Equivalent to specifying <command>SET GEQO='ON'</command>
'READ COMMITTED'.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<variablelist> <para>
This algorithm is on by default, which used GEQO for
statements of eleven or more tables.
(See the chapter on GEQO in the Programmer's Guide
for more information).
</para>
<para>
The frontend may be initialized by setting PGGEQO
environment variable.
</para>
<para>
It may be useful when joining big relations with
small ones. This algorithm is off by default.
It's not used by GEQO anyway.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
CLIENT_ENCODING | NAMES KSQO
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the multi-byte client encoding <firstterm>Key Set Query Optimizer</firstterm> forces the query optimizer
to optimize repetative OR clauses such as generated by
<productname>MicroSoft Access</productname>:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
<replaceable class="parameter">value</replaceable> ON
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the multi-byte client encoding. enables this optimization.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
OFF
</term>
<listitem>
<para>
disables this optimization.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</para>
<varlistentry> <varlistentry>
<term> <term>
...@@ -597,103 +584,113 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -597,103 +584,113 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the multi-byte client encoding. Equivalent to specifying <command>SET KSQO='OFF'</command>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<para> <para>
This is only enabled if multi-byte was specified to configure. It may be useful when joining big relations with
small ones. This algorithm is off by default.
It's not used by GEQO anyway.
</para> </para>
<para>
The frontend may be initialized by setting the PGKSQO
environment variable.
</para>
</listitem>
</varlistentry>
<variablelist>
<varlistentry> <varlistentry>
<term> <term>
SERVER_ENCODING QUERY_LIMIT
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the multi-byte server encoding Sets the maximum number of rows returned by a query.
By default, there is no limit to the number of rows
returned by a query.
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
<replaceable class="parameter">value</replaceable> <replaceable class="parameter">#</replaceable>
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the multi-byte server encoding. Sets the maximum number of rows returned by a
query to <replaceable class="parameter">#</replaceable>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</para>
<varlistentry> <varlistentry>
<term> <term>
DEFAULT DEFAULT
</term> </term>
<listitem> <listitem>
<para> <para>
Sets the multi-byte server encoding. Sets the maximum number of rows returned by a query to be unlimited.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</para> </para>
<para> </listitem>
This is only enabled if multi-byte was specified to configure. </varlistentry>
</para>
</variablelist>
</para>
</refsect2>
</REFSECT2> <refsect2 id="R2-SQL-SET-2">
<refsect2info>
<REFSECT2 ID="R2-SQL-SET-2"> <date>1998-09-24</date>
<REFSECT2INFO> </refsect2info>
<DATE>1998-09-24</DATE> <title>
</REFSECT2INFO>
<TITLE>
Outputs Outputs
</TITLE> </title>
<PARA> <para>
<VARIABLELIST> <variablelist>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
<returnvalue>SET VARIABLE</returnvalue> <returnvalue>SET VARIABLE</returnvalue>
</TERM> </term>
<LISTITEM> <listitem>
<PARA> <para>
Message returned if successfully. Message returned if successfully.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<VARLISTENTRY> <varlistentry>
<TERM> <term>
<returnvalue>WARN: Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue> <returnvalue>WARN: Bad value for
</TERM> <replaceable class="parameter">variable</replaceable>
<LISTITEM> (<replaceable class="parameter">value</replaceable>)</returnvalue>
<PARA> </term>
If the command fails to set variable. <listitem>
<para>
If the command fails to set the specified variable.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</VARIABLELIST> </variablelist>
</para> </para>
</REFSECT2> </refsect2>
</REFSYNOPSISDIV> </refsynopsisdiv>
<REFSECT1 ID="R1-SQL-SET-1"> <refsect1 id="R1-SQL-SET-1">
<REFSECT1INFO> <refsect1info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT1INFO> </refsect1info>
<TITLE> <title>
Description Description
</TITLE> </title>
<PARA> <para>
<command>SET</command> will modify configuration parameters for variable during <command>SET</command> will modify configuration parameters for variable during
a session. a session.
</para> </para>
...@@ -707,20 +704,20 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -707,20 +704,20 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
<para> <para>
<command>SET TIME ZONE</command> changes the session's <command>SET TIME ZONE</command> changes the session's
default time zone offset. default time zone offset.
A SQL-session always begins with an initial default time zone An SQL-session always begins with an initial default time zone
offset. offset.
The <command>SET TIME ZONE</command> statement is used to change the default The <command>SET TIME ZONE</command> statement is used to change the default
time zone offset for the current SQL session. time zone offset for the current SQL session.
</para> </para>
<REFSECT2 ID="R2-SQL-SET-3"> <refsect2 id="R2-SQL-SET-3">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
Notes Notes
</TITLE> </title>
<PARA> <para>
The <command>SET <replaceable class="parameter">variable</replaceable></command> The <command>SET <replaceable class="parameter">variable</replaceable></command>
statement is a <productname>Postgres</productname> language extension. statement is a <productname>Postgres</productname> language extension.
</para> </para>
...@@ -728,16 +725,16 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -728,16 +725,16 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
Refer to <command>SHOW</command> and <command>RESET</command> to Refer to <command>SHOW</command> and <command>RESET</command> to
display or reset the current values. display or reset the current values.
</para> </para>
</REFSECT2> </refsect2>
</REFSECT1> </refsect1>
<REFSECT1 ID="R1-SQL-SET-2"> <refsect1 id="R1-SQL-SET-2">
<TITLE> <title>
Usage Usage
</TITLE> </title>
<PARA> <para>
</PARA> </para>
<ProgramListing> <programlisting>
--Set the style of date to ISO: --Set the style of date to ISO:
-- --
SET DATESTYLE TO 'ISO'; SET DATESTYLE TO 'ISO';
...@@ -771,25 +768,25 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -771,25 +768,25 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
today today
---------------------- ----------------------
1998-03-31 17:41:31+02 1998-03-31 17:41:31+02
</ProgramListing> </programlisting>
</REFSECT1> </refsect1>
<REFSECT1 ID="R1-SQL-SET-3"> <refsect1 id="R1-SQL-SET-3">
<TITLE> <title>
Compatibility Compatibility
</TITLE> </title>
<PARA> <para>
</PARA> </para>
<REFSECT2 ID="R2-SQL-SET-4"> <refsect2 id="R2-SQL-SET-4">
<REFSECT2INFO> <refsect2info>
<DATE>1998-09-24</DATE> <date>1998-09-24</date>
</REFSECT2INFO> </refsect2info>
<TITLE> <title>
SQL92 SQL92
</TITLE> </title>
<PARA> <para>
There is no There is no
<command>SET <replaceable class="parameter">variable</replaceable></command> <command>SET <replaceable class="parameter">variable</replaceable></command>
in <acronym>SQL92</acronym>. in <acronym>SQL92</acronym>.
...@@ -804,7 +801,7 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -804,7 +801,7 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
</para> </para>
</refsect2> </refsect2>
</refsect1> </refsect1>
</REFENTRY> </refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
......
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