Psycopg

Latest version: v3.1.19

Safety actively analyzes 641872 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 7

3.2

^^^^^^^^^^^^^^^^^^^^^^^^

- Add support for integer, floating point, boolean `NumPy scalar types`__
(:ticket:`332`).
- Add `!timeout` and `!stop_after` parameters to `Connection.notifies()`
(:ticket:`340`).
- Add :ref:`raw-query-cursors` to execute queries using placeholders in
PostgreSQL format (`$1`, `$2`...) (:ticket:`560`).
- Add `psycopg.capabilities` object to :ref:`inspect the libpq capabilities
<capabilities>` (:ticket:`772`).
- Add `~rows.scalar_row` to return scalar values from a query (:ticket:`723`).
- Prepared statements are now :ref:`compatible with PgBouncer <pgbouncer>`.
(:ticket:`589`).
- Add `~Connection.set_autocommit()` on sync connections, and similar
transaction control methods available on the async connections.
- Add support for libpq functions to close prepared statements and portals
introduced in libpq v17 (:ticket:`603`).
- Add support for libpq encrypted and non-blocking query cancellation
functions introduced in libpq v17 (:ticket:`754`).
- The `!context` parameter of `sql` objects `~sql.Composable.as_string()` and
`~sql.Composable.as_bytes()` methods is now optional (:ticket:`716`).
- Disable receiving more than one result on the same cursor in pipeline mode,
to iterate through `~Cursor.nextset()`. The behaviour was different than
in non-pipeline mode and not totally reliable (:ticket:`604`).
The `Cursor` now only preserves the results set of the last
`~Cursor.execute()`, consistently with non-pipeline mode.
- Add `~Connection.cancel_safe()` for encrypted and non-blocking cancellation
If possible, use such method internally upon `KeyboardInterrupt` and `Copy`
termination (:ticket:`754`).
- Add support for libpq function to retrieve results in chunks introduced in
libpq v17 (:ticket:`793`).

.. __: https://numpy.org/doc/stable/reference/arrays.scalars.html#built-in-scalar-types


Current release
---------------

3.1.19

^^^^^^^^^^^^^^

- Fix unaligned access undefined behaviour in C extension (:ticket:`734`).
- Fix excessive stripping of error message prefixes (:ticket:`752`).
- Allow to specify the ``connect_timeout`` connection parameter as float
(:ticket:`796`).
- Improve COPY performance on macOS (:ticket:`745`).

3.1.18

^^^^^^^^^^^^^^

- Fix possible deadlock on pipeline exit (:ticket:`685`).
- Fix overflow loading large intervals in C module (:ticket:`719`).
- Fix compatibility with musl libc distributions affected by `CPython issue
65821`__ (:ticket:`725`).

.. __: https://github.com/python/cpython/issues/65821

3.1.17

^^^^^^^^^^^^^^

- Fix multiple connection attempts when a host name resolve to multiple
IP addresses (:ticket:`699`).
- Use `typing.Self` as a more correct return value annotation of context
managers and other self-returning methods (see :ticket:`708`).

3.1.16

^^^^^^^^^^^^^^

- Fix empty ports handling in async multiple connection attempts
(:ticket:`703`).

3.1.15

^^^^^^^^^^^^^^

- Fix use of ``service`` in connection string (regression in 3.1.13,
:ticket:`694`).
- Fix async connection to hosts resolving to multiple IP addresses (regression
in 3.1.13, :ticket:`695`).
- Respect the :envvar:`PGCONNECT_TIMEOUT` environment variable to determine
the connection timeout.

Page 1 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.