On Thu, Jan 13, 2005 at 07:11:09PM +0100, Martijn van Oosterhout wrote:
> 
> Wouldn't the transaction ID be more useful. An earlier transaction ID
> obviously started earlier. So you should be able to identify the oldest
> transaction. Would the transaction ID field in pg_locks do?

That'll show which transaction is oldest but not how long it's been
open or idle, i.e., whether it's "long-open" or not.  I assumed,
perhaps incorrectly, that he was already looking at pg_locks and
wanted to find out which of those transactions had been open for a
long time.  Since pg_locks has a pid column, you can join (visually
or via a join query) with pg_stat_activity's procpid column.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to