on update of table set timestamp

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: on update of table set timestamp
Date: 2010-06-22 14:33:09
Message-ID: B10E6810AC2A2F4EA7550D072CDE876004B2E5C0@SAB-FENWICK.sab.uiuc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PostgreSQL 8.4

I want to add a timestamp column to some of my important table such that
whenever an SQL "update" command is executed on the table the
"updated_timestamp" timestamp column would be set with "now()". Is
there a way to do this? I know I could go through and change my SQL all
over the place to update a column "updated_timestamp" with "now()" but
it would be faster if there was some way to set a constraint and/or
default value on the field. Is this possible. I don't really want to
do store procedures.

Thanks,

Lance Campbell

Software Architect/DBA/Project Manager

Web Services at Public Affairs

217-333-0382

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2010-06-22 14:37:02 Re: parallel option in pg_restore
Previous Message Michal Bicz 2010-06-22 14:30:11 unsubscribe