ERROR: deadlock detected Detail: Process 3986338 waits for ShareLock on transaction 17240616; blocked by process 3995437. Process 3995437 waits for ShareLock on transaction 17240617; blocked by process 3986338. Hint: See server log for query details. Where: SQL statement "UPDATE groups SET stat1=stat1+1,stat2=stat2+1,stat3=stat3+1,stat4=stat4+1 WHERE id = $1 " PL/pgSQL function "comins" line 8 at SQL statement