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 e7PD3C535360 for ; Fri, 25 Aug 2000 09:03:13 -0400 (EDT) Received: by vaccine.rki.de; id PAA07684; Fri, 25 Aug 2000 15:03:08 +0200 Received: from unknown(10.15.130.13) by vaccine.rki.de via smap (V5.5) id xma007679; Fri, 25 Aug 00 15:02:39 +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 QD4NBVVP; Fri, 25 Aug 2000 15:01:36 +0200 Date: Fri, 25 Aug 2000 15:02:28 +0200 (CEST) From: Andreas Tille To: hlefebvre cc: PostgreSQL SQL Subject: Re: Date of creation and of change In-Reply-To: <39A65D1D.EB626E7D@lexbase.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200008/278 On Fri, 25 Aug 2000, hlefebvre wrote: > No I suppose that the problem is the identifier "changedat" is unknown. > > You must probably prefix it : NEW.changedat > > CREATE FUNCTION changed_at_timestamp() RETURNS OPAQUE AS ' > BEGIN > NEW.ChangedAt := timestamp(''now''); > RETURN NEW; > END; > ' LANGUAGE 'plpgsql'; > > I didn't test it, but as pgSQL looks like Oracle, it should be ok :-) This avoids the error message, but doesn't have any effect to the value of ChangedAt. It just remains the same as CreatedAt :-(. Kind regards Andreas.