Psycopg Changelog

What's new in Psycopg 2.7.1

Mar 24, 2017
  • Ignore None arguments passed to connect() and make_dsn() (ticket #517).
  • OpenSSL upgraded from major version 0.9.8 to 1.0.2 in the Linux wheel packages (ticket #518).
  • Fixed build with libpq versions < 9.3 (ticket #520).

New in Psycopg 2.7 (Mar 5, 2017)

  • New features:
  • Added psycopg2.sql module to generate SQL dynamically (ticket #308).
  • Added replication protocol support (ticket #322). Main authors are Oleksandr Shulgin and Craig Ringer, who deserve a huge thank you.
  • Added parse_dsn() and make_dsn() functions (ticket #321, ticket #363). connect() now can take both dsn and keyword arguments, merging them together.
  • Added __libpq_version__ and libpq_version() to inspect the version of the libpq library the module was compiled/loaded with (ticket #35, ticket #323).
  • The attributes notices and notifies can be customized replacing them with any object exposing an append() method (ticket #326).
  • Adapt network types to ipaddress objects when available. When not enabled, convert arrays of network types to lists by default. The old Inet adapter is deprecated (ticket #317, ticket #343, ticket #387).
  • Added quote_ident() function (ticket #359).
  • Added get_dsn_parameters() connection method (ticket #364).
  • callproc() now accepts a dictionary of parameters (ticket #381).
  • Give precedence to __conform__() over superclasses to choose an object adapter (ticket #456).
  • Using Python C API decoding functions and codecs caching for faster unicode encoding/decoding (ticket #473).
  • executemany() slowness addressed by execute_batch() and execute_values() (ticket #491).
  • Added async_ as an alias for async to support Python 3.7 where async will become a keyword (ticket #495).
  • Unless in autocommit, do not use default_transaction_* settings to control the session characteristics as it may create problems with external connection pools such as pgbouncer; use BEGIN options instead (ticket #503).
  • isolation_level is now writable and entirely separated from autocommit; added readonly, deferrable writable attributes.
  • Bug fixes:
  • Fixed error caused by missing decoding LoggingConnection (ticket #483).
  • Fixed integer overflow in interval seconds (ticket #512).
  • Other changes:
  • Dropped support for Python 2.5 and 3.1.
  • Dropped support for client library older than PostgreSQL 9.1 (but older server versions are still supported).
  • isolation_level doesn't read from the database but will return ISOLATION_LEVEL_DEFAULT if no value was set on the connection.
  • Empty arrays no more converted into lists if they don't have a type attached (ticket #506)

New in Psycopg 2.6.2 (Jul 9, 2016)

  • Fixed inconsistent state in externally closed connections (ticket #263, ticket #311, ticket #443).
  • Report the server response status on errors (such as ticket #281).
  • Raise NotSupportedError on unhandled server response status (ticket #352).
  • Allow overriding string adapter encoding with no connection (ticket #331).
  • The wait_select callback allows interrupting a long-running query in an interactive shell using Ctrl-C (ticket #333).
  • Fixed PersistentConnectionPool on Python 3 (ticket #348).
  • Fixed segfault on repr() of an uninitialized connection (ticket #361).
  • Allow adapting bytes using QuotedString on Python 3 (ticket #365).
  • Added support for setuptools/wheel (ticket #370).
  • Fix build on Windows with Python 3.5, VS 2015 (ticket #380).
  • Fixed errorcodes.lookup initialization thread-safety (ticket #382).
  • Fixed read() exception propagation in copy_from (ticket #412).
  • Fixed possible NULL TZ decref (ticket #424).
  • psycopg2.errorcodes map updated to PostgreSQL 9.5.

New in Psycopg 2.6.1 (Jun 17, 2015)

  • The most important bug fixed in this release is the libcrypto callbacks conflict between libpq and Python (ticket #290), fixed by Jan Urbański: thank you very much.
  • Other bugs fixed:
  • Lists consisting of only None are escaped correctly (ticket #285).
  • Correctly unlock the connection after error in flush (ticket #294).
  • Fixed MinTimeLoggingCursor.callproc() (ticket #309).

New in Psycopg 2.5.4 (Sep 5, 2014)

  • This version supports the new jsonb PostgreSQL type out-of-the-box. And of course there are a few bug fixed:
  • Added jsonb support for PostgreSQL 9.4 (ticket #226).
  • Fixed segfault if COPY statements are passed to execute() instead of using the proper methods (ticket #219).
  • Force conversion of pool arguments to integer to avoid potentially unbounded pools (ticket #220).
  • Cursors WITH HOLD don't begin a new transaction upon move/fetch/close (ticket #228).
  • Cursors WITH HOLD can be used in autocommit (ticket #229).
  • callproc() doesn't silently ignore an argument without a length.
  • Fixed memory leak with large objects (ticket #256).
  • The internal _psycopg.so module can be imported stand-alone (to allow modules juggling such as the one described in ticket #201).

New in Psycopg 2.5.3 (May 16, 2014)

  • Work around pip issue #1630 making installation via pip -e git+url impossible (ticket #18).
  • Copy operations correctly set the cursor.rowcount attribute (ticket #180).
  • It is now possible to call get_transaction_status() on closed connections.
  • Fixed unsafe access to object names causing assertion failures in Python 3 debug builds (ticket #188).
  • Mark the connection closed if found broken on poll() (from ticket #192 discussion)
  • Fixed handling of dsn and closed attributes in connection subclasses failing to connect (from ticket #192 discussion).
  • Added arbitrary but stable order to Range objects, thanks to Chris Withers (ticket #193).
  • Avoid blocking async connections on connect (ticket #194). Thanks to Adam Petrovich for the bug report and diagnosis.
  • Don't segfault using poorly defined cursor subclasses which forgot to call the superclass init (ticket #195).
  • Mark the connection closed when a Socket connection is broken, as it happens for TCP connections instead (ticket #196).
  • Fixed overflow opening a lobject with an oid not fitting in a signed int (ticket #203).
  • Fixed handling of explicit default cursor_factory=None in connection.cursor() (ticket #210).
  • Fixed possible segfault in named cursors creation.
  • Fixed debug build on Windows, thanks to James Emerton.

New in Psycopg 2.5.2 (Jan 8, 2014)

  • Fixed segfault pickling the exception raised on connection error (ticket #170).
  • Meaningful connection errors report a meaningful message.
  • Manually creating lobject with the wrong parameter doesn't segfault (ticket #187).

New in Psycopg 2.5.1 (Aug 19, 2013)

  • Fixed build on Solaris 10 and 11 where the round() function is already declared (ticket #146).
  • Fixed comparison of Range with non-range objects (ticket #164). Thanks to Chris Withers for the patch.
  • Fixed double-free on connection dealloc (ticket #166). Thanks to Gangadharan S.A. for the report and fix suggestion.

New in Psycopg 2.3.2 (Feb 24, 2011)

  • The release fixes a bug reported in 2.3.0 and 2.3.1 preventing Psycopg to connect to pgBouncer.

New in Psycopg 2.0.14 (Apr 16, 2010)

  • setup.py: one-liner from Devrim GÃœNDÃœZ to build with PostgreSQL alpha.
  • psycopg/adapt_decimal.c: Python 2.4 decimal type does not support .isfinite() and two different calls to ._isinfinity() and ._isnan() are required. This fixes both a test failure and a segfault.
  • Added new Decimal adapter that correctly converts NaN and infinity to PostgreSQL NaN numeric values. Also added tests.
  • lib/errorcodes.py: Updated to PostgreSQL 8.4; added lookup() function.
  • Stop the loop variable used to create __all__ leaking in the module.
  • Fixed Inet constructor.
  • Fixed docstring for 'QueryCanceledError' exception.
  • lib/extensions.py: Binary was not imported from _psycopg; now it is
  • lib/__init__: SQL_IN adapter is now automatically registered.
  • ZPsycopgDA/db.py: removed logging debug calls; psycopg does not depend on the logger module.
  • License migration: psycopg2 is now LGPL3 + OpenSSL exception.
  • TODO file was never updated so lets remove it.
  • lib/extras.py: fixed register_tstz_w_secs() error as reported by Karsten Hilbert.
  • psycopg/microprotocols.c: "can't adapt" message now includes full type information (adapted patch from Eric Chamberlain).
  • tests/types_basic.py: fixed test broken by float precision fix.
  • psycopg/adapter_pfloat.c: applied patch from Remy Blankto fix float loss of precision.

New in Psycopg 2.0.13 (Jan 16, 2010)

  • setup.py: applied patch from Christian Jacobsen to link to static
  • version of libpq.
  • lib/extras.py: added support for UUID arrays.
  • psycopg/connection_int.c: applied patch from Richard Davies to avoid
  • deadlocks with multiple threads using the same connection.

New in Psycopg 2.0.11 (May 18, 2009)

  • This release fixes a bug with ReadDictCursor that was introduced in 2.0.10. It also makes DictRow and RealDictRow use less memory.