Drop Sequence

Removes a sequence from a database.

Synopsis

DROP SEQUENCE name [, ...]

Parameters

name

The name of the sequence you wish to permanently remove. You may drop multiple sequences by specifying their names in a comma-delimited list.

Results

DROP

The message returned when a sequence is successfully dropped.

ERROR: sequence "name" does not exist

The error returned if the specified sequence name does not exist.

Description

Use the DROP SEQUENCE command to remove a sequence number generator from a database.

Example

The following example removes a sequence named shipments_ship_id_seq from the database:

booktown=# DROP SEQUENCE shipments_ship_id_seq;
DROP

Get Practical PostgreSQL now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.