]> begriffs open source - ai-pg/blob - full-docs/src/sgml/man7/DROP_SEQUENCE.7
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / man7 / DROP_SEQUENCE.7
1 '\" t
2 .\"     Title: DROP SEQUENCE
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "DROP SEQUENCE" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 DROP_SEQUENCE \- remove a sequence
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 DROP SEQUENCE [ IF EXISTS ] \fIname\fR [, \&.\&.\&.] [ CASCADE | RESTRICT ]
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBDROP SEQUENCE\fR
40 removes sequence number generators\&. A sequence can only be dropped by its owner or a superuser\&.
41 .SH "PARAMETERS"
42 .PP
43 IF EXISTS
44 .RS 4
45 Do not throw an error if the sequence does not exist\&. A notice is issued in this case\&.
46 .RE
47 .PP
48 \fIname\fR
49 .RS 4
50 The name (optionally schema\-qualified) of a sequence\&.
51 .RE
52 .PP
53 CASCADE
54 .RS 4
55 Automatically drop objects that depend on the sequence, and in turn all objects that depend on those objects (see
56 Section\ \&5.15)\&.
57 .RE
58 .PP
59 RESTRICT
60 .RS 4
61 Refuse to drop the sequence if any objects depend on it\&. This is the default\&.
62 .RE
63 .SH "EXAMPLES"
64 .PP
65 To remove the sequence
66 serial:
67 .sp
68 .if n \{\
69 .RS 4
70 .\}
71 .nf
72 DROP SEQUENCE serial;
73 .fi
74 .if n \{\
75 .RE
76 .\}
77 .SH "COMPATIBILITY"
78 .PP
79 \fBDROP SEQUENCE\fR
80 conforms to the
81 SQL
82 standard, except that the standard only allows one sequence to be dropped per command, and apart from the
83 IF EXISTS
84 option, which is a
85 PostgreSQL
86 extension\&.
87 .SH "SEE ALSO"
88 CREATE SEQUENCE (\fBCREATE_SEQUENCE\fR(7)), ALTER SEQUENCE (\fBALTER_SEQUENCE\fR(7))