DROP_TYPE(7pg14)
π DROP TYPE π
okay so bestie, welcome to DROP_TYPE(7pg14) β the page where PostgreSQL lets you remove a data type, and yes, it's giving "cleanup era" β¨
β¨ NAME β¨
DROP TYPE β remove a data type π
π¦ SYNOPSIS π¦
DROP TYPE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
πΈ DESCRIPTION πΈ
DROP TYPE removes a user-defined data type. Only the owner of a type can remove it, no cap π
π PARAMETERS π
IF EXISTSβ do not throw an error if the type does not exist. A notice is issued in this case, so it's like a little "bestie, it's already gone" heads-up πnameβ the name of the data type to remove. It can be optionally schema-qualified, iykyk π§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 (seeSection 5.14). It's the "and everything attached to it comes too" option ππ₯RESTRICTβ refuse to drop the type if any objects depend on it. This is the default, so it's the cautious icon behavior π«Ά
π 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 β so like, standard-ish, but make it PostgreSQL π
π SEE ALSO π
ALTER TYPE (ALTER_TYPE(7))CREATE TYPE (CREATE_TYPE(7))
π cute little sign-off: this slay page is from PostgreSQL 14.24, dated 2026, and it's the DROP TYPE(7) page. mwah π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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