Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To turn off all triggers in a PostgreSQL database, you need to revoke the TRIGGER permission from the user or role that owns the triggers. This can be done using the following SQL command:

REVOKE TRIGGER ON ALL TABLES IN SCHEMA public FROM user_or_role;

Replace user_or_role with the name of the user or role that owns the triggers. This command revokes the TRIGGER permission from all tables in the public schema, effectively turning off all triggers in the database.

To turn on the triggers again, you can grant the TRIGGER permission back to the user or role:

GRANT TRIGGER ON ALL TABLES IN SCHEMA public TO user_or_role;

This command grants the TRIGGER permission to all tables in the public schema, allowing the user or role to create and execute triggers.