You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DB Schema
CREATE TABLE sanctions.sanction_suspension
(
id bigserial not null,
sanction_id varchar(255) NOT NULL,
suspension_status int NOT NULL,
created_on timestamp not null default now(),
last_updated_on timestamp not null default now(),
suspension_reasons varchar[],
CONSTRAINT sanction_id_unique UNIQUE (sanction_id),
CONSTRAINT sanction_suspension_pk PRIMARY KEY (id)
);
jooq Generated Column
public final TableField<SanctionSuspensionRecord, String[]> SUSPENSION_REASONS = createField("suspension_reasons", org.jooq.impl.SQLDataType.VARCHAR.getArrayDataType(), this, "");
Code to insert values into table
DSL.using(config).insertInto(SANCTION_SUSPENSION).
set(SANCTION_SUSPENSION.SUSPENSION_REASONS, new String[]{"30", "40"}).execute();
}
Error:
org.jooq.exception.DataAccessException: SQL [insert into "sanctions"."sanction_suspension" ("created_on", "sanction_id", "suspension_reasons", "suspension_status", "last_updated_on") values (cast(? as timestamp), ?, ?::varchar[], ?, cast(? as timestamp))]; [Amazon]JDSI Data type not supported: 1111] with root cause
Expected behavior
Should insert the value
Steps to reproduce the problem
Create a postgres table with varchar[] column
Run jooq code generation Tool (mvn clean package -DskipTests -Pjooq)
Run maven Application
Use DSL to insert data into the column
jOOQ Version
3.10.4
Database product and version
Postgres 9.4.1212
Java Version
8
JDBC / R2DBC driver name and version (include name if unofficial driver)
org.postgresq:postgresq:9.4.1212
The text was updated successfully, but these errors were encountered:
Thanks for your message. I'm not aware of any such limitation, though all of the versions you've shown are very dated. You probably have your reasons for sticking to outdated libraries...
But to help you, I'll have to see at least:
The complete stack trace
A complete reproducer (that ensures all the outdated stuff is linked properly, it's impossible to find your specific configuration by trial and error on my side). We have a template for Minimal, Complete, Verifiable Examples here to help reproducing such issues: https://github.com/jOOQ/jOOQ-mcve
The main hint I'm seeing is "Data type not supported: 1111", where 1111 corresponds to java.sql.Types.OTHER, clearly something that jOOQ normally doesn't use when binding arrays to pgjdbc.
Actual behavior
DB Schema
CREATE TABLE sanctions.sanction_suspension
(
id bigserial not null,
sanction_id varchar(255) NOT NULL,
suspension_status int NOT NULL,
created_on timestamp not null default now(),
last_updated_on timestamp not null default now(),
suspension_reasons varchar[],
CONSTRAINT sanction_id_unique UNIQUE (sanction_id),
CONSTRAINT sanction_suspension_pk PRIMARY KEY (id)
);
jooq Generated Column
Code to insert values into table
Error:
org.jooq.exception.DataAccessException: SQL [insert into "sanctions"."sanction_suspension" ("created_on", "sanction_id", "suspension_reasons", "suspension_status", "last_updated_on") values (cast(? as timestamp), ?, ?::varchar[], ?, cast(? as timestamp))]; [Amazon]JDSI Data type not supported: 1111] with root cause
Expected behavior
Should insert the value
Steps to reproduce the problem
Create a postgres table with varchar[] column
Run jooq code generation Tool (mvn clean package -DskipTests -Pjooq)
Run maven Application
Use DSL to insert data into the column
jOOQ Version
3.10.4
Database product and version
Postgres 9.4.1212
Java Version
8
JDBC / R2DBC driver name and version (include name if unofficial driver)
org.postgresq:postgresq:9.4.1212
The text was updated successfully, but these errors were encountered: