On Jun 13, 2007, at 8:32 AM, Antonio wrote:
> > hi all, > > I've partition a table in PostgreSQL, with rules on UPDATE, DELETE > and INSERT. > When I INSERT a row, ok, but when i UPDATE a row, the program raise: > > ConcurrentModificationError: Updated rowcount 0 does not match > number of > objects updated 1 > > I know that when i use a RULE the command status return 0: > > ma=# SELECT * from smoduls.datirim_prev where id=6; > turno | id | rim_id | prev_id > -------+----+--------+--------- > d | 6 | 2 | 12 > (1 row) > > ma=# UPDATE smoduls.datirim_prev set rim_id=3 where id=6; > UPDATE 0 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > ma=# SELECT * from smoduls.datirim_prev where id=6; > turno | id | rim_id | prev_id > -------+----+--------+--------- > d | 6 | 3 | 12 > (1 row) > > but is "sane" to catch the exception with pass ?? what can I do to > resolve ? > > tanks in advance ... I hope that you've understood ;-)) > SQLAlchemy's ORM relies upon cursor.rowcount after an UPDATE or DELETE to get the number of rows affected. Why exactly does your rule cause this to fail ? if no way around that, id have to provide a hook into the postgres.py dialect to disable "rowcount". you might want to experiment with raw DBAPI code and see if you can get cursor.rowcount to behave properly in conjunction with your database setup. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---