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: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

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")

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?

Eugene Prokopiev


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-2017 The PostgreSQL Global Development Group