CMDBuild Forum

Understanding this Error when updating using PostGres

Good Morning all. Hope your well.

I have been working on a script to insert/update values into our CMDBuild database. I have been testing some queries using PostGres. I can create a very simple update query and use it to update some values. However other values I get the following error

ERROR: CM_FORBIDDEN_OPERATION
CONTEXT: PL/pgSQL function _cm_trigger_sanity_check() line 8 at RAISE

This is literally just updating an empty value. I get the feeling it might be due to some referential integrity. Would the solution be to first insert a new row, and then update that one?

Apologies for the inconvenience. Upon further investigation realised I was trying to update a record with status ā€˜Nā€™, and this is what raised the exception.

When trying to update an record with a status ā€˜Aā€™, everything worked as expected.