diff --git a/jOOQ-test/src/test/java/org/jooq/test/all/testcases/DDLTests.java b/jOOQ-test/src/test/java/org/jooq/test/all/testcases/DDLTests.java index 645d0e9d1a..ebdf043e45 100644 --- a/jOOQ-test/src/test/java/org/jooq/test/all/testcases/DDLTests.java +++ b/jOOQ-test/src/test/java/org/jooq/test/all/testcases/DDLTests.java @@ -44,6 +44,7 @@ import static java.util.Arrays.asList; import static org.jooq.SQLDialect.DERBY; import static org.jooq.SQLDialect.FIREBIRD; // ... +import static org.jooq.impl.DSL.field; import static org.jooq.impl.DSL.table; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -135,7 +136,7 @@ extends BaseTest ctx) { + SQLDialect family = ctx.configuration().dialect().family(); + ctx.start(ALTER_TABLE_TABLE) .keyword("alter table").sql(" ").visit(table) .end(ALTER_TABLE_TABLE); @@ -191,8 +197,20 @@ class AlterTableImpl extends AbstractQuery implements .qualify(true); if (alterType != null) { - ctx.sql(" ") - .keyword(alterType.getCastTypeName(ctx.configuration())); + if (asList(POSTGRES).contains(family)) { + ctx.sql(" ").keyword("type"); + } + /* [pro] xx + xxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x + xxxxxxxxx xxxxxxxxxxxxxxx xxxx xxxxxxx + x + xx [/pro] */ + + ctx.sql(" ").keyword(alterType.getCastTypeName(ctx.configuration())); + + if (!alterType.nullable()) { + ctx.sql(" ").keyword("not null"); + } } else if (alterDefault != null) { ctx.start(ALTER_TABLE_ALTER_DEFAULT)