Python psycopg transaction isolation level

Поиск
Список
Период
Сортировка
От Eugene Prokopiev
Тема Python psycopg transaction isolation level
Дата
Msg-id 44049611.8050300@stc.donpac.ru
обсуждение исходный текст
Ответы Re: Python psycopg transaction isolation level  (Michael Fuhr <mike@fuhr.org>)
Список 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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: multiple threads using one connection
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Python psycopg transaction isolation level