# What changed in asyncpg

> 26 changes in asyncpg 0.31 to 0.32 from its official release notes, upgrade guides and advisories: 4 breaking, 2 new APIs and options. Each one cited. Sources checked 2026-10-17. HTML: https://unstale.sh/pypi/asyncpg/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## asyncpg 0.32

### Breaking changes

- User-provided SSL contexts must set the postgresql ALPN protocol for direct TLS connections. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Direct TLS now requires sslmode=require, verify-ca, verify-full, or an explicit SSLContext. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)

### New APIs and options

- Adds init_size to control how many connections the pool opens at startup; it defaults to min_size. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)

### Performance

- Introspection for copy_records_to_table() now uses the statement cache. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- SCRAM password derivation uses hashlib.pbkdf2_hmac() for faster authentication processing. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)

### Behavior and default changes

- 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.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)

### Fixes and other changes

- Cleartext password authentication no longer raises AttributeError when no password is supplied. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Stuck cancellation is bounded by the command or release timeout so it cannot block teardown or pool release. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- close(timeout=...) now honors its timeout while waiting for a pending cancellation. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Cursors now work in transactions started outside Connection.transaction(), including explicit BEGIN. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- COPY cleanup preserves the generator's original exception and avoids protocol desynchronization and stalled rollback. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- PostgreSQL 19 is now supported. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Python 3.15 is now supported. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- The query logger is removed when the query_logger() block raises. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Invalid numbers of positional arguments no longer cause a segmentation fault. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- The server error is preserved when a connection closes during an operation. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Alternative transport retries now occur only before authentication succeeds, with improved SSL rejection diagnostics. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Unnamed statements are reparsed before cursor binding when the statement cache is disabled. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)
- Rejected connections are cleaned up immediately, preventing unresponsive rejected hosts from delaying selection. (0.32.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.32.0)

## asyncpg 0.31

### Breaking changes

- When the cache is disabled, prepare() no longer uses named statements by default. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)
- Removes support for EOL Python 3.8. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)

### New APIs and options

- Adds connection service file functionality for configuring database connections through service files. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)

### Performance

- Known types no longer undergo type introspection, reducing unnecessary runtime work. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)

### Fixes and other changes

- Prevents connections from leaking when _can_use_connection fails. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)
- Fixes an issue with connection strings that specify multiple ports. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)
- Adds Python 3.14 support with experimental subinterpreter and freethreading support. (0.31.0) — [release notes](https://github.com/MagicStack/asyncpg/releases/tag/v0.31.0)
