How to create a trigger

Поиск
Список
Период
Сортировка
От Laurent Duperval
Тема How to create a trigger
Дата
Msg-id 9deun0$25v8$1@news.tht.net
обсуждение исходный текст
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Torsten Krämer"
Дата:
Сообщение: Archiver(tar): unable to find header for 52.dat
Следующее
От: Joel Burton
Дата:
Сообщение: Re: Upcoming PostgreSQL seminars