Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g048Jsm18430 for ; Fri, 4 Jan 2002 03:19:54 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id B74B9D5F4; Fri, 4 Jan 2002 00:19:53 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id ACFE45BF2; Fri, 4 Jan 2002 00:19:53 -0800 (PST) Date: Fri, 4 Jan 2002 00:19:53 -0800 (PST) From: Stephan Szabo To: Bhuvan A Cc: Subject: Re: maintaining a field for every UPDATION. In-Reply-To: Message-ID: <20020104000537.N18170-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200201/31 X-Sequence-Number: 6122 On Fri, 4 Jan 2002, Bhuvan A wrote: > Well, now i would like to maintain modify_time for every updation. how > can i? Using common plpgsql function i cant even able to refer OID > even during UPDATION. The result is > > ERROR: record old has no field oid > or > ERROR: record new has no field oid > > One way: i can have seperate plpgsql function for every table and > apply conditions accordingly. But i dont think thats the consistent > way. > > how else can i maintain modify_time field ? Would a before update trigger function something like: begin NEW.modify_time=now(); return NEW; end; do what you want?