How to fix Invalid transaction state in PostgreSQL | DevErrors