DROP_SEQUENCE(7pg13)
π DROP_SEQUENCE(7pg13) π
okay bestie, welcome to the PostgreSQL 13.23 Documentation glow-up of DROP_SEQUENCE(7pg13) β the page for yeeting a sequence π
. No cap, this is the whole lore, every flag and caveat included.
β¨ NAME β¨
DROP_SEQUENCE β remove a sequence πβ¨
π¦ SYNOPSIS π¦
DROP SEQUENCE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
π DESCRIPTION π
DROP SEQUENCE removes sequence number generators, fr fr. It's giving cleanup era. The catch? A sequence can only be dropped by its owner or a superuser β so don't try it unless that's you, bestie. π
πΈ PARAMETERS πΈ
IF EXISTSβ do not throw an error if the sequence does not exist. In that case, a notice is issued. No dramatic crash, just a little "hey, it's not there" heads-up π«Άnameβ the name of a sequence, optionally schema-qualified. That's the main character of this command πCASCADEβ automatically drop objects that depend on the sequence, and in turn all objects that depend on those objects (see Section 5.14). It's a whole chain reaction, iykyk πRESTRICTβ refuse to drop the sequence if any objects depend on it. This is the default. Safety first, periodt π
π EXAMPLES π
To remove the sequence serial:
DROP SEQUENCE serial;
π₯ COMPATIBILITY π₯
DROP SEQUENCE conforms to the SQL standard, except that the standard only allows one sequence to be dropped per command, and apart from the IF EXISTS option, which is a PostgreSQL extension. So yes, iconic standard behavior with a lil PostgreSQL flair β¨
β SEE ALSO β
CREATE SEQUENCE(CREATE_SEQUENCE(7))ALTER SEQUENCE(ALTER_SEQUENCE(7))
okay that's the whole page, bestie β sourced from PostgreSQL 13.23, dated 2025, and delivered with maximum group-chat energy πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms