MagicStack / asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.
Apache License 2.0
6.88k stars 399 forks source link

Close cursor portals once the iterator is exhausted #1088

Closed elprans closed 11 months ago

elprans commented 11 months ago

When iterating on a cursor, make sure to close the portal once iteration is done. This prevents the cursor from holding onto resources until the end of transaction.

Fixes: #1008