Whenever I try to disable a trigger from within a function, I get following error:
ERROR: cannot ALTER TABLE "datace" because it is being used by active queries in this session
It seems logical that tables are locked for ALTER TABLE command while used for reading writing by some function. But how should I disable/enable some trigger from that function then?
What I want to do is to update a column that should be protected from updates from outside the function. I thought this should be done through DISABLE/ENABLE trigger, but if this should be done some other way (or is not possible at all in PostgreSQL), I would be glad for such an answer too.