Re: Trigger for Truncate event

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Trigger for Truncate event
Date: 2009-08-27 17:50:53
Message-ID: h76h1q$5k7$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jignesh Shah wrote on 27.08.2009 19:37:
> 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

You are probably using a version prior to 8.4

You need 8.4 to create triggers for TRUNCATE

Thomas

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jignesh Shah 2009-08-27 18:04:02 Re: Trigger for Truncate event
Previous Message Steve T 2009-08-27 17:38:29 Re: Speeding up 'bulk' delete (and/or seeing what is going on while the delete is being processed)