Re: start of transaction (was: Re: [PERFORM] Help with

Поиск
Список
Период
Сортировка
От Dennis Bjorklund
Тема Re: start of transaction (was: Re: [PERFORM] Help with
Дата
Msg-id Pine.LNX.4.44.0311161645350.26313-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Re: start of transaction (was: Re: [PERFORM] Help with count(*))  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, 16 Nov 2003, Tom Lane wrote:

> There isn't any compelling implementation reason when to freeze the
> value of now().  Reasonable options are
>     1. at BEGIN (current behavior)
>     2. at transaction's external creation 
>     3. at freezing of transaction snapshot
> #1 and #2 are actually the same at the moment, but could be decoupled
> as sketched above, in which case the behavior of #2 would effectively
> become "at first command afte BEGIN".
> 
> I argued that now() should be frozen at the time of the transaction
> snapshot, and I still think that that's a defensible behavior.

Is it important exactly what value is returned as long as it's the same in 
the whole transaction? I think not.

To me it would be just as logical to fix it at the first call to now() in
the transaction. The first time you call it you get the actual time as it
is now and the next time you get the same as before since every operation
in the transaction logically happens at the same time. If you don't call
now() at all, the system time will not be fetched at all.

-- 
/Dennis



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: start of transaction (was: Re: [PERFORM] Help with count(*))
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: cvs head? initdb?