Re: Odd transaction timestamp sequence issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Odd transaction timestamp sequence issue
Date: 2006-04-21 15:09:20
Message-ID: 9979.1145632160@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jeff Amiel <jamiel(at)istreamimaging(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Sigaev 2006-04-21 15:10:57 Re: A few questions about ltree
Previous Message Tom Lane 2006-04-21 15:00:50 Re: psql: FATAL: missing or erroneous pg_hba.conf file