DROP_CAST(7pg17)

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

πŸ’– NAME πŸ’–

okay so this is the DROP CAST page (manual name DROP CAST(7pg17), PostgreSQL 17.11 docs): DROP_CAST β€” remove a cast. Bestie, it's literally the "delete this cast" command. Periodt.

✨ SYNOPSIS ✨

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

🫢 DESCRIPTION 🫢

okay so DROP CAST removes a cast that was previously defined. It's giving cleanup era, and we love that for you.

To be able to drop a cast, you must own the source data type or the target data type. These are the same privileges that are required to create a cast. No cap, permissions are the whole vibe here.

πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” do not throw an error if the cast does not exist. A notice is issued in this case, so it's like a lil "hey bestie, nothing to drop" message.
  • source_type β€” the name of the source data type of the cast. The "from" side, iykyk.
  • target_type β€” the name of the target data type of the cast. The "to" side. πŸ’…
  • CASCADE β€” this key word does not have any effect, since there are no dependencies on casts. It's iconic but lowkey doing nothing.
  • RESTRICT β€” same energy: this key word does not have any effect, since there are no dependencies on casts.

🌈 EXAMPLES 🌈

To drop the cast from type text to type int:

DROP CAST (text AS int);

πŸ‘‘ COMPATIBILITY πŸ‘‘

The DROP CAST command conforms to the SQL standard. Standards-compliant and unbothered. ✨

πŸ¦‹ SEE ALSO πŸ¦‹


mwah πŸ’– that's the whole page, bestie. This page is from the PostgreSQL 17.11 documentation, dated 2026 β€” DROP CAST(7), signing off πŸ’…βœ¨

πŸ“¦ where this page comes from