<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/reset.sgml,v 1.13 2001/12/08 03:24:39 thomas Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.33 2007/04/12 06:53:46 neilc Exp $
PostgreSQL documentation
-->
<refentrytitle id="SQL-RESET-TITLE">RESET</refentrytitle>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
+
<refnamediv>
<refname>RESET</refname>
- <refpurpose>restore the value of a run-time parameter to a default value</refpurpose>
+ <refpurpose>restore the value of a run-time parameter to the default value</refpurpose>
</refnamediv>
+
+ <indexterm zone="sql-reset">
+ <primary>RESET</primary>
+ </indexterm>
+
<refsynopsisdiv>
- <synopsis>
-RESET <replaceable class="PARAMETER">variable</replaceable>
- </synopsis>
- <synopsis>
+<synopsis>
+RESET <replaceable class="PARAMETER">configuration_parameter</replaceable>
RESET ALL
- </synopsis>
-
- <refsect2 id="R2-SQL-RESET-1">
- <title>Inputs</title>
- <para>
- <variablelist>
- <varlistentry>
- <term><replaceable class="PARAMETER">variable</replaceable></term>
- <listitem>
- <para>
- The name of a run-time parameter. See <xref
- linkend="sql-set" endterm="sql-set-title"> for a list.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>ALL</term>
- <listitem>
- <para>
- Resets all run-time parameters to default values.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect2>
-
+RESET { PLANS | SESSION | TEMP | TEMPORARY }
+</synopsis>
</refsynopsisdiv>
-
+
<refsect1>
<title>Description</title>
+
<para>
<command>RESET</command> restores run-time parameters to their
- default values. Refer to
- <xref linkend="sql-set" endterm="sql-set-title">
- for details. <command>RESET</command> is an alternate form for
+ default values. <command>RESET</command> is an alternative
+ spelling for
+<synopsis>
+SET <replaceable class="parameter">configuration_parameter</replaceable> TO DEFAULT
+</synopsis>
+ Refer to <xref linkend="sql-set" endterm="sql-set-title"> for
+ details.
+ </para>
- <synopsis>
-SET <replaceable class="parameter">variable</replaceable> TO DEFAULT
- </synopsis>
+ <para>
+ The default value is defined as the value that the parameter would
+ have had, if no <command>SET</> ever been issued for it in the
+ current session. The actual source of this value might be a
+ compiled-in default, the configuration file, command-line options,
+ or per-database or per-user default settings. See <xref
+ linkend="runtime-config"> for details.
</para>
- </refsect1>
- <refsect1>
- <title>Diagnostics</title>
<para>
- See under the <xref linkend="sql-set"
- endterm="sql-set-title"> command.
+ See the <command>SET</> reference page for details on the
+ transaction behavior of <command>RESET</>.
+ </para>
+
+ <para>
+ <command>RESET</> can also be used to release internal resources
+ that are usually released at the end of session. <command>RESET
+ TEMP</> drops all temporary tables created in the current session.
+ <command>RESET PLANS</> releases all internally cached plans.
+ <command>RESET SESSION</> releases all externally visible temporary
+ resources associated with the current session.
</para>
</refsect1>
<refsect1>
- <title>Examples</title>
- <para>
- Set DateStyle to its default value:
+ <title>Parameters</title>
-<screen>
-RESET DateStyle;
-</screen>
- </para>
+ <variablelist>
+ <varlistentry>
+ <term><replaceable class="PARAMETER">configuration_parameter</replaceable></term>
+ <listitem>
+ <para>
+ The name of a run-time parameter. See <xref linkend="sql-set"
+ endterm="sql-set-title"> for a list.
+ </para>
+ </listitem>
+ </varlistentry>
- <para>
- Set Geqo to its default value:
+ <varlistentry>
+ <term><literal>ALL</literal></term>
+ <listitem>
+ <para>
+ Resets all settable run-time parameters to default values.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>TEMP, TEMPORARY</literal></term>
+ <listitem>
+ <para>
+ Drops all temporary tables created in the current session.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PLANS</literal></term>
+ <listitem>
+ <para>
+ Releases all cached query plans.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>SESSION</literal></term>
+ <listitem>
+ <para>
+ Releases all temporary resources associated with the current
+ session. This has the same effect as executing the following
+ command sequence:
+<synopsis>
+SET SESSION AUTHORIZATION DEFAULT;
+RESET ALL;
+DEALLOCATE ALL;
+CLOSE ALL;
+UNLISTEN *;
+RESET PLANS;
+RESET TEMP;
+</synopsis>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Notes</title>
+
+ <para>
+ <command>RESET SESSION</> cannot be executed inside a transaction block.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Examples</title>
-<screen>
-RESET GEQO;
+ <para>
+ Set the <varname>geqo</> configuration variable to its default value:
+<screen>
+RESET geqo;
</screen>
</para>
</refsect1>
</para>
</refsect1>
</refentry>
-
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-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
-sgml-local-catalogs:"/usr/lib/sgml/catalog"
-sgml-local-ecat-files:nil
-End:
--->