Processes waiting for lock – PostgreSQL 8.4

This crazy select will show you if there are some processes waiting for locks in database (not on whole server just database) in PostgreSQL 8.4. (Version for pg 9.3 is slightly different.) Conflicting lock attempts will most probably happen if you use inheritance and...