Re: Very strange 'now' behaviour in nested triggers.

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Denis Zaitsev" <zzz(at)anda(dot)ru>
Cc: "Richard Huxton" <dev(at)archonet(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Very strange 'now' behaviour in nested triggers.
Date: 2003-07-27 07:47:16
Message-ID: 49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Denis Zaitsev 2003-07-27 11:09:51 Re: Very strange 'now' behaviour in nested triggers.
Previous Message Denis Zaitsev 2003-07-26 20:01:04 Re: Very strange 'now' behaviour in nested triggers.

Browse pgsql-sql by date

  From Date Subject
Next Message Denis Zaitsev 2003-07-27 11:09:51 Re: Very strange 'now' behaviour in nested triggers.
Previous Message Denis Zaitsev 2003-07-26 20:01:04 Re: Very strange 'now' behaviour in nested triggers.