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 mar, 03/03/2009 alle 08.59 -0500, Michael Bayer ha scritto:
> On Mar 2, 2009, at 8:29 PM, James Henstridge wrote:
> 
> >
> > Note that psycopg doesn't parse the SQL statements: it just sends them
> > through to PostgreSQL.  The response from PostgreSQL then indicates
> > whether the statement produced a result set.
> >
> > So you shouldn't really expect psycopg to exhibit special behaviour
> > for particular statements.
> 
> I wasn't expecting that at all.   I would note the structure of the  
> result returned using 2.0.9's behavior with this specifc test case is  
> completely different from that of 2.0.8, so psycopg2 is having an  
> effect (or was) on what is returned.

You're right and that's exactly why one should not call fetchXXX() after
a call to executemany(). Currently the result is undefined and can
change until we agree on something that is useful while respecting DBAPI
semantics.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
 Credo fermamente che da qualche parte, in una scatola ci sia un gatto
  che non è vivo ne morto. Credo anche che se i fisici non si sbrigano
  a dargli una scatoletta, ben presto sarà solo morto.
                              -- adattato da una frase di Sam Black Crow

_______________________________________________
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)

iEYEABECAAYFAkmtU1oACgkQvcCgrgZGjeuy8ACdFIApxr4bgSEOynzE9IO8eNFD
2AMAn1zRGHWl/SLJ9aEI43X6VZMBiq5f
=iRiS
-----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.