Temporarily Disable PostgreSQL Triggers

Temporarily Disable PostgreSQL Triggers
  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)

To temporarily disable all triggers in a PostgreSQL session, use this:

That disables all triggers for the current database session only. Useful for bulk operations, but remember to be careful to keep your database consistent.

To re-enable:

Disable a Single Trigger

To disable just a single trigger, use ALTER TABLE:

The difference to the previous method is that ALTER TABLE will globally disable the trigger, affecting all database sessions, not just the current one.

To disable all triggers for one table:

To re-enable:

 

Leave a Reply