-
Notifications
You must be signed in to change notification settings - Fork 28
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
Unsupported query: unsupported binary operator: <int> / <int> (desired <int>) #21
Comments
I think the problem is that the division operator yields float (or at least something besides int) and then the float can't be assigned to an integer column (similar to #20). @rafiss do you think this merits an issue in https://github.com/cockroachdb/cockroach. Possibly it would be covered by cockroachdb/cockroach#38965? These queries do work.
SELECT ..., ("expressions_number"."the_integer" / 2) AS "i" FROM "expressions_number" |
I don't think this could be addressed by automatically typecasting, since I don't think we'd add logic that could make the result lose precision without the user intending it. So I think the real DB issue we'd need to fix is: cockroachdb/cockroach#41448 |
If we know we're working with integers would one option be to use this operator instead, as outlined in the issue comment below?
|
Operators are customized in |
These queries work with psycopg3. |
Correction: these queries only work with server-side cursors. With client-side-binding cursors (which Django defaults to), this issue remains the same. |
Dividing an integer column by another integer in an
UPDATE
query crashes:Is there a plan to add support?
SQL:
The text was updated successfully, but these errors were encountered: