Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e7PEFHI55876 for ; Fri, 25 Aug 2000 10:15:17 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id KAA02208; Fri, 25 Aug 2000 10:14:48 -0400 (EDT) To: Andreas Tille cc: hlefebvre , PostgreSQL SQL Subject: Re: Re: Date of creation and of change In-reply-to: References: Comments: In-reply-to Andreas Tille message dated "Fri, 25 Aug 2000 15:02:28 +0200" Date: Fri, 25 Aug 2000 10:14:48 -0400 Message-ID: <2205.967212888@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200008/280 Andreas Tille writes: >> NEW.ChangedAt := timestamp(''now''); > This avoids the error message, but doesn't have any effect to the value > of ChangedAt. It just remains the same as CreatedAt :-(. 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. regards, tom lane