How to fix Deadlock detected in PostgreSQL | DevErrors