Make LC_COLLATE and LC_CTYPE database-level settings. Collation and
[PostgreSQL.git] / doc / src / sgml / ref / drop_sequence.sgml
blob56f8821e3ee68990a21c443fa6c3a564171b49cb
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPSEQUENCE">
7 <refmeta>
8 <refentrytitle id="SQL-DROPSEQUENCE-TITLE">DROP SEQUENCE</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
10 </refmeta>
12 <refnamediv>
13 <refname>DROP SEQUENCE</refname>
14 <refpurpose>remove a sequence</refpurpose>
15 </refnamediv>
17 <indexterm zone="sql-dropsequence">
18 <primary>DROP SEQUENCE</primary>
19 </indexterm>
21 <refsynopsisdiv>
22 <synopsis>
23 DROP SEQUENCE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
24 </synopsis>
25 </refsynopsisdiv>
27 <refsect1>
28 <title>Description</title>
30 <para>
31 <command>DROP SEQUENCE</command> removes sequence number
32 generators. A sequence can only be dropped by its owner or a superuser.
33 </para>
34 </refsect1>
36 <refsect1>
37 <title>Parameters</title>
39 <variablelist>
40 <varlistentry>
41 <term><literal>IF EXISTS</literal></term>
42 <listitem>
43 <para>
44 Do not throw an error if the sequence does not exist. A notice is issued
45 in this case.
46 </para>
47 </listitem>
48 </varlistentry>
50 <varlistentry>
51 <term><replaceable class="PARAMETER">name</replaceable></term>
52 <listitem>
53 <para>
54 The name (optionally schema-qualified) of a sequence.
55 </para>
56 </listitem>
57 </varlistentry>
59 <varlistentry>
60 <term><literal>CASCADE</literal></term>
61 <listitem>
62 <para>
63 Automatically drop objects that depend on the sequence.
64 </para>
65 </listitem>
66 </varlistentry>
68 <varlistentry>
69 <term><literal>RESTRICT</literal></term>
70 <listitem>
71 <para>
72 Refuse to drop the sequence if any objects depend on it. This
73 is the default.
74 </para>
75 </listitem>
76 </varlistentry>
77 </variablelist>
78 </refsect1>
80 <refsect1>
81 <title>Examples</title>
83 <para>
84 To remove the sequence <literal>serial</literal>:
86 <programlisting>
87 DROP SEQUENCE serial;
88 </programlisting>
89 </para>
90 </refsect1>
92 <refsect1>
93 <title>Compatibility</title>
95 <para>
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</>
100 extension.
101 </para>
102 </refsect1>
104 <refsect1>
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>
110 </simplelist>
111 </refsect1>
113 </refentry>