Re: wrong timestamp - Mailing list pgsql-general

From Michael Fuhr
Subject Re: wrong timestamp
Date
Msg-id 20060726170357.GA55657@winnie.fuhr.org
Whole thread Raw
In response to wrong timestamp  (xyzyx <xyzyx@rambler.ru>)
List pgsql-general
On Tue, Jul 25, 2006 at 05:54:00PM +0400, xyzyx wrote:
> I use Postgresql 8.1.4 on Debian,
> when I run command 'select current timestamp' or 'select now'  in
> pgAdmin, I everytime get "2000-01-01 03:02:16.105976+03".
> When I run 'select TIMEOFDAY()' I get right time.

Are you getting the actual value "2000-01-01 03:02:16.105976+03"
or is that just a hypothetical example to show that the value doesn't
change?  If the latter then see the comments about current_timestamp
in the documentation:

http://www.postgresql.org/docs/8.1/interactive/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

"It is important to know that CURRENT_TIMESTAMP and related functions
return the start time of the current transaction; their values do
not change during the transaction.  This is considered a feature:
the intent is to allow a single transaction to have a consistent
notion of the 'current' time, so that multiple modifications within
the same transaction bear the same time stamp."

--
Michael Fuhr

pgsql-general by date:

Previous
From: Reece Hart
Date:
Subject: Re: Mapping/DB Migration tool
Next
From: "Woody Woodring"
Date:
Subject: Re: Database Restore errors