Thursday, October 6, 2011

Postgresql table locks

Another interesting link regarding postgresql is this one about glancing at active table locks:

select t.relname,l.locktype,page,virtualtransaction,pid,mode,granted from pg_locks l, pg_stat_all_tables t where l.relation=t.relid order by relation asc;
Thanks to this I could figure out that there were a bunch of locks on a table one of my etl jobs uses.

Then I realized I needed a refresher for the lock concepts.

I can see now, my job's generating a deadlock, goddamn it!

No comments:

Post a Comment