Skip to main content
Solved

Cannot fill timestamptz field in postgres table using postgres writer

  • November 13, 2018
  • 8 replies
  • 128 views

stalknecht
Contributor
Forum|alt.badge.img+19

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
View original
Did this help you find an answer to your question?

8 replies

takashi
Influencer
  • November 13, 2018

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


stalknecht
Contributor
Forum|alt.badge.img+19
  • Author
  • Contributor
  • November 13, 2018
takashi wrote:

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+32
  • 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+19
  • Author
  • Contributor
  • November 13, 2018
ebygomm wrote:
@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+32
  • Influencer
  • November 13, 2018
stalknecht wrote:

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+19
  • Author
  • Contributor
  • November 13, 2018
ebygomm wrote:
@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
stalknecht wrote:

@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
Influencer
  • January 16, 2020
arnovananrooij wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings