Solved

Cannot fill timestamptz field in postgres table using postgres writer

  • 13 November 2018
  • 8 replies
  • 33 views

Userlevel 1
Badge +18

When I try to add data to a timestamptz field in postgres using the postgres writer it gives the following error:

Value of attribute 'start_date' could not be converted to type 'timestamptz'. Feature will be logged and skipped
WARN Â |+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARN Â |Feature Type: `admin.real_right_version'
WARN Â |Attribute(string) Â : `start_date' has value `2018-11-13 09:43:58.3875761+01'

I'm using FME 2018.1 and postgressql 10.5

icon

Best answer by ebygomm 13 November 2018, 09:52

View original

8 replies

Userlevel 2
Badge +17

Try converting the "start_date" value into the Standard FME Date/Time Format before writing.

Userlevel 1
Badge +18

Try converting the "start_date" value into the Standard FME Date/Time Format before writing.

Thank you, @takashi @DateTimeNow(utc) did the trick

Userlevel 1
Badge +21
@DateTimeNow() should give exactly the same result as the timestamper - both produce output in Standard FME Date/Time format - you shouldn't need to format either before writing to postgres
Userlevel 1
Badge +18
@DateTimeNow() should give exactly the same result as the timestamper - both produce output in Standard FME Date/Time format - you shouldn't need to format either before writing to postgres

But this doesn't work for me. Only the DateTimeStamper did the trick. Maybe it has something to do with the UTC offset

Userlevel 1
Badge +21

But this doesn't work for me. Only the DateTimeStamper did the trick. Maybe it has something to do with the UTC offset

@DateTimeNow(utc) if you need UTC time

Userlevel 1
Badge +18
@DateTimeNow() should give exactly the same result as the timestamper - both produce output in Standard FME Date/Time format - you shouldn't need to format either before writing to postgres

@DateTimeNow(utc) did the trick

Badge +4

@DateTimeNow(utc) did the trick

I have the same issue here now. I don't really get how you solved it. I have an attribute with date and time from a gml file and i want to insert this in an postgis database with attribuite type timestamptz.

 

Userlevel 2
Badge +17

I have the same issue here now. I don't really get how you solved it. I have an attribute with date and time from a gml file and i want to insert this in an postgis database with attribuite type timestamptz.

 

If you are using the PostGIS writer to write the features into the database table, you will have to format the datetime value with the Standard FME Date/Time format.

See here to learn more: Standard FME Date/Time Format

Reply