Skip site navigation (1) Skip section navigation (2)

On Update (trigger hint)

From: MaRCeLO PeReiRA <gandalf_mp(at)yahoo(dot)com(dot)br>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: On Update (trigger hint)
Date: 2004-02-27 16:50:22
Message-ID: 20040227165022.81353.qmail@web20210.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-general
Hi guys,

Please, give me some advices on how to do the
following:

I have the following table:

CREATE TABLE products (
   id            SERIAL,
   description   TEXT,
   lastupdate    date
);

Well, I would like to update the column "lastupdate"
with the value "now()" on every UPDATE executed on a
row of this table.

Do I have to create a function to do it? Can you help
me?

Regards,

Marcelo

______________________________________________________________________

Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
http://br.yahoo.com/info/mail.html

Responses

pgsql-general by date

Next:From: Mike MascariDate: 2004-02-27 16:53:13
Subject: Re: field must appear in the GROUP BY clause or be used
Previous:From: John Sidney-WoollettDate: 2004-02-27 16:46:30
Subject: Re: field must appear in the GROUP BY clause or be used

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group