3 PostgreSQL documentation
6 <refentry id=
"SQL-DROPSEQUENCE">
8 <refentrytitle id=
"SQL-DROPSEQUENCE-TITLE">DROP SEQUENCE
</refentrytitle>
9 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
13 <refname>DROP SEQUENCE
</refname>
14 <refpurpose>remove a sequence
</refpurpose>
17 <indexterm zone=
"sql-dropsequence">
18 <primary>DROP SEQUENCE
</primary>
23 DROP SEQUENCE [ IF EXISTS ]
<replaceable class=
"PARAMETER">name
</replaceable> [, ...] [ CASCADE | RESTRICT ]
28 <title>Description
</title>
31 <command>DROP SEQUENCE
</command> removes sequence number
32 generators. A sequence can only be dropped by its owner or a superuser.
37 <title>Parameters
</title>
41 <term><literal>IF EXISTS
</literal></term>
44 Do not throw an error if the sequence does not exist. A notice is issued
51 <term><replaceable class=
"PARAMETER">name
</replaceable></term>
54 The name (optionally schema-qualified) of a sequence.
60 <term><literal>CASCADE
</literal></term>
63 Automatically drop objects that depend on the sequence.
69 <term><literal>RESTRICT
</literal></term>
72 Refuse to drop the sequence if any objects depend on it. This
81 <title>Examples
</title>
84 To remove the sequence
<literal>serial
</literal>:
93 <title>Compatibility
</title>
96 <command>DROP SEQUENCE
</command> conforms to the
<acronym>SQL
</acronym>
97 standard, except that the standard only allows one
98 sequence to be dropped per command, and apart from the
99 <literal>IF EXISTS<
/> option, which is a
<productname>PostgreSQL<
/>
105 <title>See Also
</title>
107 <simplelist type=
"inline">
108 <member><xref linkend=
"sql-createsequence" endterm=
"sql-createsequence-title"></member>
109 <member><xref linkend=
"sql-altersequence" endterm=
"sql-altersequence-title"></member>