DROP_CAST(7pg14)
π DROP CAST π
okay so bestie, this is the DROP CAST page from the PostgreSQL 14.24 Documentation β yes the (7) means it lives in the SQL command section of the manual, iykyk. Grab a lil snack, we're learning how to yeet a cast π
β¨ NAME β¨
DROP_CAST β remove a cast. that's it, that's the whole vibe. deleting a cast. gone. buh-bye π
β¨ SYNOPSIS β¨
DROP CAST [ IF EXISTS ] (source_type AS target_type) [ CASCADE | RESTRICT ]
look at her. iconic syntax. every bracket is optional-ish, so read carefully π¦
β¨ DESCRIPTION β¨
DROP CAST removes a previously defined cast. literally just takes a cast that already exists and un-exists it π
π«Ά important privilege check, no cap: to be able to drop a cast, you must own the source or the target data type. These are the same privileges that are required to create a cast. so like β you can't just wander in and delete someone else's cast, be so fr.
β¨ PARAMETERS β¨
IF EXISTSβ Do not throw an error if the cast does not exist. A notice is issued in this case. so instead of a whole dramatic error moment, you just get a lil notice. very chill, very demure πsource_typeβ The name of the source data type of the cast. the "from" side of the situationship πtarget_typeβ The name of the target data type of the cast. the "to" side πCASCADE,RESTRICTβ These key words do not have any effect, since there are no dependencies on casts. yeah they're just... there. decorative. they show up, they do nothing, they leave. honestly relatable π
β¨ EXAMPLES β¨
say you wanna drop the cast from type text to type int. you'd do:
DROP CAST (text AS int);
and that's it. slay. the cast is gone π₯
β¨ COMPATIBILITY β¨
The DROP CAST command conforms to the SQL standard. we're standard-compliant AND cute, main character energy fr fr π
β¨ SEE ALSO β¨
CREATE CAST(seeCREATE_CAST(7)) β the origin story, the birthplace, the "how did we get here" π
k bye bestie, go forth and drop casts responsibly πβ¨
this has been DROP CAST(7) β PostgreSQL 14.24, dated 2026 ππ¦
π¦ 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