Closed
Description
Issue Description
If you use postgresql as database and need to calculate distances of GeoPoint
objects, you obviously need postgis. In postgis version > 2.2.0 the function ST_Distance_Sphere
was renamed to ST_DistanceSphere
which causes the Postgres Storage Adapter to fail here:
It should be possible to build these queries based on the postgis version by actually quering the version. I'll try to implement a fix but if anyone else has an elegant way to solve it, please do it :)
Steps to reproduce
- pull postgis/postgis or install postgis from source
- use postgis instead of mongo
- add a GeoPoint column to your class and try to query a near location
Expected Results
actual near locations
Actual Outcome
query fails with an internal error
Environment Setup
-
Server
- parse-server version (Be specific! Don't say 'latest'.) : 3.10.0 (
parseplatform/parse-server
image drom dockerhub) - Operating System: ubuntu
- Hardware: docker container
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): localhost
- parse-server version (Be specific! Don't say 'latest'.) : 3.10.0 (
-
Database
MongoDBPostgreSQL version: POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" (postgis/postgis
image from dockerhub)- Hardware: docker container
- Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): localhost
Logs/Trace
error: Parse error: error: function st_distance_sphere(geometry, geometry) does not exist
{"code":1,"stack":"Error: error: function st_distance_sphere(geometry, geometry) does not exist\n at /parse-server/lib/Controllers/DatabaseController.js:1194:21\n at processTicksAndRejections (internal/process/task_queues.js:94:5)"}
Metadata
Metadata
Assignees
Labels
No labels