On Thu, Apr 3, 2014 at 1:00 AM, Tobias Fielitz <tobias@streethawk.com> wrote:
> Hi All,
>
> I just stumbled across this conversation:
> http://permalink.gmane.org/gmane.comp.python.db.psycopg.devel/4775
>
> Is .mogrify still just for debugging usage?
That message is still valid: currently mogrify does what you expect
(actually better than it used to do in 2008). But in the future we
don't guarantee that (actually, if we move to sending parameters to
the server, new cursor classes may not have a mogrify method at all).
> I have a query generated by Django's ORM that I would like to execute as
> plain SQL (because I will wrap some SQL around it).
Why don't you wrap the SQL around the query with placeholders and then
pass the parameters?
-- Daniele