Skip to main content
Solved

Cannot fill timestamptz field in postgres table using postgres writer

  • November 13, 2018
  • 8 replies
  • 184 views

stalknecht
Contributor
Forum|alt.badge.img+22

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

Best answer by ebygomm

@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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

takashi
Celebrity
  • November 13, 2018

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


stalknecht
Contributor
Forum|alt.badge.img+22
  • Author
  • Contributor
  • November 13, 2018

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

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


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • November 13, 2018
@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

stalknecht
Contributor
Forum|alt.badge.img+22
  • Author
  • Contributor
  • November 13, 2018
@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


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • November 13, 2018

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


stalknecht
Contributor
Forum|alt.badge.img+22
  • Author
  • Contributor
  • November 13, 2018
@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


arnovananrooij
Contributor
Forum|alt.badge.img+5

@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.

 


takashi
Celebrity
  • January 16, 2020

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