On Tue, Nov 8, 2011 at 12:25 PM, Andre Terra <andrete...@gmail.com> wrote:
> On Tue, Nov 8, 2011 at 12:40 AM, Russell Keith-Magee
> <russ...@keith-magee.com> wrote:
>>
>> If you ask a query to output its SQL, what is displayed is not exactly
>> equivalent to what is passed to the underlying query engine. Django
>> uses a standard Python database API to access the database. That
>> database API specifies the way that arguments are passed in to queries
>> (which handles the quoting automatically), but doesn't provide a way
>> to (easily and quickly) extract the *literal* SQL that was ultimately
>> executed. For debugging purposes, the query generates a quick
>> approximation of the SQL corresponding to a query, but that SQL isn't
>> 100% exactly the same as that seen by the database.
>
> Very, very interesting! Is this mentioned in the docs anywhere? I don't
> remember reading about it before.
>
>
> Cheers,
> AT
>

It's alluded to here:

https://docs.djangoproject.com/en/1.3/topics/db/sql/#connections-and-cursors

and mentioned specifically for SQLite in the trunk docs (but not 1.3):

https://docs.djangoproject.com/en/dev/ref/databases/#parameters-not-quoted-in-connection-queries

although in my experience it also affects all the other backends, so
I'm not sure why that advice is specifically for SQLite.

Cheers

Tom

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

Reply via email to