On December 21, 2014 04:08:43 PM Andomar wrote:
> It is not always easy to tell the query type (function, prepared or 
> ad-hoc.) We use Python in mod_wsgi with psycopg2. The code shows ad-hoc 
> SQL, but who knows what the many layers between Python and the database do.
psycopg2 sends the SQL you feed it straight to the DB. If you don't feed it a 
PREPARE statement [1] it'll be an ad-hoc query; the value placeholders will be 
interpolated prior to statement submission by psycopg2. 
[1] http://www.postgresql.org/docs/9.2/interactive/sql-prepare.html