Re: Python psycopg transaction isolation level

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Python psycopg transaction isolation level
Дата
Msg-id 20060228190721.GA6495@winnie.fuhr.org
обсуждение исходный текст
Ответ на Python psycopg transaction isolation level  (Eugene Prokopiev <prokopiev@stc.donpac.ru>)
Список pgsql-interfaces
On Tue, Feb 28, 2006 at 09:27:29PM +0300, Eugene Prokopiev wrote:
> 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

psycopg's default isolation level is SERIALIZABLE.  I think the way
to set the isolation level to READ COMMITTED is:

connection = psycopg.connect(...)
connection.set_isolation_level(1)

You'll find more psycopg expertise on the psycopg mailing list:

http://lists.initd.org/mailman/listinfo/psycopg

-- 
Michael Fuhr


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

Предыдущее
От: Eugene Prokopiev
Дата:
Сообщение: Python psycopg transaction isolation level
Следующее
От: Philip Yarra
Дата:
Сообщение: Re: multiple threads using one connection