DROP_CAST(7pg15)

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

πŸ’– NAME πŸ’–

DROP_CAST β€” remove a cast. yes bestie, we are literally removing a cast that was previously defined. 🫢

okay so this is the DROP CAST page, manual name 7pg15, from the PostgreSQL 15.19 docs. let’s get into it ✨

✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

DROP CAST removes a previously defined cast. 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 yeah, ownership check first, bestie. πŸ”‘

πŸŽ€ 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 β€œhey, there was nothing there” but not a whole error situation πŸ™ˆ
  • 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. literally no effect. they are just vibing. πŸ’€

🌸 EXAMPLES 🌸

to drop the cast from type text to type int, you’d run:

DROP CAST (text AS int);

πŸ”₯ COMPATIBILITY πŸ”₯

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

πŸ’œ SEE ALSO πŸ’œ

CREATE CAST (CREATE_CAST(7)) β€” go check that out if you wanna make a cast instead, iykyk. 🧚


okay that’s the whole page β€” source/version is PostgreSQL 15.19, date is 2026, and this is the DROP CAST(7) manual page. bye bestie, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from