Re: executemany rowcount
Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Organization | initd.org |
| Message-ID | <[email protected]> |
Il giorno ven, 06/02/2009 alle 12.00 +0100, Markus Demleitner ha scritto: > Hi, > > At some point between 2.0.6 and 2.0.8 the old executemany/rowcount > behaviour of just leaving the rowcount of the last execute alone got > fixed to have executemany always leave a rowcount of -1. > > This somewhat rains on my parade since I'd have to special-case > update operations where users expect to see whether they've changed > anything. They used to work by chance since I'd execute only one > statement in that case anyway. > > Now, I'd suggest the following behaviour for executemany and > rowcount: > > We want meaningful rowcounts for an executemany. The rules are: > The rowcount is the sum of all individual rowcounts, except when > a single rowcount is -1. In that case, and when an error occurs, > the whole rowcount is -1. Seems fine and it also passes the DBAPI tests. I integrated your patch and it is now in bzr. Many thanks. federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer [email protected] INIT.D Developer fog-NGVKUo/i/[email protected] Lasciate che i furetti vengano a me. -- Maria Luisa Benedetta Panzani _______________________________________________ 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) iEYEABECAAYFAkmNx2gACgkQvcCgrgZGjesk/gCfQfojzPcImsSD2UIbWaY/0XB7 cZEAoJmpEGXfPTvlaO6r/mHk2y+G+hXn =Qq1g -----END PGP SIGNATURE-----