I've seen this too, also trying to do PgSQL FTS, and posted about it in
django-users
http://groups.google.com/group/django-users/browse_thread/thread/ef17cb9fff6d0391
it seems that two things are changed from pre-QSRF: params aren't
processed for the 'tables=' argument, and the tables= arguments are
quoted now, so you end up with something like
SELECT ... FROM "to_tsquery(%s) as query" ...
where before QSRF it would have executed
SELECT ... FROM to_tsquery('value of terms') as query ...
as a workaround, you can repeat the call to to_tsquery() and use
select_params=, as in:
--------
results = Product.objects.extra(
select={
'rank': "rank_cd(textsearchable,to_tsquery(%s), 32)",
},
where=["textsearchable @@ to_tsquery(%s)"],
params=[terms],
select_params=[terms],
order_by=('-rank',)
)
---------
Don't know how big of a hit it is to have to call to_tsquery() multiple
times even with the same args. But this isn't really just a fulltext
search issue, it could come up with other PgSQL functions that are more
heavyweight.
Barry