DROP SEQUENCE

Delete the sequence.

Summary

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

describe

DROP SEQUENCE deletes the sequence generator table. You must have the deleted sequence (or become a superuser).

Parameters

IF EXISTS

  • If the sequence does not exist, please do not report an error. In this case, a notification will be issued.

name

  • The name of the sequence to be deleted (can be specified by the schema).

CASCADE

  • Automatically delete sequence-dependent objects.

RESTRICT

  • If any object depends on the sequence, the deleted sequence is refused. This is the default value.

Example

Delete the sequence myserial:

DROP SEQUENCE myserial;

compatibility

DROP SEQUENCE is fully compliant with the SQL standard, but this standard only allows one sequence to be deleted per command. Additionally, the IF EXISTS option is a YMatrix database extension.

See also

ALTER SEQUENCE , CREATE SEQUENCE