Rod Taylor <pg(at)rbt(dot)ca> writes:
> I watch for table bloat but I haven't figured out a nice way of tracking
> down the postgresql process with the oldest transaction running short of
> patching PostgreSQL to report the XID for a connection in
> pg_stat_activity.
I don't think you need a patch --- try joining with pg_locks.
regards, tom lane