[DB-SIG] db.update() in pygresql fails!

D'Arcy J.M. Cain darcy@druid.net
Wed, 6 Jun 2001 10:16:31 -0400 (EDT)


Thus spake Julian Gollop
> Hello everybody,
> I have just started using pygresql with postgreSQL version 7.0.2, and python
> 1.5.2
> The db wrapper class seems really convenient, but my code fails
> 
> from pg import *
> 
> conn = DB('codo', user='postgres' )
> tgame = conn.get( 'lsn_game', gameVar['game_id], 'game_id' )         #get
> record for game
> conn.update( 'lsn_game', tgame )
> #update record
> 
> the update() fails with
> 
> KeyError: 'lsn_game'
> 
> I am sure this should work. I am not sure what version of the pg module this
> is (it came with the python 1.5.2)

You should really be on the PygreSQL list for this as this is using the
"Classic" interface, not the DB-API.

Anyway, now that we are here, the only thing I can think of without seeing
your schema is that you don't have a primary key on lsn_game although
it is supposed to handle that.

Send me your schema privately and I will try to help you.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.