This page in other versions: 9.2 / 9.3 / 9.4 / 9.5 / current (9.6)  |  Development versions: devel  |  Unsupported versions: 7.1 / 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3 / 8.4 / 9.0 / 9.1

DROP TYPE

Name

DROP TYPE  --  remove a user-defined data type

Synopsis

DROP TYPE typename [, ...]
  

Inputs

typename

The name of an existing type.

Outputs

DROP

The message returned if the command is successful.

ERROR: RemoveType: type 'typename' does not exist

This message occurs if the specified type is not found.

Description

DROP TYPE will remove a user type from the system catalogs.

Only the owner of a type can remove it.

Notes

  • It is the user's responsibility to remove any operators, functions, aggregates, access methods, subtypes, and tables that use a deleted type. However, the associated array data type (which was automatically created by CREATE TYPE) will be removed automatically.

  • If a built-in type is removed, the behavior of the server is unpredictable.

Examples

To remove the box type:

DROP TYPE box;

Compatibility

A DROP TYPE statement exists in SQL99. As with most other "drop" commands, DROP TYPE in SQL99 requires a "drop behavior" clause to select between dropping all dependent objects or refusing to drop if dependent objects exist:

DROP TYPE name { CASCADE | RESTRICT }

PostgreSQL currently ignores dependencies altogether.

Note that the CREATE TYPE command and the data type extension mechanisms in PostgreSQL differ from SQL99.

See Also

CREATE TYPE

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Privacy Policy | About PostgreSQL
Copyright © 1996-2016 The PostgreSQL Global Development Group