Re: Transactions and timestamps - Mailing list pgsql-general

From Richard Huxton
Subject Re: Transactions and timestamps
Date
Msg-id 006a01c11f56$2cd6aec0$1001a8c0@archonet.com
Whole thread Raw
In response to Transactions and timestamps  (Daniel Åkerud <zilch@home.se>)
List pgsql-general
Please don't post HTML to the mailing list - it makes quoting difficult...


From: "Daniel Åkerud" <zilch@home.se>

If I do

BEGIN
UPDATE some_session set time_stop = CURRENT_TIMESTAMP
UPDATE another_session set time_start = CURRENT_TIMESTAMP
END

Is there any chance the current_timestamp will be different?

=reply=

If you try your example by hand (with a suitable pause) you'll see
CURRENT_TIMESTAMP and the now() function return the time at the start of the
transaction. You use timeofday() IIRC to get the "real" current time.

HTH

- Richard Huxton


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Database handle destroyed without explicit disconnect
Next
From: Tom Lane
Date:
Subject: Re: Still wondering about random numbers...