Re: [sqlalchemy] Expressing UPDATE...SET column = column + 1

2009-12-21 Thread Igor Katson
Alex Brasetvik wrote: On 12/20/09 13:31 , Igor Katson wrote: I want to increment a column by 1 with UPDATE table SET column = column + 1 WHERE id = %(id)s, This is covered here: http://www.sqlalchemy.org/docs/06/sqlexpression.html however, when writing instance.column += 1 in python,

[sqlalchemy] Expressing UPDATE...SET column = column + 1

2009-12-20 Thread Igor Katson
Hello, I want to increment a column by 1 with UPDATE table SET column = column + 1 WHERE id = %(id)s, however, when writing instance.column += 1 in python, it translates it to UPDATE table SET column = OLD_VALUE + 1, therefore, because while using many concurrent transactions, using OLD_VALUE

Re: [sqlalchemy] Expressing UPDATE...SET column = column + 1

2009-12-20 Thread Alex Brasetvik
On 12/20/09 13:31 , Igor Katson wrote: I want to increment a column by 1 with UPDATE table SET column = column + 1 WHERE id = %(id)s, This is covered here: http://www.sqlalchemy.org/docs/06/sqlexpression.html however, when writing instance.column += 1 in python, it translates it to