DROP_SEQUENCE(7pg14)

πŸ“¦ version 14.24, in opensuse-leap 16.0

okay bestie, this is the DROP_SEQUENCE(7pg14) page β€” manual name folded in near the top, just like we like it β€” and we’re talking about removing sequences in the PostgreSQL 14.24 docs. Buckle up, it’s giving concise but iconic πŸ’–

🌸 NAME 🌸

DROP_SEQUENCE β€” remove a sequence πŸ’…

✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so DROP SEQUENCE removes sequence number generators. The vibe check is simple: a sequence can only be dropped by its owner or a superuser. no cap, that’s the rule πŸ‘‘

πŸŽ€ PARAMETERS πŸŽ€

  • 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 a sequence ✨
  • CASCADE β€” automatically drop objects that depend on the sequence, and in turn all objects that depend on those objects (see Section 5.14) πŸŒ€
  • RESTRICT β€” refuse to drop the sequence if any objects depend on it. This is the default πŸ›‘

πŸ“ 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. periodt πŸ’«

πŸ’œ SEE ALSO πŸ’œ


πŸ’– cute sign-off time: source/version is PostgreSQL 14.24, dated 2026 β€” bye bestie, go slay your sequences πŸ’…βœ¨

πŸ“¦ where this page comes from