tMap and writing to PostgreSQL Interval column

Highlighted
One Star

tMap and writing to PostgreSQL Interval column

Hello.
I'm trying to write to an Interval column
in a PostgreSQL DB. My setup is fairly simple:
tFileInputDelimited --row1-> tMap --out1-> tPostgresqlOutput

The data I'm trying to write looks like 1:30 or 0:30,
I read it in as a string and in tMap I convert it to
time like this:
TalendDate.isDate(row1.timecol, "H:mm")
?TalendDate.parseDate("H:mm", row1.timecol)
:null

and this is what I'm trying to insert into an
Interval column in the DB.  The error I'm
getting is:

ERROR: invalid input syntax for type interval: "1970-01-01 00:00:00.000000 +02:00:00"ERROR: current transaction is aborted, commands ignored until end of transaction block

How should I write to the Interval column?
JB
One Star

Re: tMap and writing to PostgreSQL Interval column

Hello.
Furthermore, I was testing around reading data
from a table with an Interval type column and
writing it to a table of same kind:

tPostgresqlInput --row1-> tMap --out1-> tPostgresqlOutput

Reading the Interval data is fine but writing
produces the same error:
ERROR: invalid input syntax for type interval: "1970-01-01 00:30:00.000000 +02:00:00"ERROR: current transaction is aborted, commands ignored until end of transaction block

Repository schema in tPostgresqlInput and
-Output suggest Date type with 49 length
and dd-MM-yyyy pattern. The DB type is
INTERVAL.
Any solutions or suggestions?
Thanks.
JB
One Star

Re: tMap and writing to PostgreSQL Interval column

I circumvented this by creating another column in
the target table with type time without time zone
from which I UPDATE the data to type interval
column.  It works but if you know the answer, let
me know.
Thanks,
JB

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now