Re: vacuum vs open transactions

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>, Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: vacuum vs open transactions
Date: 2005-01-13 12:50:38
Message-ID: 20050113125038.GA23993@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 12, 2005 at 11:30:50PM -0700, Michael Fuhr wrote:
> On Wed, Jan 12, 2005 at 11:49:12AM -0700, Ed L. wrote:
> >
> > Is it possible via SQL query to tell how long a transaction has been open?
>
> I'm not aware of a way to find out when a transaction started, but
> if you have stats_command_string enabled then you can query
> pg_stat_activity to see when a session's current query started.

now() returns the current transaction's start time.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"No necesitamos banderas
No reconocemos fronteras" (Jorge González)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Valentin Militaru 2005-01-13 13:03:59 Problems with a trigger
Previous Message John Sidney-Woollett 2005-01-13 12:50:08 how to determine initdb locale (after the event)?