PostgreSQL database adapter for Python -- C optimisation distribution
Provides
Requires
License
LGPL-3.0-only
Changelog
* Sun Nov 22 2026 Dirk Müller <dmueller@suse.com>
- update to 3.3.9:
* Use the C implementation of the wait functions on Windows
too. It was disabled because of an excessive CPU usage,
fixed in Psycopg 3.2.11 (#645).
* Fix binary dumping of Int4Range and other typed ranges and
multiranges (#1157).
* Fix dumping of Decimal 0 with large exponent (part of
[#1414]).
* Close the connection if the query cancellation following a
Ctrl-C or a task cancellation is interrupted again, instead
of leaving it stuck in ACTIVE state (#1435).
* Limit the memory used by COPY FROM if the server consumes
data slower than it is produced. Add a flush_threshold
parameter to copy.LibpqWriter to tune it (#1437).
* Don't wait on the event loop when the socket is already
writable, which made pipeline mode,
AsyncCursor.executemany() and AsyncCopy.write() on async
connections several times slower than on sync ones (#1468).
* Fix client-side quoting of negative zero floats and
decimals, which could produce a -- SQL comment (#1480).
* Raise DataError instead of ValueError registering a
composite whose name or attributes are not valid namedtuple
names, for instance Python keywords (#1482).
* Speed up the C implementation of the sync wait function, in
particular when the connection doesn't need to wait, for
instance at every Copy.write() (#1484).
* Don't replace the exception raised in a COPY block, for
instance an interruption, with an error terminating the
operation (#1486).
* Fix copy.QueuedLibpqWriter hanging forever, instead of
raising the error, if sending data to the server fails
while its queue is full (#1489).
* Performance improvements to lists dumping (#1490, #1491).
* 2.5x faster UUID loading in the C implementation (#1494).
* Reduce the size of the binary packages by about 15 to 40%,
depending on the platform.
- update to 3.3.8:
* Revert the use of /etc/ssl as SSL directory in the binary
packages on Linux and macOS: it caused the system
openssl.cnf to be loaded, which could break connections,
for instance on FIPS-enabled systems (#1476).
* Fix the size of the binary packages on Linux x86_64,
increased in 3.3.7 by padding of the bundled libraries
(#1477).
- update to 3.3.7:
* Fix segfault fetching arrays of strings or timestamps after
closing the connection (#1428).
* Fix Connection.cancel_safe() failing if the cancel
connection is not ready immediately, for instance on a slow
network (#1440).
* Fix reference cycles created adapting recursive types,
which kept data in memory until the next garbage collection
(#1443, #1462).
* Fix loading intervals with a very large number of hours in
text format, which could lose microseconds (#1446).
* Fix leak of adapters calling
psycopg.types.composite.register_composite() repeatedly
without custom make_object or make_sequence functions
(#1449).
* Roll back the transaction if entering a
Connection.transaction() block is interrupted, for instance
by a task cancellation (#1451).
* Quote array elements with Unicode white space, which
CockroachDB would otherwise strip from strings (#1465).
* Set the system SSL root certificate directory to /etc/ssl
in the binary packages on Linux and macOS.
* Sun Oct 25 2026 Dirk Müller <dmueller@suse.com>
- update to 3.3.6:
* Add support for Python 3.15 (:ticket:`#1245`).
* Don't wait forever for a query to terminate after interrupting
it, for instance if the server is unresponsive. The fix
requires libpq 17 or newer (:ticket:`#1371`).
* Cancel a running query upon receiving `!SystemExit` (:ticket:`#1384`).
* Report `!None` instead of ``65535`` as the `Column.precision`
of an :sql:`interval` column declared with a fields restriction
and no explicit precision, such as e.g. :sql:`interval day to
second` (:ticket:`#1397`).
* Fix dumping of nested subclasses of lists as arrays
* Discard prepared statements upon :sql:`DEALLOCATE ALL`
* Better guards dumping large Python `!int` to binary numeric
* Improve performance of async queries by reducing the overhead
of the `!wait_async()` function (:ticket:`#1331`).
* Mon May 18 2026 Dirk Müller <dmueller@suse.com>
- update to 3.3.4:
* Fix possible spurious connection timeout in systems with very
long uptimes in C extension (:ticket:`#1280`).
* Fix client-side adaptation of enums whose name require quotes
(:ticket:`#1298`).
* Consistently populate ~Cursor.statusmessage after
~Cursor.executemany() (:ticket:`#1302`).
* Mon Feb 23 2026 Dirk Müller <dmueller@suse.com>
- update to 3.3.3:
* Retain Error.pgconn when raising a single exception for
multiple connection attempt errors
* Return a proper error when server sends ErrorResponse for a
Sync after a Parse
* 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 ca