Server side prepared statements and executemany

From: Luca Ferroni <luca(at)befair(dot)it>
To: psycopg(at)postgresql(dot)org
Subject: Server side prepared statements and executemany
Date: 2013-11-15 08:45:09
Message-ID: 5285DF15.3020605@befair.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Hi all,

I'm a new subscriber of this list. I use postgresql and python-psycopg2 for some years,
mostly through Django, but sometimes directly.

First of all, thanks and many compliments for this piece of sotware to the authors.
I write about server side prepared statements support.

I asked to majordomo-owner for a sweet way to search in the archives,
but I haven't got response, so I hope you forgive me if I ask about an argument
you have alreasy discussed about.

I followed Daniele's post
http://initd.org/psycopg/articles/2012/10/01/prepared-statements-psycopg/
and I tried his implementation
https://gist.github.com/dvarrazzo/3797445

but I have discovered that it does not work for a syntax error on $1

In the doc I read that cursor.execute() prepares and executes statements.
I take a look at the python and c code, but I didn't get where this happens.

Can you please me confirm what is written in the doc and how it works?
In that case, the Daniele's post on initd.org is to be considered obsoleted?
Furthermore: is there a way to call explicitly the SQL PREPARE statement?

At the end: can I use "executemany" on SELECT statements, and retrieve
results from different selects? how?

Thanks again for your works
Luca `fero`

--
Luca Ferroni
http://www.befair.it - http://www.lucaferroni.it
Tel: +39 328 9639660
LinkedIn: http://www.linkedin.com/in/lucaferroni

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2013-11-15 11:10:37 Re: Server side prepared statements and executemany
Previous Message Daniele Varrazzo 2013-11-13 14:39:35 Re: psycopg2.Error.pgerror encoding ?