Skip to content
Advertisement

PostgreSQL query update returns UPDATE 0

I am having trouble with a PostgreSQL query where my update condition contains more prerequisites.

I attached 2 images to describe my problem.

I want to update the highlighted row

But the response is:

Advertisement

Answer

Your problem might be somewhere else (see this db<>fiddle)

A few thoughts on your data:

  • Reduce the level of precision of your coordinates. With 13 decimals you’re in the realm of microns, which isn’t very useful in geo applications. As you can see yourself, this level of precision it makes = queries quite challenging.
  • Consider using PostGIS to store your coordinates. It has over 1.3k kickass functions that make dealing with geospatial data very easy and efficient. It might seem complex in the beginning but believe me, it will definitely pay off on the long run!
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement