DROP_TYPE(7pg13)
Okay so bestie, welcome to the DROP_TYPE(7) page from the PostgreSQL 13.23 Documentation β this is the whole guide to yeeting a user-defined data type out of your database. π
β¨
π NAME π
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 what does it do? DROP TYPE removes a user-defined data type. Only the owner of a type can remove it β no cap. π
π PARAMETERS π
IF EXISTSβ Don't throw an error if the type doesn't exist. A notice is issued in this case. Cute little heads-up instead of drama. π«Άnameβ The name of the data type to remove, optionally schema-qualified. β¨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.14). It's giving domino effect, so be careful. πRESTRICTβ Refuse to drop the type if any objects depend on it. This is the default, bestie β so if you don't sayCASCADE, this is what you get. π
π¦ 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. π¦
π₯ SEE ALSO π₯
ALTER TYPE (ALTER_TYPE(7))CREATE TYPE (CREATE_TYPE(7))
Big slay from the PostgreSQL 13.23 docs, dated 2025 β DROP_TYPE(7) signing off. Stay iconic, bestie. πππ
π¦ 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