Problems with triggers and table lock

From: Job <Job(at)colliniconsulting(dot)it>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Problems with triggers and table lock
Date: 2017-12-01 21:39:58
Message-ID: 88EF58F000EC4B4684700C2AA3A73D7A08180ABD2134@W2008DC01.ColliniConsulting.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear guys,

we are using Postgresql 9.6.1 with Rubyrep in order to replicate some tables across two different, and remote, database servers.
Since few weeks sometimes when inserting/updating some rows, the statement remains waiting and table seems locked for insert/updates.

When i issue "select * from pg_stat_activity" no query is locked.
I only obtain this error messages when i kill (i also try directly from bash with pgsql) with "ctrl+c" the locked insert:

ERROR: canceling statement due to user request
CONTEXT: while updating tuple (0,7) in relation "TABLE"
SQL statement "UPDATE TABLE SET FIELD=NOW() WHERE FIELD IS NULL"
PL/pgSQL function TRIGGER_NAME() line 3 at SQL statement

How can i see what is locking my table/tables?

Thank you!
F

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-12-02 00:02:24 Re: pg data backup from vps
Previous Message Rory Campbell-Lange 2017-12-01 20:46:50 Re: pg data backup from vps