Re: deadlock detected - when multiple threads try to update

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: deadlock detected - when multiple threads try to update
Дата
Msg-id 20051203075953.Q19848@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: deadlock detected - when multiple threads try to update one table  (Harakiri <harakiri_23@yahoo.com>)
Список pgsql-general
On Fri, 2 Dec 2005, Harakiri wrote:

> Hi, thanks for the response ,
>
> >
> > It's hard to say with just the above. Are you doing
> > other things in the
> > transactions besides a single update of that table
> > and/or is the order of
>
> in each transaction i do basically the same stuff :
>
> insert 1 row into table A, B, C (B and C have a
> foreign key in A) without any sub queries - i just
> plainy insert data..
>
> then - update my table D row for today with some
> numbers (as described)
>
> > events consistent between the transactions? Does the
> > table have any
> > triggers, rules or foreign keys?
>
> The table D in question does not have any triggers,
> rules or foreign keys - it has only one PK and a few
> numeric fields.
>
> I dont understand why, when multiple connections do :
>
> T1
> update myTable set field1 = field1 + 1, field2 =
> field2 + 5000 where myID = 1;
>
> T2
> update myTable set field1 = field1 + 1, field2 =
> field2 + 2500 where myID = 1;

I don't immediately see a reason either if it's deadlocking on the myTable
changes.  Can you build a self-contained example with schema?

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

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Regular Expression Question
Следующее
От: Tyler MacDonald
Дата:
Сообщение: Re: memory leak under heavy load?