Skip to content

Latest commit

 

History

History
513 lines (370 loc) · 16.8 KB

news.rst

File metadata and controls

513 lines (370 loc) · 16.8 KB
.. currentmodule:: psycopg

.. index::
    single: Release notes
    single: News

psycopg release notes

Current release

Psycopg 3.2.3

  • Release binary packages including PostgreSQL 17 libpq (🎫`#852`).

Psycopg 3.2.2

  • Drop !TypeDef specifications as string from public modules, as they cannot be composed by users as !typing objects previously could (🎫`#860`).
  • Release Python 3.13 binary packages.

Psycopg 3.2.1

  • Fix packaging metadata breaking [c], [binary] dependencies (🎫`#853`).

Psycopg 3.2

New top-level features

  • Add support for integer, floating point, boolean NumPy scalar types (🎫`#332`).
  • Add !timeout and !stop_after parameters to Connection.notifies() (🎫`340`).
  • Allow dumpers to return !None, to be converted to NULL (🎫`#377`).
  • Add :ref:`raw-query-cursors` to execute queries using placeholders in PostgreSQL format ($1, $2...) (🎟️`#560, #839`).
  • Add capabilities object to :ref:`inspect the libpq capabilities <capabilities>` (🎫`#772`).
  • Add ~rows.scalar_row to return scalar values from a query (🎫`#723`).
  • Add ~Connection.cancel_safe() for encrypted and non-blocking cancellation when using libpq v17. Use such method internally to implement !KeyboardInterrupt and ~cursor.copy termination (🎫`#754`).
  • The !context parameter of sql objects ~sql.Composable.as_string() and ~sql.Composable.as_bytes() methods is now optional (🎫`#716`).
  • Add ~Connection.set_autocommit() on sync connections, and similar transaction control methods available on the async connections.
  • Add a size parameter to ~Cursor.stream() to enable results retrieval in chunks instead of row-by-row (🎫`#794`).

New libpq wrapper features

  • Add support for libpq functions to close prepared statements and portals introduced in libpq v17 (🎫`#603`).
  • Add support for libpq encrypted and non-blocking query cancellation functions introduced in libpq v17 (🎫`#754`).
  • Add support for libpq function to retrieve results in chunks introduced in libpq v17 (🎫`#793`).
  • Add support for libpq function to change role passwords introduced in libpq v17 (🎫`#818`).

Other changes

  • Drop support for Python 3.7.
  • Prepared statements are now :ref:`compatible with PgBouncer <pgbouncer>`. (🎫`#589`).
  • 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 (🎫`#604`). The Cursor now only preserves the results set of the last ~Cursor.execute(), consistently with non-pipeline mode.

Psycopg 3.1.20

  • Use the simple query protocol to execute COMMIT/ROLLBACK when possible. This should make querying the PgBouncer admin database easier (🎫`#820`).
  • Avoid unneeded escaping checks and memory over-allocation in text copy (🎫`#829`).
  • Bundle binary package with OpenSSL 3.3.x (🎫`#847`).
  • Drop macOS ARM64 binary packages for macOS versions before 14.0 and Python before 3.10 (not for our choice but for the lack of available CI runners; 🎫`#858`)

Psycopg 3.1.19

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

Psycopg 3.1.18

Psycopg 3.1.17

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

Psycopg 3.1.16

  • Fix empty ports handling in async multiple connection attempts (🎫`#703`).

Psycopg 3.1.15

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

Psycopg 3.1.14

Psycopg 3.1.13

  • Raise DataError instead of whatever internal failure trying to dump a ~datetime.time object with with a !tzinfo specified as ~zoneinfo.ZoneInfo (ambiguous offset, see 🎫`#652`).
  • Handle gracefully EINTR on signals instead of raising InterruptedError, consistently with PEP 475 guideline (🎫`#667`).
  • Fix support for connection strings with multiple hosts/ports and for the load_balance_hosts connection parameter (🎫`#674`).
  • Fix memory leak receiving notifications in Python implementation (🎫`#679`).

Psycopg 3.1.12

  • Fix possible hanging if a connection is closed while querying (🎫`#608`).
  • Fix memory leak when ~register_*() functions are called repeatedly (🎫`#647`).
  • Release Python 3.12 binary packages.

