Re: How to get Transaction Timestamp ?

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to get Transaction Timestamp ?
Date: 2011-09-17 02:11:12
Message-ID: CABRT9RAKjN-aXKmutE6LZw7XJZW_1M19j_o_doiaqXxNS+JCcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 16, 2011 at 21:39, Raghavendra
<raghavendra(dot)rao(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2011-09-17 02:29:48 Re: RES: Foreign PostgreSQL server
Previous Message Tareq Tajkeh 2011-09-17 02:03:14