Received: from vaccine.rki.de (firewall-user@vaccine.rki.de [193.175.81.250]) by hub.org (8.10.1/8.10.1) with SMTP id e7PEpJI65650 for ; Fri, 25 Aug 2000 10:51:19 -0400 (EDT) Received: by vaccine.rki.de; id QAA08578; Fri, 25 Aug 2000 16:51:15 +0200 Received: from unknown(10.15.130.13) by vaccine.rki.de via smap (V5.5) id xma008573; Fri, 25 Aug 00 16:50:17 +0200 Received: from wr-linux02.rki.de ([10.15.140.59]) by mailnu01.rki.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id QD4NBVV8; Fri, 25 Aug 2000 16:49:15 +0200 Date: Fri, 25 Aug 2000 16:50:07 +0200 (CEST) From: Andreas Tille To: Tom Lane cc: hlefebvre , PostgreSQL SQL Subject: Re: Date of creation and of change In-Reply-To: <2205.967212888@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200008/281 On Fri, 25 Aug 2000, Tom Lane wrote: > I think you are getting burnt by premature constant folding --- see > nearby discussion of how to define a column default that gives the > time of insertion. You need to write this as > NEW.ChangedAt := now(); > to prevent the system from reducing timestamp('now') to a constant > when the function is first executed. This doesn't work, too. It just puts allways the constant time when the function was created into the database. May be it has to be escaped in somw way?? I don't know how to follow hlefebvre's hint to "put null" into the field. Bay the way: If we once solved the problem it might be a topic for the FAQ, perhaps? Kind regards Andreas.