DROP TYPE
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
The DROP TYPE
statement removes an existing user-defined datatype.
Syntax
Diagram
Grammar
drop_type ::= DROP TYPE [ IF EXISTS ] type_name;
Where
type_name
is an identifier (possibly qualified with a keyspace name).
Semantics
- An error is raised if the specified
type_name
does not exist unlessIF EXISTS
option is used. - A user-defined
type_name
cannot be dropped if it is currently used in a table or another type.
Examples
You can do this as shown below.
cqlsh:example> CREATE TYPE person(first_name TEXT, last_name TEXT, email TEXT);
cqlsh:example> DROP TYPE person;
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .