Re: maintaining a field for every UPDATION. - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: maintaining a field for every UPDATION.
Date
Msg-id 20020104000537.N18170-100000@megazone23.bigpanda.com
Whole thread Raw
In response to maintaining a field for every UPDATION.  (Bhuvan A <bhuvansql@yahoo.com>)
List pgsql-sql
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:

beginNEW.modify_time=now();return NEW;
end;

do what you want?



pgsql-sql by date:

Previous
From: Bhuvan A
Date:
Subject: maintaining a field for every UPDATION.
Next
From: "SHELTON,MICHAEL (Non-HP-Boise,ex1)"
Date:
Subject: Re: top?