Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group