Re: Finding if old transactions are running... - Mailing list pgsql-hackers

From Vsevolod Lobko
Subject Re: Finding if old transactions are running...
Date
Msg-id 20050224184739.GB85119@robin.ip.net.ua
Whole thread Raw
In response to Re: Finding if old transactions are running...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Feb 24, 2005 at 11:14:07AM -0500, Tom Lane wrote:
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> >> It sure would be nice to be able to have a way to query the start time
> >> of the eldest transaction on the system.  If that could be done at a
> >> not-too-high cost, it would be eminently helpful for various sorts of
> >> maintenance processes so that you could assortedly:
> 
> > You can get that from pg_stat_activity, if you have the relevant stats 
> > turned on.
> 
> pg_stat_activity will tell you about the oldest active query, but not
> about oldest open transaction.

You can get list of currently runing transactions from pg_locks table, 
but no start time...
But if you can remember oldest transaction_id from the last vacuum then 
you got what you need: if oldest transaction still here - you not 
need to vacuum


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: [pgsql-hackers-win32] win32 performance - fsync question
Next
From: John DeSoi
Date:
Subject: Re: Some download statistics