How to fix Too many trigger recursions in PostgreSQL | DevErrors