При добавлении сообщения вылетело сообщение о дидлоке.
Если будет интересно и принесёт пользу, то вот оно.
Событие было разумеется разовым.
PreparedStatementCallback; SQL [INSERT INTO comments (id, userid, title, postdate, replyto, deleted, topic, postip, ua_id) VALUES (?, ?, ?, CURRENT_TIMESTAMP, ?, 'f', ?, ?::inet, create_user_agent(?))]; ERROR: deadlock detected Detail: Process 2569796 waits for ShareLock on transaction 4281036; blocked by process 2569843. Process 2569843 waits for ExclusiveLock on tuple (8679,70) of relation 187714 of database 16402; blocked by process 2569796. Hint: See server log for query details. Where: SQL statement «SELECT groupid FROM topics WHERE topics.id = NEW.topic FOR UPDATE» PL/pgSQL function «comins» line 4 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: deadlock detected Detail: Process 2569796 waits for ShareLock on transaction 4281036; blocked by process 2569843. Process 2569843 waits for ExclusiveLock on tuple (8679,70) of relation 187714 of database 16402; blocked by process 2569796. Hint: See server log for query details. Where: SQL statement «SELECT groupid FROM topics WHERE topics.id = NEW.topic FOR UPDATE» PL/pgSQL function «comins» line 4 at SQL statement