Psycopg 3.1.11

  • Avoid caching the parsing results of large queries to avoid excessive memory usage (🎫`#628`).
  • Fix integer overflow in C/binary extension with OID > 2^31 (🎫`#630`).
  • Fix loading of intervals with days and months or years (🎫`#643`).
  • Work around excessive CPU usage on Windows (reported in 🎫`#645`).
  • Fix building on Solaris and derivatives (🎫`#632`).
  • Fix possible lack of critical section guard in async ~AsyncCursor.executemany().
  • Fix missing pipeline fetch in async ~AsyncCursor.scroll().
  • Build binary packages with libpq 15.4, which allows group-readable permissions on the SSL certificate on the client (🎫`#528`).

Psycopg 3.1.10

  • Allow JSON dumpers to dump bytes directly instead of str, for better compatibility with libraries like orjson and msgspec (🎫`#569`)
  • Fix prepared statement cache validation when exiting pipeline mode (or ~Cursor.executemany()) in case an error occurred within the pipeline (🎫`#585`).
  • Fix connect() to avoid "leaking" an open ~pq.PGconn attached to the OperationalError in case of connection failure. Error.pgconn is now a shallow copy of the real libpq connection, and the latter is closed before the exception propagates (🎫`#565`).
  • Fix possible (ignored) exception on objects deletion (🎫`#591`).
  • Don't clobber a Python exception raised during COPY FROM with the resulting !QueryCanceled raised as a consequence (🎫`#593`).
  • Fix resetting Connection.read_only and ~Connection.deferrable to their default value using !None (🎫`#612`).
  • Add support for Python 3.12.

Psycopg 3.1.9

  • Fix TypeInfo.fetch() using a connection in !sql_ascii encoding (🎫`#503`).
  • Fix "filedescriptor out of range" using a large number of files open in Python implementation (🎫`#532`).
  • Allow JSON dumpers to be registered on !dict or any other object, as was possible in psycopg2 (🎫`#541`).
  • Fix canceling running queries on process interruption in async connections (🎫`#543`).
  • Fix loading ROW values with different types in the same query using the binary protocol (🎫`#545`).
  • Fix dumping recursive composite types (🎫`#547`).

Psycopg 3.1.8

  • Don't pollute server logs when types looked for by TypeInfo.fetch() are not found (🎫`#473`).
  • Set Cursor.rowcount to the number of rows of each result set from ~Cursor.executemany() when called with !returning=True (🎫`#479`).
  • Fix TypeInfo.fetch() when used with ClientCursor (🎫`#484`).

Psycopg 3.1.7

  • Fix server-side cursors using row factories (🎫`#464`).

Psycopg 3.1.6

  • Fix cursor.copy() with cursors using row factories (🎫`#460`).

Psycopg 3.1.5

  • Fix array loading slowness compared to psycopg2 (🎫`#359`).
  • Improve performance around network communication (🎫`#414`).
  • Return !bytes instead of !memoryview from pq.Encoding methods (🎫`#422`).
  • Fix Cursor.rownumber to return !None when the result has no row to fetch (🎫`#437`).
  • Avoid error in Pyright caused by aliasing !TypeAlias (🎫`#439`).
  • Fix Copy.set_types() used with varchar and name types (🎫`#452`).
  • Improve performance using :ref:`row-factories` (🎫`#457`).

Psycopg 3.1.4

Psycopg 3.1.3

  • Restore the state of the connection if Cursor.stream() is terminated prematurely (🎫`#382`).
  • Fix regression introduced in 3.1 with different named tuples mangling rules for non-ascii attribute names (🎫`#386`).
  • Fix handling of queries with escaped percent signs (%%) in ClientCursor (🎫`#399`).
  • Fix possible duplicated BEGIN statements emitted in pipeline mode (🎫`#401`).

Psycopg 3.1.2

  • Fix handling of certain invalid time zones causing problems on Windows (🎫`#371`).
  • Fix segfault occurring when a loader fails initialization (🎫`#372`).
  • Fix invalid SAVEPOINT issued when entering Connection.transaction() within a pipeline using an implicit transaction (🎫`#374`).
  • Fix queries with repeated named parameters in ClientCursor (🎫`#378`).
  • Distribute macOS arm64 (Apple M1) binary packages (🎫`#344`).

Psycopg 3.1.1

  • Work around broken Homebrew installation of the libpq in a non-standard path (🎫`#364`)
  • Fix possible "unrecognized service" error in async connection when no port is specified (🎫`#366`).

