How to fix Invalid cursor name in PostgreSQL | DevErrors