DROP_SEQUENCE(7pg15)
π NAME π
okay so bestie, this is the DROP SEQUENCE(7) page β yep, the DROP_SEQUENCE(7pg15) one β and its whole personality is: DROP_SEQUENCE β remove a sequence. that's it. that's the name. periodt π
β¨ SYNOPSIS β¨
copy this exactly, no freestyling:
DROP SEQUENCE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
π¦ DESCRIPTION π¦
DROP SEQUENCE removes sequence number generators. the vibe is deletion, but with rules: a sequence can only be dropped by its owner or a superuser. no cap, those are the permissions. π₯
π PARAMETERS π
IF EXISTSβ do not throw an error if the sequence does not exist. in that case, a notice is issued. so it's a notice, not an error β important distinction, bestie. β¨nameβ the name of a sequence, and it can be optionally schema-qualified. yes, schema-qualified is allowed. π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 giving domino effect. πRESTRICTβ refuse to drop the sequence if any objects depend on it. This is the default. so yeah, default behavior is protective. π
π₯ EXAMPLES π₯
to remove the sequence serial, you literally run:
DROP SEQUENCE serial;
slay. β¨
π 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. that's the compatibility tea. π
π SEE ALSO π
CREATE SEQUENCE(CREATE_SEQUENCE(7))ALTER SEQUENCE(ALTER_SEQUENCE(7))
mwah π β source/version + date check: PostgreSQL 15.19 Documentation, dated 2026. bye bestie, go be iconic with your sequences π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-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