DROP_TYPE(7pg17)

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

✨ NAME ✨

okay so welcome to the DROP_TYPE(7pg17) page, bestie β€” this is from the PostgreSQL 17.11 docs, and it's literally the manual for DROP TYPE, aka removing a data type. πŸ’…

DROP TYPE removes a user-defined data type. Only the owner of a type can remove it. periodt. πŸ‘‘


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So DROP TYPE removes a user-defined data type. Only the owner of a type can remove it β€” like, you can't just yeet someone else's type, bestie. πŸ‘‘

πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” do not throw an error if the type does not exist. A notice is issued in this case. 🫢
  • name β€” the name (optionally schema-qualified) of the data type to remove. ✨
  • CASCADE β€” automatically drop objects that depend on the type (such as table columns, functions, and operators), and in turn all objects that depend on those objects (see Section 5.15). πŸ’€
  • RESTRICT β€” refuse to drop the type if any objects depend on it. This is the default. 🚫

πŸ’– EXAMPLES πŸ’–

To remove the data type box:

DROP TYPE box;

🌈 COMPATIBILITY 🌈

This command is similar to the corresponding command in the SQL standard, apart from the IF EXISTS option, which is a PostgreSQL extension. But note that much of the CREATE TYPE command and the data type extension mechanisms in PostgreSQL differ from the SQL standard. no cap. 🌈

πŸ‘‘ SEE ALSO πŸ‘‘


xoxo, your Unix bestie πŸ’– β€” PostgreSQL 17.11, 2026. πŸŽ€

πŸ“¦ where this page comes from