Skip to content
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

#951 BUG SELECT DISTINCT ON expressions must match initial ORDER BY #952

Closed
siddarta-weis opened this issue Nov 8, 2023 · 1 comment
Closed

Comments

@siddarta-weis
Copy link

The commit in #951 broke in django 4.2.7 + postgresql, reverting to 5.0.6 works:

PostgreSQL has raised an error regarding the use of SELECT DISTINCT ON in conjunction with ORDER BY clauses.

ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions at character 21
STATEMENT: SELECT DISTINCT ON ("reversion_version"."object_id") "reversion_version"."id" FROM "reversion_version" WHERE ("reversion_version"."content_type_id" = 14 AND "reversion_version"."db" = 'default' AND NOT EXISTS(SELECT 1 AS "a" FROM "unidade_unidade" U0 WHERE U0."id" = ("reversion_version"."object_id")::bigint LIMIT 1)) ORDER BY "reversion_version"."id" ASC LIMIT 21

@etianen
Copy link
Owner

etianen commented Nov 8, 2023

Thanks! Reverted and released as 5.0.8 🙇

@etianen etianen closed this as completed Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants