Updating column on row update

From: Thom Brown <thombrown(at)gmail(dot)com>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Updating column on row update
Date: 2009-11-22 19:50:53
Message-ID: bddc86150911221150q35cf297di3357981061cf3286@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

This should be simple, but for some reason I'm not quite sure what the
solution is. I want to be able to update the value of a column for rows
that have been updated. More specifically, if a row is updated, I want it's
modified_date column to be populated with the current time stamp. I've
looked at triggers and rules, and it looks like I'd need to create a
function just to achieve this which seems incredibly clumsy and unnecessary.
Could someone enlighten me?

Thanks

Thom

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aaron Burnett 2009-11-22 19:57:48 Re: Updating column on row update
Previous Message Tom Lane 2009-11-22 17:38:36 Re: Planning problem: pushing conditions through GROUP BY

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-11-22 19:57:16 WIP: log query in auto-explain
Previous Message Magnus Hagander 2009-11-22 18:59:05 Re: forget patch win32.mak.