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

From: Denis Zaitsev <zzz(at)anda(dot)ru>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Very strange 'now' behaviour in nested triggers.
Date: 2003-07-27 11:09:51
Message-ID: 20030727170951.E1636@natasha.ward.six
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

On Sun, Jul 27, 2003 at 08:47:16AM +0100, Richard Huxton wrote:
>
> 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.

Yes, indeed... Documentation describes this. And I haven't found
anything about 'now' that I used to say... I don't know why (my
memory leak?) :)

Thanks.

BTW, this text is at the bottom of the "Date/Time Functions and
Operators" section (functions-datetime.html):

SELECT CURRENT_TIMESTAMP;
SELECT now();
SELECT TIMESTAMP 'now';

Note: You do not want to use the third form when specifying a DEFAULT clause while
creating a table. The system will convert now to a timestamp as soon as the constant is
parsed, so that when the default value is needed, the time of the table creation would
be used! ...

It's nearly what you have written about. But I want to note <the time
of the table creation> phrase. Should it be fixed there?

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2003-07-27 15:49:10 Re: Very strange 'now' behaviour in nested triggers.
Previous Message Richard Huxton 2003-07-27 07:47:16 Re: Very strange 'now' behaviour in nested triggers.

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-07-27 15:49:10 Re: Very strange 'now' behaviour in nested triggers.
Previous Message Richard Huxton 2003-07-27 07:47:16 Re: Very strange 'now' behaviour in nested triggers.