I tried to load a csv file using the jooq loadCSV method (such as
.loadCSV(inputStream).fields(fields).nullString("").execute()), one of the
columns of my table in Postgres was defined as “character
varying(100)[]”, it was generated as “String[]” in the generated pojo
class, when the corresponding cell in the csv file contains something like
“{A321, B456}” it didn’t work, upload failed. I have doubled checked that I
used SQLDialect.POSTGRES and I also tried PostgresDSL instead of DSL, it
didn't help.
I also tried a jooq custom datatype converter and binding, my table column
is defined as “character varying(100)[]”, before I used the converter it
was generated as “String[]” in the generated pojo class; after I used the
converter it was generated as “String” in the pojo, it didn’t work either,
the code threw DataAccessException in “Loadimpl.java”.
I know Postgres supports Array data type, when I used the same data to
insert directly to Postgres database in pgAdmin, the query executed
successfully and a row was inserted, the array column is populated with
data like “{A321, B456}”. I also used "COPY ... FROM ..." sql to load a CSV
file directly into Postgres database, it worked fine.
I was wondering if this is something jooq hasn’t supported yet; if yes
would the team support it in the future release?
Look forward to getting some help. Thanks a lot.
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.