How to see what SQL queries are associated with pg_locks?

Started by Aleksey Tsalolikhinover 15 years ago2 messagesgeneral
Jump to latest
#1Aleksey Tsalolikhin
atsaloli.tech@gmail.com

How to see what SQL queries are associated with pg_locks, please?

Could somebody help with the query? I can then add it to
http://wiki.postgresql.org/wiki/Lock_Monitoring

Best,
-at

#2Joshua Tolley
eggyknap@gmail.com
In reply to: Aleksey Tsalolikhin (#1)
Re: How to see what SQL queries are associated with pg_locks?

On Fri, Oct 01, 2010 at 11:27:11AM -0700, Aleksey Tsalolikhin wrote:

How to see what SQL queries are associated with pg_locks, please?

Look at the pid column in pg_locks. It will match the procpid column in
pg_stat_activity.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com