Sean Chittenden <sean(at)chittenden(dot)org> writes:
> Is there any notion of pg_stat_get_backend_last_activity()? I've got
> a rogue process someplace and I'm having a devil of a time tracking
> down which process is not committing its transaction and letting the
> rest of the world continue to access the tables.
Perhaps look in pg_locks to see who's holding the oldest open
transaction number, or who's got the most locks that other people
are waiting for? That should get you at least the PID of the offender.
Then use ps and/or pg_stat_activity to figure out what the offender
is doing.
regards, tom lane