Psycopg2

Latest version: v2.9.9

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

Scan your dependencies

Page 7 of 14

2.5.1

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

- 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.

2.5

-------------------------

New features:

- Added :ref:`JSON adaptation <adapt-json>`.
- Added :ref:`support for PostgreSQL 9.2 range types <adapt-range>`.
- `connection` and `cursor` objects can be used in ``with`` statements
as context managers as specified by recent |DBAPI|_ extension.
- Added `~psycopg2.extensions.Diagnostics` object to get extended info
from a database error. Many thanks to Matthew Woodcraft for the
implementation (:ticket:`149`).
- Added `connection.cursor_factory` attribute to customize the default
object returned by `~connection.cursor()`.
- Added support for backward scrollable cursors. Thanks to Jon Nelson
for the initial patch (:ticket:`108`).
- Added a simple way to :ref:`customize casting of composite types
<adapt-composite>` into Python objects other than namedtuples.
Many thanks to Ronan Dunklau and Tobias Oberstein for the feature
development.
- `connection.reset()` implemented using :sql:`DISCARD ALL` on server
versions supporting it.

Bug fixes:

- Properly cleanup memory of broken connections (:ticket:`148`).
- Fixed bad interaction of ``setup.py`` with other dependencies in
Distribute projects on Python 3 (:ticket:`153`).

Other changes:

- Added support for Python 3.3.
- Dropped support for Python 2.4. Please use Psycopg 2.4.x if you need it.
- `~psycopg2.errorcodes` map updated to PostgreSQL 9.2.
- Dropped Zope adapter from source repository. ZPsycopgDA now has its own
project at <https://github.com/psycopg/ZPsycopgDA>.

2.4.6

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

- Fixed 'cursor()' arguments propagation in connection subclasses
and overriding of the 'cursor_factory' argument. Thanks to
Corry Haines for the report and the initial patch (:ticket:`105`).
- Dropped GIL release during string adaptation around a function call
invoking a Python API function, which could cause interpreter crash.
Thanks to Manu Cupcic for the report (:ticket:`110`).
- Close a green connection if there is an error in the callback.
Maybe a harsh solution but it leaves the program responsive
(:ticket:`113`).
- 'register_hstore()', 'register_composite()', 'tpc_recover()' work with
RealDictConnection and Cursor (:ticket:`114`).
- Fixed broken pool for Zope and connections re-init across ZSQL methods
in the same request (:tickets:`123, 125, 142`).
- connect() raises an exception instead of swallowing keyword arguments
when a connection string is specified as well (:ticket:`131`).
- Discard any result produced by 'executemany()' (:ticket:`133`).
- Fixed pickling of FixedOffsetTimezone objects (:ticket:`135`).
- Release the GIL around PQgetResult calls after COPY (:ticket:`140`).
- Fixed empty strings handling in composite caster (:ticket:`141`).
- Fixed pickling of DictRow and RealDictRow objects.

2.4.5

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

- The close() methods on connections and cursors don't raise exceptions
if called on already closed objects.
- Fixed fetchmany() with no argument in cursor subclasses
(:ticket:`84`).
- Use lo_creat() instead of lo_create() when possible for better
interaction with pgpool-II (:ticket:`88`).
- Error and its subclasses are picklable, useful for multiprocessing
interaction (:ticket:`90`).
- Better efficiency and formatting of timezone offset objects thanks
to Menno Smits (:tickets:`94, 95`).
- Fixed 'rownumber' during iteration on cursor subclasses.
Regression introduced in 2.4.4 (:ticket:`100`).
- Added support for 'inet' arrays.
- Fixed 'commit()' concurrency problem (:ticket:`103`).
- Codebase cleaned up using the GCC Python plugin's static analysis
tool, which has revealed several unchecked return values, possible
NULL dereferences, reference counting problems. Many thanks to David
Malcolm for the useful tool and the assistance provided using it.

2.4.4

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

- 'register_composite()' also works with the types implicitly defined
after a table row, not only with the ones created by 'CREATE TYPE'.
- Values for the isolation level symbolic constants restored to what
they were before release 2.4.2 to avoid breaking apps using the
values instead of the constants.
- Named DictCursor/RealDictCursor honour itersize (:ticket:`80`).
- Fixed rollback on error on Zope (:ticket:`73`).
- Raise 'DatabaseError' instead of 'Error' with empty libpq errors,
consistently with other disconnection-related errors: regression
introduced in release 2.4.1 (:ticket:`82`).

2.4.3

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

- connect() supports all the keyword arguments supported by the
database
- Added 'new_array_type()' function for easy creation of array
typecasters.
- Added support for arrays of hstores and composite types (:ticket:`66`).
- Fixed segfault in case of transaction started with connection lost
(and possibly other events).
- Fixed adaptation of Decimal type in sub-interpreters, such as in
certain mod_wsgi configurations (:ticket:`52`).
- Rollback connections in transaction or in error before putting them
back into a pool. Also discard broken connections (:ticket:`62`).
- Lazy import of the slow uuid module, thanks to Marko Kreen.
- Fixed NamedTupleCursor.executemany() (:ticket:`65`).
- Fixed --static-libpq setup option (:ticket:`64`).
- Fixed interaction between RealDictCursor and named cursors
(:ticket:`67`).
- Dropped limit on the columns length in COPY operations (:ticket:`68`).
- Fixed reference leak with arguments referenced more than once
in queries (:ticket:`81`).
- Fixed typecasting of arrays containing consecutive backslashes.
- 'errorcodes' map updated to PostgreSQL 9.1.

Page 7 of 14

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.