DROP_CAST(7pg13)

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

πŸ’… DROP CAST (7pg13) β€” the "bye-bye cast" page ✨

okay so real quick, this is the DROP CAST(7) page from the PostgreSQL 13.23 Documentation, and bestie, it's lowkey short but it's all tea πŸ«–


πŸ’– NAME πŸ’–

DROP_CAST β€” remove a cast. literally just. yeet the cast. that's it. that's the whole job πŸŽ€

✨ SYNOPSIS ✨

DROP CAST [ IF EXISTS ] (source_type AS target_type) [ CASCADE | RESTRICT ]

that's the whole vibe right there πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so DROP CAST removes a previously defined cast. gone. deleted. not me manifesting its downfall πŸ’€

but here's the catch, and it's giving "you must have main character energy": to be able to drop a cast, you must own the source or the target data type. yep β€” those are the exact same privileges that are required to create a cast. same keys, different door πŸ—οΈ

🌸 PARAMETERS 🌸

  • IF EXISTS β€” Do not throw an error if the cast does not exist. A notice is issued in this case. like, no drama, no error, just a lil notice to let you know 🫢
  • source_type β€” The name of the source data type of the cast. the from. the origin story 🌱
  • target_type β€” The name of the target data type of the cast. the to. the glow-up destination πŸ¦‹
  • CASCADE, RESTRICT β€” These key words do not have any effect, since there are no dependencies on casts. yeah they're just kinda there. decorative. iconique but useless, we stan anyway πŸ’…

πŸ”₯ EXAMPLES πŸ”₯

to drop the cast from type text to type int, you hit it with:

DROP CAST (text AS int);

and it's done. no cap ✨

⭐ COMPATIBILITY ⭐

The DROP CAST command conforms to the SQL standard. standards girlie behavior, we love to see it πŸ‘‘

🌈 SEE ALSO 🌈

CREATE CAST (CREATE_CAST(7)) β€” the origin story, the prequel, go read it 🧚


and that's the whole page bestie πŸŽ€ that was PostgreSQL 13.23, dated 2025, DROP CAST(7), signing off β€” go drop those casts, you absolute monarch πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from