DROP_SEQUENCE(7pg13)

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

πŸ’– 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 ⭐


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