I'm using SQLAlchemy 0.7.9 with PostgreSQL.

I have a column_property that I'm having trouble with (test case at
http://pastebin.com/hm5CDiV4, reformatted rendered SQL at
http://pastebin.com/hztBvLUU). The column_property is included twice in
the SELECT columns clause with the same alias, causing a 'column
reference "anon_2" is ambiguous' error when executed.

I can only get this to happen if:

 1. The column_property expression is Boolean-typed, e.g. somecol =
    column_property(othercol > 0). I get no problems with a regular
    boolean column or if the column_property is an arithmetic
    expression, e.g. somecol = column_property(othercol + 1).
 2. I order the query by the column property, e.g. q = q.order_by(somecol)
 3. The query uses LIMIT + joinedload, which causes a subquery to be
    used and forces the ORDER BY clause to be included in the subquery's
    SELECT columns clause.

It seems like SQLAlchemy's "is this property already in the columns
clause" code fails to detect Boolean-typed column_property objects. Does
this sound right?

-Conor

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to