How to fix Restrict violation in PostgreSQL | DevErrors