New versions: Dev (3.15) | Latest (3.14) | 3.13

ALTER TYPE

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The following types of statements are supported when altering a type:

RENAME

Like most object types, types can be renamed. This is independent of the object type:

// Renaming the sequence
create.alterType("old_type").renameTo("new_type").execute();

Enum type alterations

Some alterations are specific to enum types, e.g. in PostgreSQL. These include:

// Adding an enum value to an existing type
create.alterType("type").addValue("new_enum_value").execute();

// Renaming an enum value of an existing type to a new value
create.alterType("type").renameValue("old_enum_value").to("new_enum_value").execute();

// Move an enum type to a new schema
create.alterType("type").setSchema("new_schema").execute();
The jOOQ Logo