Re: Odd transaction timestamp sequence issue - Mailing list pgsql-general

From Tom Lane
Subject Re: Odd transaction timestamp sequence issue
Date
Msg-id 9979.1145632160@sss.pgh.pa.us
Whole thread Raw
In response to Odd transaction timestamp sequence issue  (Jeff Amiel <jamiel@istreamimaging.com>)
Responses Re: Odd transaction timestamp sequence issue  (Jeff Amiel <jamiel@istreamimaging.com>)
List pgsql-general
Jeff Amiel <jamiel@istreamimaging.com> writes:
> For example, for id 210210 we have an audit trail that looks like this...

> audit_id    record_id        when                   column    old_val
> new_val
> --------    -----------    --------------           -------   -------
> -------
> 1            210210        2006-04-20 12:49:03.92   state     INITIAL
> COMPLETE
> 2            210210        2006-04-20 12:49:03.74   flag      X          Y

> By looking at the timestamps, the second update started BEFORE the first
> update even though the second update cannot occur if the state hasn't
> been changed and committed by the first one!

How is the "when" column determined?  You did not show it in your SQL
commands.

If it's being driven off now() or CURRENT_TIMESTAMP, then the above
isn't all that surprising, because the value is the time of transaction
start not the time at which the update was made.

            regards, tom lane

pgsql-general by date:

Previous
From: Jeff Amiel
Date:
Subject: Odd transaction timestamp sequence issue
Next
From: Teodor Sigaev
Date:
Subject: Re: A few questions about ltree