How to disable triggers in PostgreSQL 9?

In PostgreSQl 8.x, to disable triggers, I do something like:

ALTER TABLE table DISABLE TRIGGER ALL; 

When I do this in PostgreSQL 9, I get the following:

 my_database=> ALTER TABLE my_table DISABLE TRIGGER ALL; ERROR: permission denied: "RI_ConstraintTrigger_25366" is a system trigger 

PS: This table was created by the user executing this command.

Any clues about this?

+6
source share
1 answer

Some triggers are automatically added to enforce restrictions, and they cannot be disabled unless you are a superuser. If you want to disable the regular triggers that you added, do the following:

 ALTER TABLE table DISABLE TRIGGER USER; 
+10
source

Source: https://habr.com/ru/post/899518/


All Articles