Postgresql 中文操作指南

DROP CAST

DROP CAST — 删除转换

DROP CAST — remove a cast

Synopsis

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

Description

DROP CAST 删除先前定义的转换。

DROP CAST removes a previously defined cast.

要能够删除转换,你必须拥有源数据类型或目标数据类型。这些与创建转换所需的特权相同。

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.

Parameters

  • IF EXISTS

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

  • 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.

Examples

要删除从类型 text 到类型 int 的转换:

To drop the cast from type text to type int:

DROP CAST (text AS int);

Compatibility

DROP CAST 命令符合 SQL 标准。

The DROP CAST command conforms to the SQL standard.