How to fix 42P11: invalid_cursor_definition in PostgreSQL | DevErrors