How to create a trigger

Laurent Duperval <lduperval@microcelli5.com>

From: "Laurent Duperval" <lduperval@microcelli5.com>
To: pgsql-general@postgresql.org
Date: 2001-05-10T20:46:18Z
Lists: pgsql-general
Hello,

I know nothing about triggers so I need a little hand-holding here. I'm
taking an Oracle script and converting it to pgsql. One of the things
that the Oracle database supports is a trigger on dates. So there are two
fields in the table, CREATION_DATE and UPDATE_DATE.

In the CREAT TABLE statement, I can set both dates using DEFAULT (once I
figure out how to get today's date in). But hoiw would I write a trigger
that changes the update_date to use the current time? Basically, I guess
it would be

create trigger date_update before update on mytable
    for each statement execut procedure [procedure that inserts a date
for me in the update_date column]

So what would I be doing for the portion in brackets?

Thanks,

L

-- 
Laurent Duperval <mailto:lduperval@microcelli5.com>

Les plus vigoureux coups de main au destin n'aboutissent pas toujours dans la
vie, aux démarrages qu'on attendait.
                                             -Alambic Talon