Re: does the executemany() limitation with result sets apply to INSERT..RETURNING ?

Michael Bayer <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Mar 2, 2009, at 3:09 AM, Federico Di Gregorio wrote:

> Il giorno dom, 01/03/2009 alle 15.07 -0500, Michael Bayer ha scritto:
>> - executemany() now return the numer of total INSERTed or UPDATEd
>>    rows. Note that, as it has always been, executemany() should not
>>    be used to execute multiple SELECT statements and while it will
>>    execute the statements without any problem, it will return the
>>    wrong value.
>>
>> This appears to be the case as well for INSERT...RETURNING as in the
>> example below.
>
> This has always been the case with any statement returning tuples.
> executemany() *is not* for gathering multiple result sets.

well the only difference here is that an INSERT..RETURNING would in  
theory return just one result set even for many statement executions,  
since each insert only affects a single row.

but don't worry, im not asking for this, just confirming the behavior.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.