One Star

Problem to insert data in a PostgreSQL database

Hello
I have some problem to insert data in a PostgreSQL database.
I created a job in Talend OS which allows to import data from a CSV file into a PostgreSQL database.
I have in my table a varchar (10) attribute "date_start" that contains a date in "dd.MM.yyyy" format.
And in my CSV file I have a String (10) attribute that contains a date in the same format.
And when I run my job, I have always this error:
 
Exception in component tPostgresqlOutput_1
org.postgresql.util.PSQLException: ERROR: date/time field value out of range: "10.10.2013"
                at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
                at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
                at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
                at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
                at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
                at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304)
                at data_encoding.treatments_0_1.Treatments.tFileInputDelimited_1Process(Treatments.java:10494)
                at data_encoding.treatments_0_1.Treatments.runJobInTOS(Treatments.java:25067)
                at data_encoding.treatments_0_1.Treatments.main(Treatments.java:24924)


I got the SQL query of the tPostgresqlOutput component and execute it with pgAdmin in my database.
The insertion is carried without problems.
I don’t know how to solve this problem.
Thank you for your help.
2 REPLIES
Moderator

Re: Problem to insert data in a PostgreSQL database

Hi,
Your workflow is tfileinputdelimited-->tPostgresqlOutPut?
Please show us the screenshot of schema setting. Have you also checked your postgresql.conf file? Is the parameter datestyle = 'iso, dym'?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Problem to insert data in a PostgreSQL database

Hi,
The parameter datestyle is 'german, dym'. It's a problem?
For the schema I have :
tfileinputdelimited                         ----->       tPostgresqlOutPut
Date_user    String  Nullable    10              Date_user    VARCHAR  Nullable    10

Thanks