PostgreSQL database adapter for Python
Provides
Requires
License
LGPL-3.0-only
Changelog
* Tue Jan 27 2026 Dirk Müller <dmueller@suse.com>
- update to 3.3.2:
* Add :ref:`template strings queries <template-strings>`
(:ticket:`#1054`).
* More flexible :ref:`composite adaptation<adapt-composite>`:
it is now possible to adapt Python objects to PostgreSQL
composites and back even if they are not sequences or if they
take keyword arguments (:ticket:`#932`, :ticket:`#1202`).
* Cursors are now iterators, not just iterables. This means you
can call next(cur) or anext(cur), which is useful as a
:ref:`type-safe expression <typing-fetchone>`
(:ticket:`#1064`).
* Add Cursor.set_result() and Cursor.results() to move across
the result sets of queries executed though
~Cursor.executemany() or ~Cursor.execute() with multiple
statements (:tickets:`#1080, #1170`).
* Add :ref:`transaction-status` to report the status during and
after a ~Connection.transaction() block (:ticket:`#969`).
* Allow to change loaders using
~adapt.AdaptersMap.register_loader() on Cursor.adapters after
a query result has been already returned (:ticket:`#884`).
* Add pq.PGconn.used_gssapi attribute and
Capabilities.has_used_gssapi() function (:ticket:`#1138`).
* Add ConnectionInfo.full_protocol_version attribute,
Capabilities.has_full_protocol_version() function
(:ticket:`#1079`).
* Disable default GSSAPI preferential connection in the binary
package (:ticket:`#1136`). Warning Please explicitly set the
gssencmode_ connection parameter or the
:envvar:`PGGSSENCMODE` environment variable to interact
reliably with the GSSAPI.
* Drop support for Python 3.8 (:ticket:`#976`) and 3.9
(:ticket:`#1056`).
* Show the host name in the error message in case of name
resolution error (:ticket:`#1205`).
* Fix Cursor.copy() and AsyncCursor.copy() to hold the
connection lock for the entire operation, preventing
concurrent access issues (:ticket:`#1210`).
* Fix GSSAPI check with C extension built with libpq < v16
(:ticket:`#1216`).
* Tue Nov 11 2025 Dirk Müller <dmueller@suse.com>
- update to 3.2.12:
* Allow copy to pass different types per column, as long as the
database can convert them. Regression introduced in 3.2.11
* Fix spurious readiness flags in some of the wait functions
* Fix high CPU usage using the wait_c function on Windows
* Fix bad data on error in binary copy (ticket #1147).
* Respect Copy.set_types() in TEXT copy in C version,
consistently with the Python version (ticket #1153).
* Don’t raise warning, and don’t leak resources, if a builtin
function is used as JSON dumper/loader function (ticket #1165).
* Improve performance of Python conversion on results loading
(ticket #1155).
* Mon Sep 29 2025 Dirk Müller <dmueller@suse.com>
- update to 3.2.10:
* Fix TypeError shadowing CancelledError upon task cancellation
during pipeline execution (ticket #1005).
* Fix memory leak when lambda/local functions are used as
argument for set_json_dumps(), set_json_loads() (ticket #1108).
* Fix coordination of executemany() with other concurrent
operations on other cursors (ticket #1130).
* Fix leak receiving notifications if the notifies() generator
is not called (ticket #1091).
* Using both the generator and handlers to receive notifications
on the same connection is therefore deprecated and will now
generate a runtime warning.
* Add support for Python 3.14 (ticket #1053).
* Thu May 29 2025 Dirk Müller <dmueller@suse.com>
- update to 3.2.9:
* Fix `DateFromTicks` and `TimeFromTicks` return values to return
a date and a time referred to the UTC timezone rather than to
the local timezone. For consistency, `TimestampFromTicks` to
return a datetime in UTC rather than in the local timezone
* Fix `~Cursor.rownumber` after using `~AsyncServerCursor.scroll()`
on `AsyncServerCursor` (:ticket:`#1066`).
* Fix interval parsing with days or other parts and negative time
in C module
* Don't process further connection attempts after Ctrl-C
* Fix cursors to correctly iterate over rows even if their row
factory returns `None` (:ticket:`#1073`).
* Fix `ConnectionInfo.port` when the port is specified as an
empty string
* Report all the attempts error messages in the exception raised
for a connection failure (:ticket:`#1069`).
* Improve logging on connection (:ticket:`#108