Subject Re: [firebird-support] Disable trigger?
Author Paul Vinkenoog
"homerjones1941" wrote:

> I have created triggers to log inserts, updates, and deletes on a good number of tables. The purpose is to log who changes what, and to be able to track changes to certain important fields, regardless of who changes them. However, I don't need to log certain program-created updates. For example certain fields are automatically updated each day for hundreds or even thousands of records. Therefore, the logging triggers created hundreds or even thousands of log entries each day that are just clutter. Is there a way my stored procedure can disable a trigger, do its job, and then re-enable?

execute statement 'alter trigger MyTrigger inactive';
execute statement 'alter trigger MyTrigger active';

You need EXECUTE STATEMENT to circumvent the no-DDL rule in PSQL.

Hope this helps,
Paul Vinkenoog