X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AD523D1C4D7 for ; Sun, 27 Jul 2003 11:13:05 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 04746-05 for ; Sun, 27 Jul 2003 08:12:14 -0300 (ADT) Received: from ward.six (unknown [212.57.171.167]) by svr1.postgresql.org (Postfix) with ESMTP id 7A842D1C4C1 for ; Sun, 27 Jul 2003 08:12:48 -0300 (ADT) Date: Sun, 27 Jul 2003 17:09:51 +0600 From: Denis Zaitsev To: Richard Huxton Cc: pgsql-sql@postgresql.org Subject: Re: Very strange 'now' behaviour in nested triggers. Message-ID: <20030727170951.E1636@natasha.ward.six> References: <20030726193947.B1636@natasha.ward.six> <200307261514.16322.dev@archonet.com> <20030727015832.D1636@natasha.ward.six> <49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49182.192.168.1.32.1059292036.squirrel@mainbox.archonet.com>; from dev@archonet.com on Sun, Jul 27, 2003 at 08:47:16AM +0100 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/401 X-Sequence-Number: 14515 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 phrase. Should it be fixed there?