Обсуждение: wrong timestamp

Поиск
Список
Период
Сортировка

wrong timestamp

От
xyzyx
Дата:
Hello,
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.

Whats wrong?
--
xyzyx.

Re: wrong timestamp

От
Michael Fuhr
Дата:
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