Skip to main content
Question

ST_GeomFromGeoJSON()

  • March 29, 2022
  • 1 reply
  • 7 views

lybhrwn742
Forum|alt.badge.img+1

Hi, during COPY this function returns an error if the polygon is invalid.
We want to insert the row even if an error occur. that is, to insert a null instead of the polygon.
What can we do in order to solve the problem?
We tried to wrap this function with user-defined function but we didn't find an option to catch the exception.

Thank you !

1 reply

Ariel_Cary
Forum|alt.badge.img
  • Participating Frequently
  • March 29, 2022

There is no workaround to that problem right now. But we do understand it can be useful to optionally have ST_GeomFromGeoJSON return null on failure. We're considering adding such option in future releases.