logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Python psycopg transaction isolation level: msg#00085

Subject: Python psycopg transaction isolation level
Hi,

I have a simple python script:

connection = psycopg.connect("host="+server+" dbname="+database+" user="+login+" password="+password)
cursor_modify = connection.cursor()
cursor_modify.execute("update messages set flag=1 where flag=0")
connection.commit()

On running it sometimes I got:

psycopg.ProgrammingError: ERROR: could not serialize access due to concurrent update

How can I setup isolation level for waiting end of executing other transaction and execute update without any error?

--
Thanks,
Eugene Prokopiev

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



<Prev in Thread] Current Thread [Next in Thread>