- attached nonassociative_setoperations.diff
Parenthesizing non-associative set-functions
0.3.8 introduced _Grouping
as a way to apply parenthesises to clauses, obsoleting the parens
-keyword. (See #247) This makes it hard to nest set-functions that aren't associative (EXCEPT
is not associative, nor is UNION
associative with UNION ALL
)
One workaround might be to make the whole thing a subselect (adding .alias('foo').select()
to the inner except in test_except_style3
makes the test succeed) This seems to be necessary for SQLite, where parenthesises suffice in PostgreSQL. (For the same reason commented in #247) However, this workaround becomes quite tedious if you're nesting set-operations of arbitrary selects that may or may not be set operations themselves. Ideally, except_()
, union()
and others should add whatever parenthesises (for PostgreSQL) and/or make a sub-select of it (SQLite) as needed.
Comments (3)
-
Account Deleted -
Account Deleted - changed status to resolved
(original author: ants) Fixed in 51c0d90c8d3dff721329d5ef0eb896227aff3c99.
-
repo owner - removed milestone
Removing milestone: 0.3.9 (automated comment)
- Log in to comment
Test cases for two nested EXCEPTs and UNION/UNION ALL