3 PostgreSQL documentation
6 <refentry id=
"SQL-DROPSEQUENCE">
8 <refentrytitle id=
"SQL-DROPSEQUENCE-TITLE">DROP SEQUENCE
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>DROP SEQUENCE
</refname>
15 <refpurpose>remove a sequence
</refpurpose>
18 <indexterm zone=
"sql-dropsequence">
19 <primary>DROP SEQUENCE
</primary>
24 DROP SEQUENCE [ IF EXISTS ]
<replaceable class=
"PARAMETER">name
</replaceable> [, ...] [ CASCADE | RESTRICT ]
29 <title>Description
</title>
32 <command>DROP SEQUENCE
</command> removes sequence number
33 generators. A sequence can only be dropped by its owner or a superuser.
38 <title>Parameters
</title>
42 <term><literal>IF EXISTS
</literal></term>
45 Do not throw an error if the sequence does not exist. A notice is issued
52 <term><replaceable class=
"PARAMETER">name
</replaceable></term>
55 The name (optionally schema-qualified) of a sequence.
61 <term><literal>CASCADE
</literal></term>
64 Automatically drop objects that depend on the sequence.
70 <term><literal>RESTRICT
</literal></term>
73 Refuse to drop the sequence if any objects depend on it. This
82 <title>Examples
</title>
85 To remove the sequence
<literal>serial
</literal>:
94 <title>Compatibility
</title>
97 <command>DROP SEQUENCE
</command> conforms to the
<acronym>SQL
</acronym>
98 standard, except that the standard only allows one
99 sequence to be dropped per command, and apart from the
100 <literal>IF EXISTS<
/> option, which is a
<productname>PostgreSQL<
/>
106 <title>See Also
</title>
108 <simplelist type=
"inline">
109 <member><xref linkend=
"sql-createsequence" endterm=
"sql-createsequence-title"></member>
110 <member><xref linkend=
"sql-altersequence" endterm=
"sql-altersequence-title"></member>