Sometimes we get a warning like this:
2019-...  [Xc0BxiGn2g7j] LOG: process 15138 still waiting for ShareLock on transaction 274489730 after 1000.107 ms 2019-...  [Xc0BxiGn2g7j] DETAIL: Process holding the lock: 14625. Wait queue: 15138. 2019-...  [Xc0BxiGn2g7j] CONTEXT: while deleting tuple (1,32) in relation "foobar" 2019-...  [Xc0BxiGn2g7j] STATEMENT: DELETE FROM "foobar" WHERE "foobar"."id" IN (2216750)
Unfortuantely the process id (in this case
14625) does not help much.
We set the
application_name for all connections to PostgreSQL to a unique request-id.
Is there a way to let the above message print out the application name of the process which holds the connection?
Then it would make it much easier to investigate the root cause.
I updated the question, to show that the request-id of the blocked process is already visible to me. I am searching the request-id of process