Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
From: Jason Hildebrand <jason@pe...> - 2003-04-09 02:37:10
When trying to insert an object into a MiddleKit/PostgreSQL store, I get
"/home/jdhildeb/projects/Webware/MiddleKit/Run/PostgreSQLObjectStore.py", line 36, in _insertObject
oid = curs.lastoid()
AttributeError: pgdbCursor instance has no attribute 'lastoid'
2 1.08 secs /resourceworks/Library?objectid=0
Google turned up this informative hit:
And it doesn't look like the pygresql bindings have been updated since
Dec 2001. Can anyone confirm that pygresql still needs to be patched to
make cursor.lastoid available?
I'm actually thinking of fixing this a different way. Since each table
in pgsql has an associated sequence, you can do:
to get the next value and increment the sequence (atomically).
Then you just specify the id explicitly when doing the insert.
PostgreSQLObjectStore could do this internally - it's clean and
eliminates the need for lastoid. Any objections if I make this change?
Jason D. Hildebrand