DROP CAST
This page documents the preview version (v2.21). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
Synopsis
Use the DROP CAST
statement to remove a cast.
Syntax
Semantics
See the semantics of each option in the [PostgreSQL docs][postgresql-docs-drop-cast].
Examples
Basic example.
yugabyte=# CREATE FUNCTION sql_to_date(integer) RETURNS date AS $$
SELECT $1::text::date
$$ LANGUAGE SQL IMMUTABLE STRICT;
yugabyte=# CREATE CAST (integer AS date) WITH FUNCTION sql_to_date(integer) AS ASSIGNMENT;
yugabyte=# DROP CAST (integer AS date);