Trigger on Update

Поиск
Список
Период
Сортировка
От
Тема Trigger on Update
Дата
Msg-id 008e01c58968$15fbe140$1301a8c0@sf.vagabond.com
обсуждение исходный текст
Ответы Re: Trigger on Update  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Trigger on Update  (Mike Rylander <mrylander@gmail.com>)
Re: Trigger on Update  (mark reid <pgsql@markreid.org>)
Список pgsql-general
Can anybody help me creating a trigger on update trigger with update statement as below.
 
This trigger fires after update on a table called note  to update the updated_date field.
 
But when the table is updated the trigger is firing recursively.
 
Anybody know what is the syntax I have to use in update statement.
 
 
 
CREATE TRIGGER "trg_update_note_updated_date" AFTER UPDATE
ON "property"."note" FOR EACH ROW
EXECUTE PROCEDURE "property"."update_note_updated_date_trg"();
 
 
CREATE OR REPLACE FUNCTION "property"."update_note_updated_date_trg" () RETURNS trigger AS
$body$
begin
  /* New function body */
       UPDATE property.note SET updated_date=CURRENT_DATE
       WHERE note_id = NEW. note_id;
    return null;
end;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: CVS - psql segfault
Следующее
От: Devrim GUNDUZ
Дата:
Сообщение: Re: Postgres for Fedora Core 2 OS ****************