Re: Create a function that updates the record with and timestamps - Mailing list pgsql-general

From A. Kretschmer
Subject Re: Create a function that updates the record with and timestamps
Date
Msg-id 20100322171400.GA14658@a-kretschmer.de
Whole thread Raw
In response to Create a function that updates the record with and timestamps  (Chris Barnes <compuguruchrisbarnes@hotmail.com>)
Responses Re: Create a function that updates the record with and timestamps  (Chris Barnes <compuguruchrisbarnes@hotmail.com>)
List pgsql-general
In response to Chris Barnes :
> I would like to have postgres update the last_modified column with the
> current_date on an update of the record.
>
> I am not sure if there is a very simple way of doing this?
>
> Or, do I need to create a function and a trigger to call the row and update
> with new data and set the last_modified to current_date?

Yes, that's the way, a TRIGGER on UPDATE for each row. I think, the doc
contains an example.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

pgsql-general by date:

Previous
From: Szymon Guz
Date:
Subject: Re: strange
Next
From: "Bob Pawley"
Date:
Subject: Postgresql error from interface