Re: Very strange 'now' behaviour in nested triggers. - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Very strange 'now' behaviour in nested triggers.
Date
Msg-id 49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com
Whole thread Raw
In response to Re: Very strange 'now' behaviour in nested triggers.  (Denis Zaitsev <zzz@anda.ru>)
Responses Re: Very strange 'now' behaviour in nested triggers.
List 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 by date:

Previous
From: Denis Zaitsev
Date:
Subject: Re: Very strange 'now' behaviour in nested triggers.
Next
From: Denis Zaitsev
Date:
Subject: Re: Very strange 'now' behaviour in nested triggers.