pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eugene Prokopiev <prokopiev@stc.donpac.ru>
To: pgsql-interfaces@postgresql.org
Subject: Python psycopg transaction isolation level
Date: Tue, 28 Feb 2006 21:27:29 +0300
Message-ID: <44049611.8050300@stc.donpac.ru> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <44049611.8050300@stc.donpac.ru>
Permalink:  ../44049611.8050300@stc.donpac.ru/
Also on:    postgresql.org/message-id/44049611.8050300@stc.donpac.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: prokopiev@stc.donpac.ru
  Subject: Re: Python psycopg transaction isolation level
  In-Reply-To: <44049611.8050300@stc.donpac.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox