ENABLE_TRIGGER

Enables or disables a trigger.

Enables or disables a trigger.

To view existing triggers, see STORED_PROC_TRIGGERS.

This is a meta-function. You must call meta-functions in a top-level SELECT statement.

Behavior type

Volatile

Syntax

ENABLE_TRIGGER ( '[[database.]schema.]trigger', enabled )

Arguments

[database.]schema

Database and schema. The default schema is public. If you specify a database, it must be the current database.

trigger
The trigger to enable or disable.
enabled
Boolean, whether to enable the trigger.

Privileges

Superuser

Examples

To enable a trigger:

=> SELECT enable_trigger('vmart.management.log_user_actions', true);

To disable a trigger:

=> SELECT enable_trigger('vmart.management.log_user_actions', false);

If you leave the database and schema empty, the default is current_database.public:

=> SELECT enable_trigger('revoke_log_privileges', true);