When I try to set a default value for a boolean column on postgres, the generated DDL statement contains a not replaced binding.
I tried with version 3.11.0, 3.10.1, 3.10.7 and always got the same exception.
I do something like:
getContext()
.createTable("mytable")
....
.column("is_active", SQLDataType.BOOLEAN.defaultValue(true))
.constraints(
DSL.constraint(getPKName()).primaryKey("id"))
.getSQL();
and get this exception:
exception in thread "main" org.jooq.exception.DataAccessException: SQL [create table "myschema"."mytable"("....., "is_active" boolean null default ?, ...... ))]; No value specified for parameter 1.
at org.jooq_3.11.0.POSTGRES.debug(Unknown Source)
at org.jooq.impl.Tools.translate(Tools.java:2380)
at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:737)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:364)
at org.jooq.impl.DefaultDSLContext.execute(DefaultDSLContext.java:1071)
...
Caused by: org.postgresql.util.PSQLException: No value specified for parameter 1.
at org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:257)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:290)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:144)
at org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:209)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:432)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:350)
... 5 more