Thread: More about deadlock

More about deadlock

From
"Vit Timchishin"
Date:
Hello.

I've now got more details on my deadlock. Here is what I have at the time it occurs:
umh=# select * from pg_locks where transaction=1119237;
 relation | database | transaction |  pid  |     mode      | granted
----------+----------+-------------+-------+---------------+---------
          |          |     1119237 | 18880 | ShareLock     | f
          |          |     1119237 | 18404 | ExclusiveLock | t
(2 rows)

Can anyone tell me what are this "transaction" locks, when they are taken and why do I have a deadlock
here.

С уважением,
Виталий Валериевич Тимчишин,
Технический Директор
ООО "Голден Технолоджис"
http://www.gtech-ua.com




Re: More about deadlock

From
Tom Lane
Date:
"Vit Timchishin" <tivv@gtech-ua.com> writes:
> Can anyone tell me what are this "transaction" locks, when they are taken and why do I have a deadlock
> here.

Foreign-key update deadlock maybe?  If so, updating to 8.1 is probably
a good solution.  Previous versions took exclusive row locks on
referenced rows, and so you could easily get a deadlock on those row
locks.

            regards, tom lane