Name

ALTER TYPE — change the definition of a type

Synopsis

ALTER TYPE name OWNER TO new_owner 
ALTER TYPE name SET SCHEMA new_schema
  

Description

ALTER TYPE changes the definition of an existing type. The only currently available capabilities are changing the owner and schema of a type.

Parameters

name

The name (possibly schema-qualified) of an existing type to alter.

new_owner

The user name of the new owner of the type. You must be a superuser to change a type's owner.

new_schema

The new schema for the type. To move a type to a new schema, you must be the owner of the type and have CREATE privilege on the new schema.

Examples

To change the owner of the user-defined type email to joe:

ALTER TYPE email OWNER TO joe;
   

To change the schema of the user-defined type email to customers:

ALTER TYPE email SET SCHEMA customers;
   

Compatibility

There is no ALTER TYPE statement in the SQL standard.