I have a trigger that protects updating some column. I also have a trigger that should update that same column after insert on that table. I've used triggers like this and it works if I need to update column on some other table. I just disable that protecting trigger before update and enable it again after the update inside function that do all the work. In this case, it doesn't work, since I need to disable the trigger for the same table.
ERROR: cannot ALTER TABLE "Table1" because it is being used by active queries in this session
Is there another way to do it? Is there way to disable all updates to that column except from within this function?
It's PostgreSQL 9.4.