﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18743	select_for_update() silently ignored on aggregate queries	anonymous	nobody	"When used on aggregate queries, the new 1.4 select_for_update() silently omits ""FOR UPDATE"" from the generated SQL. Instead, I would expect Django to raise a database exception, as ""SELECT FOR UPDATE"" on an aggregate query does not make sense. For instance, raw PostgreSQL yields an error message:

# select max(id) from mytable for update;
ERROR:  SELECT FOR UPDATE/SHARE is not allowed with aggregate functions

In constrast, a Django query containing an aggregate like Max() and also using select_for_update() does not raise an exception."	Bug	closed	Database layer (models, ORM)	1.4	Normal	wontfix			Unreviewed	0	0	0	0	0	0
