-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid interpretation of where.not clause #367
Comments
Side note. IIRC |
Thanks for the thorough examples. I'll start looking into this soon and post any updates here. |
I dug into this some more and was able to replicate it. I also tried it with a GEOS backed factory and got a similar but slightly different result.
For some reason it's trying to cast it to The thing that seems strange is that the query looks ok to me, but the planner decides that it should try to compare text instead of using geography/geometry types when the In fact, I can do the same thing by querying my database directly and when using When I force the
I get this error:
So it seems this is some sort of implementation issue in PostGIS. I'll look more into their docs to see what they say about it. A potential solution could be to override the default where query when an RGeo node is detected and prefer |
As I cannot find that our bug is intended for this gem, I am opening the issue.
In one place we need to search data by NOT matching specific GPS point. When using SQL condition, it works, but query is corrupted when using ActiveRecord.
some schema information
Let's take a look at the following snippet with SQL statement.
But when we use ActiveRecord referencing
order.gps
, data processed by DB are corrupted usingwhere.not
condition.The result of this behavior is that each statement using AR is returning the
order
object. It seems to be wrong to me. Rails passes correctly serialized GPS point (0020000001000010e6402db6c8564586f340496d228cf2c22a
) as filter condition is same as in case usingST_Point
, butwhere.not
looks like it performs some extra encoding of data.The text was updated successfully, but these errors were encountered: