Re: Very strange 'now' behaviour in nested triggers.
От | Richard Huxton |
---|---|
Тема | Re: Very strange 'now' behaviour in nested triggers. |
Дата | |
Msg-id | 49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com обсуждение исходный текст |
Ответ на | Re: Very strange 'now' behaviour in nested triggers. (Denis Zaitsev <zzz@anda.ru>) |
Ответы |
Re: Very strange 'now' behaviour in nested triggers.
|
Список | pgsql-sql |
> On Sat, Jul 26, 2003 at 03:14:16PM +0100, Richard Huxton wrote: >> On Saturday 26 July 2003 14:39, Denis Zaitsev wrote: > >> Solution: make the default now() or CURRENT_TIMESTAMP and all will be as >> you >> expect. >> >> PS - I think this is mentioned in the manuals somewhere, but it's not >> surprising you missed it. Interesting example. > > As I remember, namely 'now' is mentioned in the manuals, as the best > approach to keep the same value thru the whole transaction. That is > why I used it here. For now I've tested that now() does the thing. > Why? I remember that now() is changing thru the transaction, just > showing the current time... No- 'now',now() and CURRENT_TIMESTAMP all stay fixed during a transaction. The one that changes is timeofday() I think. See the "Functions and Operators" section for details. - Richard
В списке pgsql-sql по дате отправления: