-
Notifications
You must be signed in to change notification settings - Fork 301
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
group_by with subset of columns doesn't work with postgres backend #412
Comments
Found a work around or maybe this is intentional? If I specify the columns I want in a custom query and pass in a new order_by so it's not by the default (id) then it works! |
I realize this is old, but in order to fix the bug, I need a brief minimal working example that demonstrates the issue, what the input is, what the output is, and what you expected the output to be. (Anyone who has this problem can jump in here to help out!) |
I'm facing the same issue. Following minimal example to reproduce it with Postgres:
Calling
Not sure if this helps but here's the full stacktrace anyway:
|
Postgres requires that group_by columns are the only columns included in the SELECT query. Other backends like MySQL and SQLite let this slide picking a random row for the columns not in the GROUP BY.
Ex: http://stackoverflow.com/a/18039886/709040
I think that the sqlalchemy query should be limited by include_columns or excluded_columns.
Thank you so much for this wonderful package! The search api is incredibly flexible and I would love the group_by feature to work for me.
The text was updated successfully, but these errors were encountered: