Django 6.1 support - #143
Merged
Merged
Conversation
millerdev
enabled auto-merge
August 12, 2026 15:24
millerdev
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Django 6.1 (ticket #36795) made
SQLCompiler.quote_name()quote table aliases and deprecatedquote_name_unless_alias(), which did not.QJoin.as_sql()never quoted its alias, so a CTE joined inside a subquery, where the alias is prefix-bumped and no longer matches the CTE name, mixed a bare alias with quoted references to it:JOIN "cte" U2 ON "U2"."id" = .... PostgreSQL case-folds the former but not the latter, raisingmissing FROM-clause entry for table "U2".This fixes
test_raw_cte_subqueryandtest_alias_as_subquery(v1 and current), which already fail on Django 6.1, and adds a test for the join alias. Generated SQL is unchanged on Django < 6.1, where the alias stays bare to match what Django itself emits.The test matrix is derived from the
Framework :: Djangoclassifiers, so 6.1 was never exercised. Added it there and as a tox factor.