Lazy expression not enclosed in braces

Bug #903777 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
New
Undecided
Unassigned

Bug Description

An assignment like:

  person.toy_count = Select(Count(Toy.id), Toy.owner == person)

results in SQL (for PostgreSQL) like:

  UPDATE Person SET toy_count = SELECT COUNT(Toy.id) FROM Toy ... ;

Note the absence of braces around the SELECT. This is rejected by PostgreSQL.

The following is a useful workaround:

  person.toy_count = Union(Select(...))

but it smells a bit.

Revision history for this message
James Henstridge (jamesh) wrote :

This is probably just a problem with the precedence in the expression compiler rather than just being related to arbitrary lazy expressions.

The extra parentheses in your workaround probably come from the interaction of the Union() and Select() rather than the Update() and Union().

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.