DROP_CAST(7pg16)

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

✨ NAME ✨

okay so bestie, this is DROP_CAST, aka page 7pg16 in the PostgreSQL 16.15 docs, and it’s literally the β€œremove a cast” page. that’s the whole assignment: a previously defined cast is getting removed. no cap. πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

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

it’s giving β€œshort, sharp, and ready to un-cast.” ✨

πŸ’– DESCRIPTION πŸ’–

DROP CAST removes a cast that was previously defined. fr fr, that’s the main character move. 🫢

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 β€” same ownership vibe check, different command. πŸ’…

🧚 PARAMETERS 🧚

  • IF EXISTS β€” do not throw an error if the cast does not exist. A notice is issued in this case. so it’s a gentle β€œbestie, it’s already gone” situation, not a whole error moment. πŸ™ˆ
  • source_type β€” the name of the source data type of the cast. πŸ“
  • target_type β€” the name of the target data type of the cast. πŸ¦‹
  • CASCADE, RESTRICT β€” these key words do not have any effect, since there are no dependencies on casts. they’re literally just standing there, looking iconic, doing nothing. πŸ’€

🌈 EXAMPLES 🌈

want to drop the cast from type text to type int? iconic, here’s the line:

DROP CAST (text AS int);

⭐ COMPATIBILITY ⭐

The DROP CAST command conforms to the SQL standard. periodt. πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

  • CREATE CAST (CREATE_CAST(7)) β€” the origin story, bestie. go read it. πŸ’œ

xoxo, this page comes from PostgreSQL 16.15, dated 2026, and it’s literally page DROP CAST(7). mwah 🫢

πŸ“¦ where this page comes from