Hi,

I'd like to offer a vote in favor of accepting the original patch to #14733, 
which removes the validation of the query done in a .raw() operation on a 
QuerySet.

The current situation is that Django requires that any query passed in begin 
with the literal string "SELECT", under the theory that only things beginning 
with SELECT return results ("set-returning operations").  This isn't correct.

In PostgreSQL, as it stands right now, operations which return sets can begin 
with:

        SELECT
        FETCH
        INSERT
        WITH
        TABLE

(I may have missed some.)

This list isn't static, either; DO might well return sets in the future, 
although it doesn't right now.  And, of course, the exact list of the things 
that can return sets is backend-specific; that's just PG's list.

Given that .raw() is very much a "You must know what you are doing" feature in 
the first place, I don't see the need to be strict about the input, at the cost 
of some very useful functionality.

--
-- Christophe Pettus
   x...@thebuild.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to