1DROP SEQUENCE(7)         PostgreSQL 12.2 Documentation        DROP SEQUENCE(7)
2
3
4

NAME

6       DROP_SEQUENCE - remove a sequence
7

SYNOPSIS

9       DROP SEQUENCE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
10

DESCRIPTION

12       DROP SEQUENCE removes sequence number generators. A sequence can only
13       be dropped by its owner or a superuser.
14

PARAMETERS

16       IF EXISTS
17           Do not throw an error if the sequence does not exist. A notice is
18           issued in this case.
19
20       name
21           The name (optionally schema-qualified) of a sequence.
22
23       CASCADE
24           Automatically drop objects that depend on the sequence, and in turn
25           all objects that depend on those objects (see Section 5.14).
26
27       RESTRICT
28           Refuse to drop the sequence if any objects depend on it. This is
29           the default.
30

EXAMPLES

32       To remove the sequence serial:
33
34           DROP SEQUENCE serial;
35

COMPATIBILITY

37       DROP SEQUENCE conforms to the SQL standard, except that the standard
38       only allows one sequence to be dropped per command, and apart from the
39       IF EXISTS option, which is a PostgreSQL extension.
40

SEE ALSO

42       CREATE SEQUENCE (CREATE_SEQUENCE(7)), ALTER SEQUENCE
43       (ALTER_SEQUENCE(7))
44
45
46
47PostgreSQL 12.2                      2020                     DROP SEQUENCE(7)
Impressum