1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2006-09-16 02:30:20 +02:00
|
|
|
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_sequence.sgml,v 1.26 2006/09/16 00:30:18 momjian Exp $
|
2001-12-08 04:24:40 +01:00
|
|
|
PostgreSQL documentation
|
1999-07-22 17:09:15 +02:00
|
|
|
-->
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refentry id="SQL-DROPSEQUENCE">
|
|
|
|
<refmeta>
|
2002-04-21 21:02:39 +02:00
|
|
|
<refentrytitle id="SQL-DROPSEQUENCE-TITLE">DROP SEQUENCE</refentrytitle>
|
1999-07-06 19:16:42 +02:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refnamediv>
|
2003-05-04 04:23:16 +02:00
|
|
|
<refname>DROP SEQUENCE</refname>
|
|
|
|
<refpurpose>remove a sequence</refpurpose>
|
1998-12-29 03:24:47 +01:00
|
|
|
</refnamediv>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
2003-08-31 19:32:24 +02:00
|
|
|
<indexterm zone="sql-dropsequence">
|
|
|
|
<primary>DROP SEQUENCE</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refsynopsisdiv>
|
2003-05-04 04:23:16 +02:00
|
|
|
<synopsis>
|
2005-11-19 18:39:45 +01:00
|
|
|
DROP SEQUENCE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
|
2003-05-04 04:23:16 +02:00
|
|
|
</synopsis>
|
1999-07-06 19:16:42 +02:00
|
|
|
</refsynopsisdiv>
|
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<para>
|
2003-05-04 04:23:16 +02:00
|
|
|
<command>DROP SEQUENCE</command> removes sequence number generators.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
2003-05-04 04:23:16 +02:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
|
|
|
|
|
|
|
<variablelist>
|
2005-11-19 18:39:45 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term><literal>IF EXISTS</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Do not throw an error if the sequence does not exist. A notice is issued
|
|
|
|
in this case.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<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>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<para>
|
2003-05-04 04:23:16 +02:00
|
|
|
To remove the sequence <literal>serial</literal>:
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<programlisting>
|
1999-07-06 19:16:42 +02:00
|
|
|
DROP SEQUENCE serial;
|
2003-05-04 04:23:16 +02:00
|
|
|
</programlisting>
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
1998-09-07 17:53:12 +02:00
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
|
|
|
|
|
|
|
<para>
|
2005-11-01 22:09:51 +01:00
|
|
|
<command>DROP SEQUENCE</command> conforms to the <acronym>SQL</acronym>
|
|
|
|
standard, except that the standard only allows one
|
2005-11-19 18:39:45 +01:00
|
|
|
sequence to be dropped per command, and apart from the
|
|
|
|
<literal>IF EXISTS</> option, which is a <productname>PostgreSQL</>
|
|
|
|
extension.
|
2003-05-04 04:23:16 +02:00
|
|
|
</para>
|
1998-09-07 17:53:12 +02:00
|
|
|
</refsect1>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
|
|
|
<member><xref linkend="sql-createsequence" endterm="sql-createsequence-title"></member>
|
2006-08-21 02:57:26 +02:00
|
|
|
<member><xref linkend="sql-altersequence" endterm="sql-altersequence-title"></member>
|
2003-05-04 04:23:16 +02:00
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
</refentry>
|