Received: from mx2.imaginet.fr (artemis.imaginet.fr [195.68.75.24]) by hub.org (8.10.1/8.10.1) with ESMTP id e7PE55I53321 for ; Fri, 25 Aug 2000 10:05:05 -0400 (EDT) Received: from lexbase.net (access-34.125.rev.fr.colt.net [195.68.125.34] (may be forged)) by mx2.imaginet.fr (8.9.3/8.8.8) with ESMTP id QAA29355; Fri, 25 Aug 2000 16:03:24 +0200 (MET DST) Message-ID: <39A68038.9783106@lexbase.net> Date: Fri, 25 Aug 2000 16:18:32 +0200 From: hlefebvre Organization: LEXBASE X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Andreas Tille CC: PostgreSQL SQL Subject: Re: Re: Date of creation and of change References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200008/279 Andreas Tille wrote: > > 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 :-(. > I tried... I fact it seems that it doesn'nt work if you don't use the changedat column in your UPDATE our insert statement. Just put null, and it will be ok I think.