DROP CAST

Introduction

DROP CAST: Remove a type cast defined previously.

Note: to delete a type cast, you must own the source or the target data type.

Synopsis

In Hologres, the format of DROP CAST is:

DROP CAST [ IF EXISTS ] (source_type AS target_type) 

Parameters

IF EXISTS: Do not throw an error if the cast does not exist. A notice is issued in this case.

source_type: source data type name of the cast.

target_type: target data type name of the cast.

Example

To delete a type cast from text to int:

DROP CAST if exists (text AS timestamptz);
DROP CAST if exists (text AS integer);

For more information about CREATE CAST, please refer to PostgreSQL official website.