<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_sequence.sgml,v 1.17 2003/05/04 02:23:16 petere Exp $
PostgreSQL documentation
-->

<refentry id="SQL-DROPSEQUENCE">
 <refmeta>
  <refentrytitle id="SQL-DROPSEQUENCE-TITLE">DROP SEQUENCE</refentrytitle>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>DROP SEQUENCE</refname>
  <refpurpose>remove a sequence</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
DROP SEQUENCE <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP SEQUENCE</command> removes sequence number generators.
  </para>
 </refsect1>
  
 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="PARAMETER">name</replaceable></term>
    <listitem>
     <para>
      The name (optionally schema-qualified) of a sequence.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>CASCADE</literal></term>
    <listitem>
     <para>
      Automatically drop objects that depend on the sequence.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>RESTRICT</literal></term>
    <listitem>
     <para>
      Refuse to drop the sequence if any objects depend on it.  This
      is the default.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Diagnostics</title>

  <variablelist>
   <varlistentry>
    <term><computeroutput>DROP SEQUENCE</computeroutput></term>
    <listitem>
     <para>
      Message returned if the sequence was successfully dropped.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><computeroutput>ERROR: sequence "<replaceable class="parameter">name</replaceable>" does not exist</computeroutput></term>
    <listitem>
     <para>
      Message returned if the specified sequence does not exist.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   To remove the sequence <literal>serial</literal>:

<programlisting>
DROP SEQUENCE serial;
</programlisting>
  </para>
 </refsect1>
 
 <refsect1>
  <title>Compatibility</title>

  <para>
   There is no <command>DROP SEQUENCE</command> statement in the SQL standard.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-createsequence" endterm="sql-createsequence-title"></member>
  </simplelist>
 </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:
-->
