Re: Transactions and timestamps

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Transactions and timestamps
Дата
Msg-id 006a01c11f56$2cd6aec0$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на Transactions and timestamps  (Daniel Åkerud <zilch@home.se>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Database handle destroyed without explicit disconnect
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Still wondering about random numbers...