ALTER TYPE

Function

ALTER TYPE modifies the definition of a type.

Syntax

Parameter Description

Examples

Rename the data type.

1
ALTER TYPE compfoo RENAME TO compfoo1;

Change the owner of the user-defined type compfoo1 to usr1.

1
ALTER TYPE compfoo1 OWNER TO usr1;

Change the schema of the user-defined type compfoo1 to usr1.

1
ALTER TYPE compfoo1 SET SCHEMA usr1;

Add the f3 attribute to the compfoo1 data type.

1
ALTER TYPE compfoo1 ADD ATTRIBUTE f3 int;

Add a tag value to the enumeration type bugstatus.

1
ALTER TYPE bugstatus ADD VALUE IF NOT EXISTS 'regress' BEFORE 'closed';

Rename a tag value of the enumeration type bugstatus.

1
ALTER TYPE bugstatus RENAME VALUE 'create' TO 'new';

Helpful Links

CREATE TYPE, DROP TYPE