lastrowid not correct?
"Nicholas Bastin" <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
I searched the archives and didn't find anything about this as a known
problem, so maybe I'm doing something wrong. I have the following
code:
>>> import psycopg2
>>> conn = psycopg2.connect("dbname=RS user=nbastin")
>>> curs = conn.cursor()
>>> curs.execute("INSERT INTO Reports (uuid, path) VALUES (%s, %s)", ("foo", "bar",))
>>> curs.lastrowid
0
The row gets inserted into the database properly (after I commit), but
lastrowid never has a value other than 0. Am I supposed to be using
some other API for inserts such that lastrowid gets set?
--
Nick