unstale

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 init

@unstale/cli 0.1.0 on npm

asyncpg 0.3219 changes

Breaking changes 2

  • User-provided SSL contexts must set the postgresql ALPN protocol for direct TLS connections.

    0.32.0release notes

  • Direct TLS now requires sslmode=require, verify-ca, verify-full, or an explicit SSLContext.

    0.32.0release notes

New APIs and options 1

  • Adds init_size to control how many connections the pool opens at startup; it defaults to min_size.

    0.32.0release notes

Performance 2

  • Introspection for copy_records_to_table() now uses the statement cache.

    0.32.0release notes

  • SCRAM password derivation uses hashlib.pbkdf2_hmac() for faster authentication processing.

    0.32.0release notes

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.

    0.32.0release notes

Fixes and other changes 13

  • Cleartext password authentication no longer raises AttributeError when no password is supplied.

    0.32.0release notes

  • Stuck cancellation is bounded by the command or release timeout so it cannot block teardown or pool release.

    0.32.0release notes

  • close(timeout=...) now honors its timeout while waiting for a pending cancellation.

    0.32.0release notes

  • Cursors now work in transactions started outside Connection.transaction(), including explicit BEGIN.

    0.32.0release notes

  • COPY cleanup preserves the generator's original exception and avoids protocol desynchronization and stalled rollback.

    0.32.0release notes

  • PostgreSQL 19 is now supported.

    0.32.0release notes

  • Python 3.15 is now supported.

    0.32.0release notes

  • The query logger is removed when the query_logger() block raises.

    0.32.0release notes

  • Invalid numbers of positional arguments no longer cause a segmentation fault.

    0.32.0release notes

  • The server error is preserved when a connection closes during an operation.

    0.32.0release notes

  • Alternative transport retries now occur only before authentication succeeds, with improved SSL rejection diagnostics.

    0.32.0release notes

  • Unnamed statements are reparsed before cursor binding when the statement cache is disabled.

    0.32.0release notes

  • Rejected connections are cleaned up immediately, preventing unresponsive rejected hosts from delaying selection.

    0.32.0release notes

asyncpg 0.317 changes

Breaking changes 2

  • When the cache is disabled, prepare() no longer uses named statements by default.

    0.31.0release notes

  • Removes support for EOL Python 3.8.

    0.31.0release notes

New APIs and options 1

  • Adds connection service file functionality for configuring database connections through service files.

    0.31.0release notes

Performance 1

  • Known types no longer undergo type introspection, reducing unnecessary runtime work.

    0.31.0release notes

Fixes and other changes 3

  • Prevents connections from leaking when _can_use_connection fails.

    0.31.0release notes

  • Fixes an issue with connection strings that specify multiple ports.

    0.31.0release notes

  • Adds Python 3.14 support with experimental subinterpreter and freethreading support.

    0.31.0release notes