﻿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
15670	Doc issue: Some checking *is* performed on the SQL statement passed to raw()	dbreslau	nobody	"The doc page for Performing Raw Queries says:

 '''Warning'''

 No checking is done on the SQL statement that is passed in to .raw(). Django expects that the statement will return a set of rows from the database, but does nothing to enforce that. If the query does not return rows, a (possibly cryptic) error will result.

This isn't entirely true. In db/models/sql/query.py, the `RawQuery` class contains a method, `validate_sql`, that throws an exception if the statement doesn't begin with ""SELECT"".

We'd actually rather it didn't do this check, as we'd like to be able to run an UPDATE...RETURNING (as supported by Oracle and PostgreSQL) via the raw query mechanism. But if it's going to do this, then the documentation should reflect the checking."		closed	Documentation	1.2		invalid		dbreslau	Unreviewed	0	0	0	0	0	0
