For PostgreSQL if you're using GROUP BY everything in the SELECT
list must be an aggregate SUM(...) or used in the GROUP BY.
For reference:
http://www.postgresql.org/message-id/
200402271700.28133.dev@archonet.com
Closes-bug: #
1486467
Change-Id: Ieb4ead5c785ff17f580bfbc58f370a491733d96d
quota_models.Reservation.tenant_id == tenant_id,
quota_models.ResourceDelta.resource.in_(resources),
exp_expr)).group_by(
- quota_models.ResourceDelta.resource)
+ quota_models.ResourceDelta.resource,
+ quota_models.Reservation.expiration)
return dict((resource, total_reserved)
for (resource, exp, total_reserved) in resv_query)