pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Denis Zaitsev <zzz@anda.ru>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Very strange 'now' behaviour in nested triggers.
Date: Sun, 27 Jul 2003 08:47:16 +0100 (BST)
Message-ID: <49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com> (raw)
In-Reply-To: <20030727015832.D1636@natasha.ward.six>
References: <20030726193947.B1636@natasha.ward.six>
	<200307261514.16322.dev@archonet.com>
	<20030727015832.D1636@natasha.ward.six>

> 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



view thread (17+ messages)  latest in thread

Message-ID: <49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com>
Permalink:  ../49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com/
Also on:    postgresql.org/message-id/49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, zzz@anda.ru
  Subject: Re: Very strange 'now' behaviour in nested triggers.
  In-Reply-To: <49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox