How can I get a list of locks in a table in Postgres?

Peter Barker pbarker at
Wed Mar 20 15:33:21 EST 2002

On Fri, 22 Feb 2002, Antony Stace wrote:

> I have run into a problem with postgres.  I cannot update somerows in
> a database while i can update others.  How can I see what locks are on
> a table/row in postgres?

I didn't see any responses for this one. I'm interested in any information
you may come across for it!

lsof may allow you to see which tables are locked, since postgres stores
tables in separate files in the fs. As far as I can see, getting
information from the various pg_ tables which presumably store this
information is difficult.

Peter Barker                          |   N    _--_|\ /---- Barham, Vic 
Programmer,Sysadmin,Geek              | W + E /     /\                
pbarker at         |   S   \_,--?_*<-- Canberra      
You need a bigger hammer.             |             v    [35S, 149E]   
qq%I've never heard of it or used it, apart from finding it in the Camel
 book and saying "Oh god".% -- Onceler

More information about the linux mailing list