Psycopg 3.1

Psycopg 3.0.17

  • Fix segfaults on fork on some Linux systems using ctypes implementation (🎫`#300`).
  • Load bytea as bytes, not memoryview, using ctypes implementation.

Psycopg 3.0.16

  • Fix missing ~Cursor.rowcount after SHOW (🎫`#343`).
  • Add scripts to build macOS arm64 packages (🎫`#162`).

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 ~Cursor.stream().
  • Raise DataError instead of OverflowError loading binary intervals out-of-range.
  • Distribute manylinux2014 wheel packages (🎫`#124`).

Psycopg 3.0.14

  • Raise DataError dumping arrays of mixed types (🎫`#301`).
  • Fix handling of incorrect server results, with blank sqlstate (🎫`#303`).
  • Fix bad Float4 conversion on ppc64le/musllinux (🎫`#304`).

Psycopg 3.0.13

  • Fix Cursor.stream() slowness (🎫`#286`).
  • Fix oid for lists of integers, which might cause the server choosing bad plans (🎫`#293`).
  • Make Connection.cancel() on a closed connection a no-op instead of an error.

Psycopg 3.0.12

  • Allow bytearray/memoryview data too as Copy.write() input (🎫`#254`).
  • Fix dumping ~enum.IntEnum in text mode, Python implementation.

Psycopg 3.0.11

  • Fix DataError loading arrays with dimensions information (🎫`#253`).
  • Fix hanging during COPY in case of memory error (🎫`#255`).
  • Fix error propagation from COPY worker thread (mentioned in 🎫`#255`).

Psycopg 3.0.10

  • Leave the connection in working state after interrupting a query with Ctrl-C (🎫`#231`).
  • Fix Cursor.description after a COPY ... TO STDOUT operation (🎫`#235`).
  • Fix building on FreeBSD and likely other BSD flavours (🎫`#241`).

Psycopg 3.0.9

  • Set Error.sqlstate when an unknown code is received (🎫`#225`).
  • Add the !tzdata package as a dependency on Windows in order to handle time zones (🎫`#223`).

Psycopg 3.0.8

  • Decode connection errors in the client_encoding specified in the connection string, if available (🎫`#194`).
  • Fix possible warnings in objects deletion on interpreter shutdown (🎫`#198`).
  • Don't leave connections in ACTIVE state in case of error during COPY ... TO STDOUT (🎫`#203`).

Psycopg 3.0.7

  • Fix crash in ~Cursor.executemany() with no input sequence (🎫`#179`).
  • Fix wrong ~Cursor.rowcount after an ~Cursor.executemany() returning no rows (🎫`#178`).

Psycopg 3.0.6

  • Allow to use Cursor.description if the connection is closed (🎫`#172`).
  • Don't raise exceptions on ServerCursor.close() if the connection is closed (🎫`#173`).
  • Fail on Connection.cursor() if the connection is closed (🎫`#174`).
  • Raise ProgrammingError if out-of-order exit from transaction contexts is detected (🎟️`#176, #177`).
  • Add !CHECK_STANDBY value to ~pq.ConnStatus enum.

Psycopg 3.0.5

  • Fix possible "Too many open files" OS error, reported on macOS but possible on other platforms too (🎫`#158`).
  • Don't clobber exceptions if a transaction block exit with error and rollback fails (🎫`#165`).

Psycopg 3.0.4

Psycopg 3.0.3

  • Release musllinux binary packages, compatible with Alpine Linux (🎫`#141`).
  • Reduce size of binary package by stripping debug symbols (🎫`#142`).
  • Include typing information in the !psycopg_binary package.

Psycopg 3.0.2

  • Fix type hint for sql.SQL.join() (🎫`#127`).
  • Fix type hint for Connection.notifies() (🎫`#128`).
  • Fix call to MultiRange.__setitem__() with a non-iterable value and a slice, now raising a TypeError (🎫`#129`).
  • Fix disable cursors methods after close() (🎫`#125`).

Psycopg 3.0.1

  • Fix use of the wrong dumper reusing cursors with the same query but different parameter types (🎫`#112`).

Psycopg 3.0

First stable release. Changed from 3.0b1:

Psycopg 3.0b1

  • First public release on PyPI.