Python psycopg transaction isolation level

From: Eugene Prokopiev <prokopiev(at)stc(dot)donpac(dot)ru>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Python psycopg transaction isolation level
Date: 2006-02-28 18:27:29
Message-ID: 44049611.8050300@stc.donpac.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Fuhr 2006-02-28 19:07:21 Re: Python psycopg transaction isolation level
Previous Message Bruce Momjian 2006-02-28 18:17:07 Re: multiple threads using one connection