Hello,

We have the same issue. Do you think this constraint solves the problem?

"constraint_name" UNIQUE CONSTRAINT, btree (policydef_id, template)

Best regards,
M.Oukfif