DROP CAST

删除一个类型转换。

概要

DROP CAST [IF EXISTS] (<sourcetype> AS <targettype>) [CASCADE | RESTRICT]

描述

DROP CAST 将删除先前定义的类型转换。要删除类型转换,您必须拥有源数据类型或目标数据类型的权限。这些权限与创建类型转换所需的权限相同。

参数

  • IF EXISTS
    • 若该转换不存在,则不抛出异常。此时将发出一个提示。
  • sourcetype
    • 转换操作中源数据类型的名称。
  • targettype
    • The name of the target data type of the cast.
  • CASCADE
  • RESTRICT
    • These keywords have no effect since there are no dependencies on casts.

示例

将类型从文本类型改为整数类型:

DROP CAST (text AS int);

兼容性

DROP CAST 命令符合 SQL 标准。

另见

CREATE CAST