<date>1998-09-24</date>
</refsynopsisdivinfo>
<synopsis>
-SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } {
- '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
-SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL | DEFAULT };
+SET <replaceable class="PARAMETER">variable</replaceable> { TO | = } { '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
+SET TIME ZONE { '<replaceable class="PARAMETER">timezone</replaceable>' | LOCAL | DEFAULT }
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZED }
</synopsis>
<variablelist>
<varlistentry>
<term>
- <replaceable class="PARAMETER">variable</replaceable>
+<replaceable class="PARAMETER">variable</replaceable>
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- <replaceable class="PARAMETER">value</replaceable>
+<replaceable class="PARAMETER">value</replaceable>
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- CLIENT_ENCODING | NAMES
+CLIENT_ENCODING | NAMES
</term>
<listitem>
<para>
- Sets the multi-byte client encoding
+ Sets the multi-byte client encoding. Parameters are:
<variablelist>
<varlistentry>
<term>
- <replaceable class="parameter">value</replaceable>
+<replaceable class="parameter">value</replaceable>
</term>
<listitem>
<para>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
- Sets the multi-byte client encoding.
+ Sets the multi-byte client encoding to the default value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
- DateStyle
+DateStyle
</term>
<listitem>
<para>
+ Set the date/time representation style. Affects the output format,
+ and in some cases it can affect the interpretation of input.
+
<variablelist>
<varlistentry>
<term>
- ISO
+ISO
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- SQL
+SQL
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- Postgres
+Postgres
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- European
+European
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- NonEuropean
+NonEuropean
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- German
+German
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- US
+US
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- default
+default
</term>
<listitem>
<para>
</para>
<para>
- Date format initialization my be done by:
+ Date format initialization may be done by:
<simplelist>
<member>
- Setting PGDATESTYLE environment variable.
+ Setting the <envar>PGDATESTYLE</envar> environment variable.
</member>
<member>
- Running postmaster using -oe parameter to set
- dates to the 'European' convention.
+ Running postmaster using the <option>-oe</option> parameter to set
+ dates to the <literal>European</literal> convention.
Note that this affects only the some combinations of date styles; for example
the ISO style is not affected by this parameter.
</member>
<varlistentry>
<term>
- SERVER_ENCODING
+SERVER_ENCODING
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- <replaceable class="parameter">value</replaceable>
+<replaceable class="parameter">value</replaceable>
</term>
<listitem>
<para>
- Sets the multi-byte server encoding.
+ Sets the multi-byte server encoding.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
- Sets the multi-byte server encoding.
+ Sets the multi-byte server encoding.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
- TIMEZONE
+TIMEZONE
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- 'PST8PDT'
+'PST8PDT'
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- 'Portugal'
+'Portugal'
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- 'Europe/Rome'
+'Europe/Rome'
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
<varlistentry>
<term>
- TRANSACTION ISOLATION LEVEL
+TRANSACTION ISOLATION LEVEL
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- READ COMMITTED
+READ COMMITTED
</term>
<listitem>
<para>
<varlistentry>
<term>
- SERIALIZABLE
+SERIALIZABLE
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- COST_HEAP
+COST_HEAP
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- <replaceable class="parameter">float4</replaceable>
+<replaceable class="parameter">float4</replaceable>
</term>
<listitem>
<para>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
<varlistentry>
<term>
- COST_INDEX
+COST_INDEX
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- <replaceable class="parameter">float4</replaceable>
+<replaceable class="parameter">float4</replaceable>
</term>
<listitem>
<para>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
<varlistentry>
<term>
- GEQO
+GEQO
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- ON
+ON
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- ON=<replaceable class="parameter">#</replaceable>
+ON=<replaceable class="parameter">#</replaceable>
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- OFF
+OFF
</term>
<listitem>
<para>
</varlistentry>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
<varlistentry>
<term>
- KSQO
+KSQO
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- ON
+ON
</term>
<listitem>
<para>
<varlistentry>
<term>
- OFF
+OFF
</term>
<listitem>
<para>
<varlistentry>
<term>
- DEFAULT
+DEFAULT
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- <returnvalue>SET VARIABLE</returnvalue>
+<returnvalue>SET VARIABLE</returnvalue>
</term>
<listitem>
<para>
<varlistentry>
<term>
- <returnvalue>WARN: Bad value for
- <replaceable class="parameter">variable</replaceable>
- (<replaceable class="parameter">value</replaceable>)</returnvalue>
+<returnvalue>WARN: Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue>
</term>
<listitem>
<para>
Usage
</title>
<para>
- </para>
- <programlisting>
- --Set the style of date to ISO:
- --
+ Set the style of date to ISO:
+
+ <programlisting>
SET DATESTYLE TO 'ISO';
- </programlisting>
- <programlisting>
- --Enable GEQO for queries with 4 or more tables
- --
+ </programlisting>
+
+ Enable GEQO for queries with 4 or more tables:
+
+ <programlisting>
SET GEQO ON=4;
- </programlisting>
- <programlisting>
- --Set GEQO to default:
- --
+ </programlisting>
+
+ Set GEQO to default:
+
+ <programlisting>
SET GEQO = DEFAULT;
- </programlisting>
- <programlisting>
- --set the timezone for Berkeley, California:
+ </programlisting>
+
+ Set the timezone for Berkeley, California:
+
+ <programlisting>
SET TIME ZONE 'PST8PDT';
-
SELECT CURRENT_TIMESTAMP AS today;
today
----------------------
1998-03-31 07:41:21-08
- </programlisting>
- <programlisting>
- --set the timezone for Italy:
+ </programlisting>
+
+ Set the timezone for Italy:
+
+ <programlisting>
SET TIME ZONE 'Europe/Rome';
-
SELECT CURRENT_TIMESTAMP AS today;
today
----------------------
1998-03-31 17:41:31+02
- </programlisting>
-
+ </programlisting>
+ </para>
</refsect1>
<refsect1 id="R1-SQL-SET-3">