On Thu, Jan 13, 2005 at 08:44:56AM -0700, Ed L. wrote:
> Yes, I see that in 7.4 (not in 7.3). But my purpose would be to remotely
> identify long-open transactions that are causing table bloat by making
> vacuum fail to reclaim space, so it seems I need the transaction start
> time, not query start time. Most likely this situation occurs when 1)
> someone starts a transaction in psql and then leaves it there, or 2) an
> application opens a transaction prior to getting user input.
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?
Hope this helps,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.