pypi / asyncpg
asyncpg
What changed in asyncpg 0.31 to 0.32, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
4 breaking2 new APIs and options3 performance1 behavior and defaults16 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initasyncpg 0.3219 changes
Breaking changes 2
User-provided SSL contexts must set the postgresql ALPN protocol for direct TLS connections.
Direct TLS now requires sslmode=require, verify-ca, verify-full, or an explicit SSLContext.
New APIs and options 1
Adds init_size to control how many connections the pool opens at startup; it defaults to min_size.
Performance 2
Introspection for copy_records_to_table() now uses the statement cache.
SCRAM password derivation uses hashlib.pbkdf2_hmac() for faster authentication processing.
Behavior and default changes 1
min_size now maintains a connection floor; idle connections at or below it are retained and closed connections are replaced in the background.
Fixes and other changes 13
Cleartext password authentication no longer raises AttributeError when no password is supplied.
Stuck cancellation is bounded by the command or release timeout so it cannot block teardown or pool release.
close(timeout=...) now honors its timeout while waiting for a pending cancellation.
Cursors now work in transactions started outside Connection.transaction(), including explicit BEGIN.
COPY cleanup preserves the generator's original exception and avoids protocol desynchronization and stalled rollback.
PostgreSQL 19 is now supported.
Python 3.15 is now supported.
The query logger is removed when the query_logger() block raises.
Invalid numbers of positional arguments no longer cause a segmentation fault.
The server error is preserved when a connection closes during an operation.
Alternative transport retries now occur only before authentication succeeds, with improved SSL rejection diagnostics.
Unnamed statements are reparsed before cursor binding when the statement cache is disabled.
Rejected connections are cleaned up immediately, preventing unresponsive rejected hosts from delaying selection.
asyncpg 0.317 changes
Breaking changes 2
When the cache is disabled, prepare() no longer uses named statements by default.
Removes support for EOL Python 3.8.
New APIs and options 1
Adds connection service file functionality for configuring database connections through service files.
Performance 1
Known types no longer undergo type introspection, reducing unnecessary runtime work.
Fixes and other changes 3
Prevents connections from leaking when _can_use_connection fails.
Fixes an issue with connection strings that specify multiple ports.
Adds Python 3.14 support with experimental subinterpreter and freethreading support.