#14060 closed (fixed)
PostGISAdapter needs to properly cast input for comparisons on geography columns.
| Reported by: | jbronn | Owned by: | jbronn |
|---|---|---|---|
| Component: | GIS | Version: | 1.2 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When performing exact queries on geography columns, the input is not casted to the geography type, leading to an error:
DatabaseError: operator does not exist: geography ~= geometry
LINE 1: ... FROM "geogapp_city" WHERE "geogapp_city"."point" ~= ST_Geom...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Attached is an initial patch for a test case demonstrating the problem.
Attachments (2)
Change History (8)
by , 15 years ago
| Attachment: | geography_exact_fail.diff added |
|---|
comment:1 by , 15 years ago
| Component: | Uncategorized → GIS |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 15 years ago
| Summary: | `PostGISAdapter` needs to properly cast input for comparisons on geography columns. → PostGISAdapter needs to properly cast input for comparisons on geography columns. |
|---|
by , 15 years ago
| Attachment: | 14060.1.diff added |
|---|
comment:3 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:4 by , 15 years ago
comment:5 by , 15 years ago
PostGIS will properly cast internally geography types (hence why && operator works). The root cause of the issue is that despite the documentation, the ~= operator was never implemented for geography types. I had a discussion with Paul Ramsey in #postgis about this issue, and he confirmed it was a "doc mistake" and "only && was implemented for geography."
(In [13757]) Fixed #14060 -- PostGIS never implemented the
~=operator for geography types, so removed support for it.