Re: vacuum vs open transactions - Mailing list pgsql-general

From Michael Fuhr
Subject Re: vacuum vs open transactions
Date
Msg-id 20050113183726.GA31620@winnie.fuhr.org
Whole thread Raw
In response to Re: vacuum vs open transactions  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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/

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: allowing connections from additional hosts without a restart?
Next
From: Michael Fuhr
Date:
Subject: Re: Functions returning RECORD