Search code examples
postgresqlgeo

Postgres earth ERROR: value for domain earth violates check constraint "on_surface"


error on creating index PostgreSQL earth

CREATE INDEX "branch_location" ON "systems_branch" USING gist (ll_to_earth("latitude", "longitude"))

I got this error message in console

ERROR:  value for domain earth violates check constraint "on_surface"
CONTEXT:  SQL function "ll_to_earth" statement 1

Solution

  • latitude and longitude must not empty in all rows