Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14

ALTER DOMAIN

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

The ALTER DOMAIN statement allows for altering DOMAIN types for use as data types in table columns.

// Alter the default of a domain
create.alterDomain("d").setDefault(1).execute();
create.alterDomain("d").dropDefault().execute();

// Alter the NOT NULL constraint of a domain
create.alterDomain("d").setNotNull().execute();
create.alterDomain("d").dropNotNull().execute();

// Add / remove CHECK constraints to a domain
create.alterDomain("d").add(constraint("c").check(value(INTEGER).gt(0))).execute();
create.alterDomain("d").dropConstraint("c").execute();

// Rename the domain
create.alterDomain("d").renameTo("e").execute();

// Rename a constraint
create.alterDomain("d").renameConstraint("c1").to("c1").execute();

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo