Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Fri, 21 Apr 2006 11:09:20 -0400
  • Message-id: <9979(dot)1145632160(at)sss(dot)pgh(dot)pa(dot)us>

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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group