Re: timestamp weirdness - Mailing list pgsql-general

From Thomas Lockhart
Subject Re: timestamp weirdness
Date
Msg-id 3C5A160A.89B8C17A@fourpalms.org
Whole thread Raw
In response to timestamp weirdness  (Elaine Lindelef <eel@cognitivity.com>)
Responses Re: timestamp weirdness  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Re: timestamp weirdness  (Elaine Lindelef <eel@cognitivity.com>)
List pgsql-general
...
> The oid correctly reflects the order of the insertion of the rows...
> but look at the timestamp - the last row has a timestamp _2 minutes
> before_ the previous row. How could this be happening? We know row
> 69719 was inserted _after_ 69718, by probably about 30 seconds.

The timestamp provided as a result of evaluating 'now' is the time of
the start of the transaction, not the instantaneous wall clock time (if
you want the latter there is a function to provide it).

So, the times will reflect the time the transaction was started, while
the OID will reflect the order in which the insert/update actually
happened within the transaction.

hth

                    - Thomas

pgsql-general by date:

Previous
From: Elaine Lindelef
Date:
Subject: timestamp weirdness
Next
From: Syd Alsobrook
Date:
Subject: Re: System commands