tags:

views:

24

answers:

1

Hi,

I sometimes see messages like

Process 12990 waits for ExclusiveLock on tuple (889,66) of relation 17720 of database 17607; blocked by process 12992.

So of course the 'process' part is quite clear, but I don't know how to correlate between the relation ID and a human readable name. I also don't really know what to make of the tuple bit.

Anyone know how to read these messages and how to glean useful data from them?

Thanks!

A: 

You can look this up the system tables : the one of interest here is pg_class.

Doing a query like

SELECT OID, relname FROM pg-class
 oid  |              relname               
-------+------------------------------------
  1247 | pg_type
 11550 | user_mapping_options
 11554 | user_mappings
 11494 | triggered_update_columns
 11497 | triggers

or rather

SELECT relname FROM pg_class WHERE OID=17720

might shed light on the locks.

Peter Tillemans
Thanks! I figured out the id to relation mapping, but still not sure what to make of the tuples...
Actually, I should clarify - not sure how to read the tuple notation (x,y) and how I can use that to understand what caused the deadlock
OK, another bit of data found - the numbers are transaction IDs that inserted or deleted that tuple/row.Is there any way I can get an idea of which SQL those transactions were running?