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

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <[email protected]>
Il giorno lun, 02/03/2009 alle 17.32 -0500, Michael Bayer ha scritto:
> 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.

It is not that I am completely against this but I care a lot about the
DBAPI and the document makes quite clear that executemany() is not
supposed to return/aggregate multiple result sets. So I better like to
not overload it right now.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
  Se consideri l'uso del software libero una concessione tu stesso,
   come potrai proporla agli altri?                         -- Nick Name

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkmsYgUACgkQvcCgrgZGjeu2jQCePU+XNWA7XGvWuC3YwYdHGvC0
J1gAn0wuNxmwCQphXUvpOGi0gaO/1Ftj
=cVCb
-----END PGP SIGNATURE-----
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.