Full repo steps with minimal data
Postgres table:CREATE TABLE IF NOT EXISTS mytest
(
id VARCHAR(18) NOT NULL ENCODE lzo
,createddate TIMESTAMP WITH TIME ZONE ENCODE az64
)
Create filemytestimport.csv:
"id","createddate"
"abc123","2021-08-05T00:12:46.000Z"
WB Command:WbImport -type=text
-file='mytestimport.csv'
-delimiter=,
-table=mytest
-stringDates=true
-timestampFormat="yyyy-MM-dd'T'HH:mm:ss.SSSz"
Result
Could not convert ["2021-08-05T00:12:46.000Z"] for datatype TIMESTAMP_WITH_TIMEZONE
Importing file 'mytestimport.csv' into table mytest
Error importing row 1: An error parsing column [createddate], value=["2021-08-05T00:12:46.000Z"]: workbench.util.ConverterException: Could not convert ["2021-08-05T00:12:46.000Z"] for datatype TIMESTAMP_WITH_TIMEZONE
The file "mytestimport.csv" was not imported
If I remove the quotes from the date to look like this
mytestimport.csv:
"id","createddate"
"abc123",2021-08-05T00:12:46.000Z
I get this error:
Can't infer the SQL type to use for an instance of java.time.ZonedDateTime. Use setObject() with an explicit Types value to specify the type to use.
Importing file 'mytestimport.csv' into tablemytest
Error importing row 1
Error message: Can't infer the SQL type to use for an instance of java.time.ZonedDateTime. Use setObject() with an explicit Types value to specify the type to use. [SQL State=07006]
Values from input file: "abc123",2021-08-05T00:12:46.000Z
The file "mytestimport.csv" was not imported
Not sure which one is the better error to have but nothing is working for me at the moment :)