Thanks Andreas, when I tried to create trigger it gives me error. Could you tell me what is wrong?
mydb=# CREATE TRIGGER truncate_trigger
mydb-# AFTER TRUNCATE ON mytable
mydb-# FOR EACH STATEMENT EXECUTE PROCEDURE my_test();
ERROR: syntax error at or near "TRUNCATE" at character 52
LINE 2: AFTER TRUNCATE ON mytable
Thanks,
Jignesh
On Thu, Aug 27, 2009 at 1:47 PM, A. Kretschmer
<andreas.kretschmer@schollglas.com> wrote:
In response to Jignesh Shah :
> Thanks Kretschmer. Could you tell me what "return new" meant for?
A trigger function must return either NULL or a record/row value having
exactly the structure of the table the trigger was fired for. Okay, in
this case, you can also return NULL. NEW means the new record, but you
need it only for row level triggers afaik.
Regards, Andreas