1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2003-01-12 02:33:00 +01:00
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.71 2003/01/12 01:33:00 momjian Exp $
|
2001-12-08 04:24:40 +01:00
|
|
|
PostgreSQL documentation
|
1999-07-22 17:09:15 +02:00
|
|
|
-->
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<refentry id="SQL-SET">
|
|
|
|
<refmeta>
|
2000-06-18 23:24:54 +02:00
|
|
|
<refentrytitle id="SQL-SET-TITLE">SET</refentrytitle>
|
1999-06-04 17:50:44 +02:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
2000-06-18 23:24:54 +02:00
|
|
|
<refname>SET</refname>
|
2001-09-03 14:57:50 +02:00
|
|
|
<refpurpose>change a run-time parameter</refpurpose>
|
1999-05-20 07:40:27 +02:00
|
|
|
</refnamediv>
|
1999-06-04 17:50:44 +02:00
|
|
|
<refsynopsisdiv>
|
|
|
|
<synopsis>
|
2002-05-17 03:19:19 +02:00
|
|
|
SET [ SESSION | LOCAL ] <replaceable class="PARAMETER">variable</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
|
|
|
|
SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</replaceable> | LOCAL | DEFAULT }
|
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">
|
2000-06-18 23:24:54 +02:00
|
|
|
<title>Inputs</title>
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
|
|
|
<variablelist>
|
2002-05-17 03:19:19 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>SESSION</></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Specifies that the command takes effect for the current session.
|
2002-06-11 17:44:38 +02:00
|
|
|
(This is the default if neither <option>SESSION</> nor
|
|
|
|
<option>LOCAL</> appears.)
|
2002-05-17 03:19:19 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>LOCAL</></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Specifies that the command takes effect for only the current
|
2002-06-11 17:44:38 +02:00
|
|
|
transaction. After <command>COMMIT</> or <command>ROLLBACK</>,
|
|
|
|
the session-level setting takes effect again. Note that
|
|
|
|
<command>SET LOCAL</> will appear to have no effect if it's
|
|
|
|
executed outside a <command>BEGIN</> block, since the transaction
|
|
|
|
will end immediately.
|
2002-05-17 03:19:19 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
1999-06-04 17:50:44 +02:00
|
|
|
<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>
|
2002-04-21 21:02:39 +02:00
|
|
|
A settable run-time parameter.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2002-05-17 03:19:19 +02:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<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>
|
2002-04-21 21:02:39 +02:00
|
|
|
New value of parameter. <option>DEFAULT</option> can be
|
|
|
|
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>
|
2000-06-18 23:24:54 +02:00
|
|
|
</refsect2>
|
1999-06-04 17:50:44 +02:00
|
|
|
|
2000-06-18 23:24:54 +02:00
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-SET-1">
|
|
|
|
<title>Description</title>
|
2002-05-17 03:19:19 +02:00
|
|
|
|
2000-06-18 23:24:54 +02:00
|
|
|
<para>
|
|
|
|
The <command>SET</command> command changes run-time configuration
|
2002-05-17 03:19:19 +02:00
|
|
|
parameters. Many of the run-time parameters listed in the
|
|
|
|
<citetitle>Administrator's Guide</citetitle> can be changed on-the-fly
|
|
|
|
with <command>SET</command>. (But some require superuser privileges
|
|
|
|
to change, and others cannot be changed after server or session start.)
|
|
|
|
Note that <command>SET</command> only affects the value used by the
|
|
|
|
current session.
|
|
|
|
</para>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
2002-05-17 03:19:19 +02:00
|
|
|
<para>
|
|
|
|
If <command>SET</command> or <command>SET SESSION</command> is issued
|
|
|
|
within a transaction that is later aborted, the effects of the
|
|
|
|
<command>SET</command> command disappear when the transaction is rolled
|
|
|
|
back. (This behavior represents a change from
|
|
|
|
<productname>PostgreSQL</productname> versions prior to 7.3, where
|
|
|
|
the effects of <command>SET</command> would not roll back after a later
|
|
|
|
error.) Once the surrounding transaction is committed, the effects
|
|
|
|
will persist until the end of the session, unless overridden by another
|
|
|
|
<command>SET</command>.
|
|
|
|
</para>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
2002-05-17 03:19:19 +02:00
|
|
|
<para>
|
|
|
|
The effects of <command>SET LOCAL</command> last only till the end of
|
|
|
|
the current transaction, whether committed or not. A special case is
|
|
|
|
<command>SET</command> followed by <command>SET LOCAL</command> within
|
|
|
|
a single transaction: the <command>SET LOCAL</command> value will be
|
|
|
|
seen until the end of the transaction, but afterwards (if the transaction
|
|
|
|
is committed) the <command>SET</command> value will take effect.
|
|
|
|
</para>
|
|
|
|
|
2002-10-09 06:59:38 +02:00
|
|
|
<para>
|
2002-10-13 18:55:05 +02:00
|
|
|
Even with <literal>autocommit</> set to <literal>off</>, <command>SET</>
|
2002-10-09 06:59:38 +02:00
|
|
|
does not start a new transaction block. See the
|
2002-10-13 18:55:05 +02:00
|
|
|
<literal>autocommit</> section of the <citetitle>Administrator's
|
|
|
|
Guide</citetitle> for details.
|
2002-10-09 06:59:38 +02:00
|
|
|
</para>
|
|
|
|
|
2002-05-17 03:19:19 +02:00
|
|
|
<para>
|
|
|
|
Here are additional details about a few of the parameters that can be set:
|
|
|
|
|
|
|
|
<variablelist>
|
2000-06-18 23:24:54 +02:00
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><varname>DATESTYLE</></term>
|
2000-06-18 23:24:54 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Choose the date/time representation style. Two separate
|
2002-05-17 03:19:19 +02:00
|
|
|
settings are involved: the default date/time output and the
|
2000-06-18 23:24:54 +02:00
|
|
|
interpretation of ambiguous input.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The following are date/time output styles:
|
|
|
|
|
|
|
|
<variablelist>
|
2002-06-11 17:44:38 +02:00
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><literal>ISO</></term>
|
2002-06-11 17:44:38 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Use ISO 8601-style dates and times (<literal>YYYY-MM-DD
|
|
|
|
HH:MM:SS</literal>). This is the default.
|
2000-06-18 23:24:54 +02:00
|
|
|
</para>
|
2002-06-11 17:44:38 +02:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><literal>SQL</></term>
|
2002-06-11 17:44:38 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Use Oracle/Ingres-style dates and times. Note that this
|
|
|
|
style has nothing to do with SQL (which mandates ISO 8601
|
|
|
|
style), the naming of this option is a historical accident.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><literal>PostgreSQL</></term>
|
2002-06-11 17:44:38 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Use traditional <productname>PostgreSQL</productname> format.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><literal>German</></term>
|
2002-06-11 17:44:38 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Use <literal>dd.mm.yyyy</literal> for numeric date representations.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The following two options determine both a substyle of the
|
2001-12-08 04:24:40 +01:00
|
|
|
<quote>SQL</quote> and <quote>PostgreSQL</quote> output formats
|
2000-06-18 23:24:54 +02:00
|
|
|
and the preferred interpretation of ambiguous date input.
|
|
|
|
|
|
|
|
<variablelist>
|
2002-06-11 17:44:38 +02:00
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><literal>European</></term>
|
2002-06-11 17:44:38 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Use <literal>dd/mm/yyyy</literal> for numeric date representations.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
2002-09-21 20:32:54 +02:00
|
|
|
<term><literal>NonEuropean</></term>
|
|
|
|
<term><literal>US</></term>
|
2002-06-11 17:44:38 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Use <literal>mm/dd/yyyy</literal> for numeric date representations.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A value for <command>SET DATESTYLE</command> can be one from
|
|
|
|
the first list (output styles), or one from the second list
|
|
|
|
(substyles), or one from each separated by a comma.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2002-05-17 03:19:19 +02:00
|
|
|
<command>SET DATESTYLE</command> affects interpretation of
|
|
|
|
input and provides several standard output formats. For
|
|
|
|
applications needing different variations or tighter control
|
|
|
|
over input or output, consider using
|
|
|
|
the <function>to_char</function> family of
|
|
|
|
functions.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2002-09-21 20:32:54 +02:00
|
|
|
There are several now-deprecated means for setting the date style
|
2002-05-17 03:19:19 +02:00
|
|
|
in addition to the normal methods of setting it via <command>SET</> or
|
|
|
|
a configuration-file entry:
|
2000-06-18 23:24:54 +02:00
|
|
|
<simplelist>
|
2002-06-11 17:44:38 +02:00
|
|
|
<member>
|
|
|
|
Setting the postmaster's <envar>PGDATESTYLE</envar> environment
|
|
|
|
variable. (This will be overridden by any of the other methods.)
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
Running postmaster using the option <option>-o -e</option> to
|
|
|
|
set dates to the <literal>European</literal> convention.
|
|
|
|
(This overrides environment variables and configuration-file
|
|
|
|
entries.)
|
|
|
|
</member>
|
|
|
|
<member>
|
|
|
|
Setting the client's <envar>PGDATESTYLE</envar> environment variable.
|
2002-09-21 20:32:54 +02:00
|
|
|
If <envar>PGDATESTYLE</envar> is set in the frontend environment of a client
|
|
|
|
based on <application>libpq</>, <application>libpq</> will automatically set <varname>DATESTYLE</> to the
|
|
|
|
value of <envar>PGDATESTYLE</envar> during connection start-up. This is
|
2002-06-11 17:44:38 +02:00
|
|
|
equivalent to a manually issued <command>SET DATESTYLE</>.
|
|
|
|
</member>
|
2000-06-18 23:24:54 +02:00
|
|
|
</simplelist>
|
|
|
|
</para>
|
2002-04-21 21:02:39 +02:00
|
|
|
|
2002-05-17 03:19:19 +02:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>NAMES</term>
|
|
|
|
<listitem>
|
2000-06-18 23:24:54 +02:00
|
|
|
<para>
|
2002-05-17 03:19:19 +02:00
|
|
|
<command>SET NAMES</> is an alias for <command>SET CLIENT_ENCODING</>.
|
2000-06-18 23:24:54 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-06-09 03:44:34 +02:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<varlistentry>
|
2000-06-18 23:24:54 +02:00
|
|
|
<term>SEED</term>
|
1999-05-20 07:40:27 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2002-06-11 17:44:38 +02:00
|
|
|
Sets the internal seed for the random number generator.
|
2000-02-15 21:49:31 +01:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="parameter">value</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The value for the seed to be used by the
|
|
|
|
<function>random</function> function. Allowed
|
|
|
|
values are floating-point numbers between 0 and 1, which
|
|
|
|
are then multiplied by 2<superscript>31</>-1.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<para>
|
|
|
|
The seed can also be set by invoking the
|
|
|
|
<function>setseed</function> SQL function:
|
2002-05-17 03:19:19 +02:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<programlisting>
|
2002-05-17 03:19:19 +02:00
|
|
|
SELECT setseed(<replaceable>value</replaceable>);
|
2002-06-11 17:44:38 +02:00
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-15 18:31:16 +02:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>SERVER_ENCODING</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Shows the server-side multibyte encoding. (At present, this
|
|
|
|
parameter can be shown but not set, because the encoding is
|
2002-09-21 20:32:54 +02:00
|
|
|
determined at <application>initdb</> time.)
|
2002-06-11 17:44:38 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2000-02-15 21:49:31 +01:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>TIME ZONE</term>
|
|
|
|
<term>TIMEZONE</term>
|
|
|
|
<listitem>
|
2001-12-29 19:35:54 +01:00
|
|
|
<para>
|
|
|
|
Sets the default time zone for your session. Arguments can be
|
|
|
|
an SQL time interval constant, an integer or double precision
|
2002-05-17 03:19:19 +02:00
|
|
|
constant, or a string representing a time zone name recognized
|
|
|
|
by the host operating system.
|
2001-12-29 19:35:54 +01:00
|
|
|
</para>
|
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<para>
|
|
|
|
Here are some typical values for time zone settings:
|
2001-12-29 19:35:54 +01:00
|
|
|
|
|
|
|
<variablelist>
|
2002-06-11 17:44:38 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>'PST8PDT'</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the time zone for Berkeley, California.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>'Portugal'</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the time zone for Portugal.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>'Europe/Rome'</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the time zone for Italy.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>7</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the time zone to 7 hours offset west from GMT (equivalent
|
|
|
|
to PDT).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>INTERVAL '08:00' HOUR TO MINUTE</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the time zone to 8 hours offset west from GMT (equivalent
|
|
|
|
to PST).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>LOCAL</term>
|
|
|
|
<term>DEFAULT</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Set the time zone to your local time zone (the one that
|
|
|
|
your operating system defaults to).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
2002-05-17 03:19:19 +02:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<para>
|
|
|
|
The available time zone names depend on your operating
|
|
|
|
system. For example, on Linux
|
|
|
|
<filename>/usr/share/zoneinfo</filename> contains the database
|
|
|
|
of time zones; the names of the files in that directory can be
|
|
|
|
used as parameters to this command.
|
|
|
|
</para>
|
2002-05-17 03:19:19 +02:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<para>
|
|
|
|
If an invalid time zone is specified, the time zone
|
|
|
|
becomes GMT (on most systems anyway).
|
|
|
|
</para>
|
2000-03-17 06:29:07 +01:00
|
|
|
|
2002-06-11 17:44:38 +02:00
|
|
|
<para>
|
|
|
|
If the <envar>PGTZ</envar> environment variable is set in the frontend
|
2002-09-21 20:32:54 +02:00
|
|
|
environment of a client based on <application>libpq</>, <application>libpq</> will automatically
|
2002-06-11 17:44:38 +02:00
|
|
|
<command>SET TIMEZONE</command> to the value of
|
|
|
|
<envar>PGTZ</envar> during connection start-up.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
1999-06-03 20:18:43 +02:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
2000-06-18 23:24:54 +02:00
|
|
|
Use <xref linkend="SQL-SHOW" endterm="SQL-SHOW-title"> to show the
|
2002-05-17 03:19:19 +02:00
|
|
|
current setting of a parameter.
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Diagnostics</title>
|
1999-05-20 07:40:27 +02:00
|
|
|
<para>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2002-05-18 17:44:48 +02:00
|
|
|
<term><computeroutput>SET</computeroutput></term>
|
2000-06-18 23:24:54 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Message returned if successful.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2002-08-04 07:09:36 +02:00
|
|
|
<term><computeroutput>ERROR: '<replaceable>name</replaceable> is not a
|
|
|
|
valid option name</computeroutput></term>
|
2000-06-18 23:24:54 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The parameter you tried to set does not exist.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2002-08-04 07:09:36 +02:00
|
|
|
<term><computeroutput>ERROR: '<replaceable>name</replaceable>':
|
|
|
|
permission denied</computeroutput></term>
|
2000-06-18 23:24:54 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2002-05-17 03:19:19 +02:00
|
|
|
You must be a superuser to alter certain settings.
|
2000-06-18 23:24:54 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2002-08-04 07:09:36 +02:00
|
|
|
<term><computeroutput>ERROR: '<replaceable>name</replaceable>' cannot
|
|
|
|
be changed after server start</computeroutput></term>
|
2000-06-18 23:24:54 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Some parameters are fixed once the server is started.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
1999-05-20 07:40:27 +02:00
|
|
|
</para>
|
1999-06-04 17:50:44 +02:00
|
|
|
</refsect1>
|
2000-06-18 23:24:54 +02:00
|
|
|
|
1999-05-20 07:40:27 +02:00
|
|
|
|
2000-06-18 23:24:54 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
1999-06-04 17:50:44 +02:00
|
|
|
<para>
|
2001-12-08 04:24:40 +01:00
|
|
|
Set the style of date to traditional
|
|
|
|
<productname>PostgreSQL</productname> with European conventions:
|
2002-04-21 21:02:39 +02:00
|
|
|
<screen>
|
2001-12-08 04:24:40 +01:00
|
|
|
SET DATESTYLE TO PostgreSQL,European;
|
2002-04-21 21:02:39 +02:00
|
|
|
</screen>
|
|
|
|
</para>
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2002-04-21 21:02:39 +02:00
|
|
|
<para>
|
|
|
|
Set the time zone for Berkeley, California, using quotes to
|
2002-05-17 03:19:19 +02:00
|
|
|
preserve the uppercase spelling of the time zone name (note
|
2002-04-21 21:02:39 +02:00
|
|
|
that the date style is <literal>PostgreSQL</literal> for this
|
|
|
|
example):
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2002-04-21 21:02:39 +02:00
|
|
|
<screen>
|
2002-02-26 16:59:08 +01:00
|
|
|
SET TIME ZONE 'PST8PDT';
|
1999-07-15 18:31:16 +02:00
|
|
|
SELECT CURRENT_TIMESTAMP AS today;
|
2002-04-21 21:02:39 +02:00
|
|
|
today
|
|
|
|
------------------------------------
|
|
|
|
Tue Feb 26 07:32:21.42834 2002 PST
|
|
|
|
</screen>
|
|
|
|
</para>
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2002-04-21 21:02:39 +02:00
|
|
|
<para>
|
|
|
|
Set the time zone for Italy (note the required single quotes to handle
|
2000-03-31 05:20:17 +02:00
|
|
|
the special characters):
|
1999-07-06 19:17:31 +02:00
|
|
|
|
2002-04-21 21:02:39 +02:00
|
|
|
<screen>
|
1999-07-15 18:31:16 +02:00
|
|
|
SET TIME ZONE 'Europe/Rome';
|
|
|
|
SELECT CURRENT_TIMESTAMP AS today;
|
2002-10-09 18:27:48 +02:00
|
|
|
|
|
|
|
today
|
|
|
|
-------------------------------
|
|
|
|
2002-10-08 05:39:35.008271+02
|
2002-04-21 21:02:39 +02:00
|
|
|
</screen>
|
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">
|
2000-06-18 23:24:54 +02:00
|
|
|
<title>Compatibility</title>
|
1999-07-15 18:31:16 +02:00
|
|
|
|
2000-07-14 17:27:14 +02:00
|
|
|
<refsect2 id="R2-SQL-SET-4">
|
|
|
|
<title>
|
|
|
|
SQL92
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<para>
|
2002-04-21 21:02:39 +02:00
|
|
|
<literal>SET TIME ZONE</literal>
|
|
|
|
extends syntax defined in
|
|
|
|
<acronym>SQL9x</acronym>. <acronym>SQL9x</acronym> allows
|
|
|
|
only numeric time zone offsets while
|
|
|
|
<productname>PostgreSQL</productname> allows full time zone
|
|
|
|
specifier strings as well. All other <literal>SET</literal>
|
2002-05-17 03:19:19 +02:00
|
|
|
features are
|
|
|
|
<productname>PostgreSQL</productname> extensions.
|
2000-07-14 17:27:14 +02:00
|
|
|
</para>
|
|
|
|
</refsect2>
|
1999-05-20 07:40:27 +02:00
|
|
|
</refsect1>
|
2002-08-04 05:53:11 +02:00
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
2003-01-11 01:39:52 +01:00
|
|
|
<simpara>
|
2003-01-12 02:33:00 +01:00
|
|
|
<xref linkend="sql-set-constraints" endterm="sql-set-constraints-title">,
|
|
|
|
<xref linkend="sql-set-session-authorization" endterm="sql-set-session-authorization-title">,
|
|
|
|
<xref linkend="sql-set-transaction" endterm="sql-set-transaction-title">
|
2003-01-11 01:39:52 +01:00
|
|
|
</simpara>
|
|
|
|
|
2002-08-04 05:53:11 +02:00
|
|
|
<para>
|
|
|
|
The function <function>set_config</function> provides the equivalent
|
|
|
|
capability. See <citetitle>Miscellaneous Functions</citetitle> in the
|
|
|
|
<citetitle>PostgreSQL User's Guide</citetitle>.
|
|
|
|
</para>
|
|
|
|
</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:
|
|
|
|
-->
|