Re: How to get Transaction Timestamp ? - Mailing list pgsql-general

From Marti Raudsepp
Subject Re: How to get Transaction Timestamp ?
Date
Msg-id CABRT9RAKjN-aXKmutE6LZw7XJZW_1M19j_o_doiaqXxNS+JCcQ@mail.gmail.com
Whole thread Raw
In response to How to get Transaction Timestamp ?  (Raghavendra <raghavendra.rao@enterprisedb.com>)
Responses Re: How to get Transaction Timestamp ?  (Raghavendra <raghavendra.rao@enterprisedb.com>)
List pgsql-general
On Fri, Sep 16, 2011 at 21:39, Raghavendra
<raghavendra.rao@enterprisedb.com> wrote:
> We can get a Transaction ID, but not the transaction timestamp when it
> performed.

Short answer: You can't. Instead, add a new "timestamptz default
now()" column, that will get you the time of the insert.

If you want the update time, create a BEFORE UPDATE ON x FOR EACH ROW
trigger on this table to update it.

Regards,
Marti

pgsql-general by date:

Previous
From: Tareq Tajkeh
Date:
Subject: ...
Next
From: Adrian Klaver
Date:
Subject: Re: RES: Foreign PostgreSQL server