psycopg release notes#
Current release#
Psycopg 3.1.16#
- Fix empty ports handling in async multiple connection attempts (ticket #703). 
Psycopg 3.1.15#
Psycopg 3.1.14#
- Fix interaction with gevent (ticket #527). 
- Add support for PyPy (ticket #686). 
Psycopg 3.1.13#
- Raise - DataErrorinstead of whatever internal failure trying to dump a- timeobject with with a- tzinfospecified as- ZoneInfo(ambiguous offset, see ticket #652).
- Handle gracefully EINTR on signals instead of raising - InterruptedError, consistently with PEP 475 guideline (ticket #667).
- Fix support for connection strings with multiple hosts/ports and for the - load_balance_hostsconnection parameter (ticket #674).
- Fix memory leak receiving notifications in Python implementation (ticket #679). 
Psycopg 3.1.12#
Psycopg 3.1.11#
- Avoid caching the parsing results of large queries to avoid excessive memory usage (ticket #628). 
- Fix integer overflow in C/binary extension with OID > 2^31 (ticket #630). 
- Fix loading of intervals with days and months or years (ticket #643). 
- Work around excessive CPU usage on Windows (reported in ticket #645). 
- Fix building on Solaris and derivatives (ticket #632). 
- Fix possible lack of critical section guard in async - executemany().
- Fix missing pipeline fetch in async - scroll().
Psycopg 3.1.10#
- Allow JSON dumpers to dump - bytesdirectly instead of- str, for better compatibility with libraries like orjson and msgspec (ticket #569)
- Fix prepared statement cache validation when exiting pipeline mode (or - executemany()) in case an error occurred within the pipeline (ticket #585).
- Fix - connect()to avoid “leaking” an open- PGconnattached to the- OperationalErrorin case of connection failure.- Error.pgconnis now a shallow copy of the real libpq connection, and the latter is closed before the exception propagates (ticket #565).
- Fix possible (ignored) exception on objects deletion (ticket #591). 
- Don’t clobber a Python exception raised during COPY FROM with the resulting - QueryCanceledraised as a consequence (ticket #593).
- Fix resetting - Connection.read_onlyand- deferrableto their default value using- None(ticket #612).
- Add support for Python 3.12. 
Psycopg 3.1.9#
- Fix - TypeInfo.fetch()using a connection in- sql_asciiencoding (ticket #503).
- Fix “filedescriptor out of range” using a large number of files open in Python implementation (ticket #532). 
- Allow JSON dumpers to be registered on - dictor any other object, as was possible in psycopg2 (ticket #541).
- Fix canceling running queries on process interruption in async connections (ticket #543). 
- Fix loading ROW values with different types in the same query using the binary protocol (ticket #545). 
- Fix dumping recursive composite types (ticket #547). 
Psycopg 3.1.8#
- Don’t pollute server logs when types looked for by - TypeInfo.fetch()are not found (ticket #473).
- Set - Cursor.rowcountto the number of rows of each result set from- executemany()when called with- returning=True(ticket #479).
- Fix - TypeInfo.fetch()when used with- ClientCursor(ticket #484).
Psycopg 3.1.7#
- Fix server-side cursors using row factories (ticket #464). 
Psycopg 3.1.6#
- Fix - cursor.copy()with cursors using row factories (ticket #460).
Psycopg 3.1.5#
- Fix array loading slowness compared to psycopg2 (ticket #359). 
- Improve performance around network communication (ticket #414). 
- Return - bytesinstead of- memoryviewfrom- pq.Encodingmethods (ticket #422).
- Fix - Cursor.rownumberto return- Nonewhen the result has no row to fetch (ticket #437).
- Avoid error in Pyright caused by aliasing - TypeAlias(ticket #439).
- Fix - Copy.set_types()used with- varcharand- nametypes (ticket #452).
- Improve performance using Row factories (ticket #457). 
Psycopg 3.1.4#
- Include error classes defined in PostgreSQL 15. 
- Add support for Python 3.11 (ticket #305). 
- Build binary packages with libpq from PostgreSQL 15.0. 
Psycopg 3.1.3#
- Restore the state of the connection if - Cursor.stream()is terminated prematurely (ticket #382).
- Fix regression introduced in 3.1 with different named tuples mangling rules for non-ascii attribute names (ticket #386). 
- Fix handling of queries with escaped percent signs ( - %%) in- ClientCursor(ticket #399).
- Fix possible duplicated BEGIN statements emitted in pipeline mode (ticket #401). 
Psycopg 3.1.2#
- Fix handling of certain invalid time zones causing problems on Windows (ticket #371). 
- Fix segfault occurring when a loader fails initialization (ticket #372). 
- Fix invalid SAVEPOINT issued when entering - Connection.transaction()within a pipeline using an implicit transaction (ticket #374).
- Fix queries with repeated named parameters in - ClientCursor(ticket #378).
- Distribute macOS arm64 (Apple M1) binary packages (ticket #344). 
Psycopg 3.1.1#
Psycopg 3.1#
- Add Pipeline mode (ticket #74). 
- Add Client-side-binding cursors (ticket #101). 
- Add CockroachDB support in - psycopg.crdb(ticket #313).
- Add Two-Phase Commit support (ticket #72). 
- Add Enum adaptation (ticket #274). 
- Add - returningparameter to- executemany()to retrieve query results (ticket #164).
- executemany()performance improved by using batch mode internally (ticket #145).
- Add parameters to - copy().
- Add COPY Writer objects. 
- Resolve domain names asynchronously in - AsyncConnection.connect()(ticket #259).
- Add - pq.PGconn.trace()and related trace functions (ticket #167).
- Add - prepare_thresholdparameter to- Connectioninit (ticket #200).
- Add - cursor_factoryparameter to- Connectioninit.
- Add - Error.pgconnand- Error.pgresultattributes (ticket #242).
- Restrict queries to be - LiteralStringas per PEP 675 (ticket #323).
- Add explicit type cast to values converted by - sql.Literal(ticket #205).
- Drop support for Python 3.6. 
Psycopg 3.0.17#
Psycopg 3.0.16#
Psycopg 3.0.15#
- Fix wrong escaping of unprintable chars in COPY (nonetheless correctly interpreted by PostgreSQL). 
- Restore the connection to usable state after an error in - stream().
- Raise - DataErrorinstead of- OverflowErrorloading binary intervals out-of-range.
- Distribute - manylinux2014wheel packages (ticket #124).
Psycopg 3.0.14#
Psycopg 3.0.13#
- Fix - Cursor.stream()slowness (ticket #286).
- Fix oid for lists of integers, which might cause the server choosing bad plans (ticket #293). 
- Make - Connection.cancel()on a closed connection a no-op instead of an error.
Psycopg 3.0.12#
- Allow - bytearray/- memoryviewdata too as- Copy.write()input (ticket #254).
- Fix dumping - IntEnumin text mode, Python implementation.
Psycopg 3.0.11#
Psycopg 3.0.10#
- Leave the connection in working state after interrupting a query with Ctrl-C (ticket #231). 
- Fix - Cursor.descriptionafter a COPY … TO STDOUT operation (ticket #235).
- Fix building on FreeBSD and likely other BSD flavours (ticket #241). 
Psycopg 3.0.9#
- Set - Error.sqlstatewhen an unknown code is received (ticket #225).
- Add the - tzdatapackage as a dependency on Windows in order to handle time zones (ticket #223).
Psycopg 3.0.8#
Psycopg 3.0.7#
- Fix crash in - executemany()with no input sequence (ticket #179).
- Fix wrong - rowcountafter an- executemany()returning no rows (ticket #178).
Psycopg 3.0.6#
- Allow to use - Cursor.descriptionif the connection is closed (ticket #172).
- Don’t raise exceptions on - ServerCursor.close()if the connection is closed (ticket #173).
- Fail on - Connection.cursor()if the connection is closed (ticket #174).
- Raise - ProgrammingErrorif out-of-order exit from transaction contexts is detected (tickets #176, #177).
- Add - CHECK_STANDBYvalue to- ConnStatusenum.
Psycopg 3.0.5#
Psycopg 3.0.4#
- Allow to use the module with strict strings comparison (ticket #147). 
- Fix segfault on Python 3.6 running in - -W errormode, related to- backport.zoneinfoticket #109.
- Build binary package with libpq versions not affected by CVE-2021-23222 (ticket #149). 
Psycopg 3.0.3#
Psycopg 3.0.2#
- Fix type hint for - sql.SQL.join()(ticket #127).
- Fix type hint for - Connection.notifies()(ticket #128).
- Fix call to - MultiRange.__setitem__()with a non-iterable value and a slice, now raising a- TypeError(ticket #129).
- Fix disable cursors methods after close() (ticket #125). 
Psycopg 3.0.1#
- Fix use of the wrong dumper reusing cursors with the same query but different parameter types (ticket #112). 
Psycopg 3.0#
First stable release. Changed from 3.0b1:
- Add Geometry adaptation using Shapely (ticket #80). 
- Add Multirange adaptation (ticket #75). 
- Add - pq.__build_version__constant.
- Don’t use the extended protocol with COPY, (tickets #78, #82). 
- Fix selection of dumper by oid after - set_types().
- Drop - Connection.client_encoding. Use- ConnectionInfo.encodingto read it, and a- SETstatement to change it.
- Add binary packages for Python 3.10 (ticket #103). 
Psycopg 3.0b1#
- First public release on PyPI.