blob: 2f327aa08ad32ea6e0479fd43266c42a5fef6509 [file] [log] [blame]
---
title: DROP SEQUENCE
---
Removes a sequence.
## Synopsis<a id="topic1__section2"></a>
``` pre
DROP SEQUENCE [IF EXISTS] name [, ...] [CASCADE | RESTRICT]
```
## Description<a id="topic1__section3"></a>
`DROP SEQUENCE` removes a sequence generator table. You must own the sequence to drop it (or be a superuser).
## Parameters<a id="topic1__section4"></a>
IF EXISTS
Do not throw an error if the sequence does not exist. A notice is issued in this case.
*name*
The name (optionally schema-qualified) of the sequence to remove.
CASCADE
Automatically drop objects that depend on the sequence.
RESTRICT
Refuse to drop the sequence if any objects depend on it. This is the default.
## Examples<a id="topic1__section5"></a>
Remove the sequence `myserial`:
``` pre
DROP SEQUENCE myserial;
```
## Compatibility<a id="topic1__section6"></a>
`DROP SEQUENCE` is fully conforming with the SQL standard, except that the standard only allows one sequence to be dropped per command. Also, the `IF EXISTS` option is a HAWQ extension.
## See Also<a id="topic1__section7"></a>
/3/4