Re: How to get Transaction Timestamp ?

Поиск
Список
Период
Сортировка
От pasman pasmański
Тема Re: How to get Transaction Timestamp ?
Дата
Msg-id CAOWY8=asJ3CkvUQmgPo8f9ZWkFQgqaH-yTKVxGvtw9Zb2Lu3tw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to get Transaction Timestamp ?  (Raghavendra <raghavendra.rao@enterprisedb.com>)
Ответы Re: How to get Transaction Timestamp ?
Список pgsql-general
Trigger may store timestamp to other table "timestamps". You join then
xmin with xmin from this table to access timestamp.

2011/9/17, Raghavendra <raghavendra.rao@enterprisedb.com>:
> Thank you for your valuable inputs.
>
> Agreed, with the help of two workarounds we can pull the trx-timestamp one
> with additional-column/trigger and another with log_line_prefix from
> pg_log/logs.
>
> However, I was curious to know any thing stored at Page-Level(like XID) to
> help me in getting the transaction timestamp.
>
> --Raghav
>
> On Sat, Sep 17, 2011 at 7:41 AM, Marti Raudsepp <marti@juffo.org> wrote:
>
>> 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
>>
>


--
------------
pasman

В списке pgsql-general по дате отправления:

Предыдущее
От: Raghavendra
Дата:
Сообщение: Re: How to get Transaction Timestamp ?
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Problem with pg_upgrade 9.0 -> 9.1