Psycopg2

Latest version: v2.9.9

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

Scan your dependencies

Page 8 of 14

2.4.2

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

- Added 'set_session()' method and 'autocommit' property to the
connection. Added support for read-only sessions and, for PostgreSQL
9.1, for the "repeatable read" isolation level and the "deferrable"
transaction property.
- Psycopg doesn't execute queries at connection time to find the
default isolation level.
- Fixed bug with multithread code potentially causing loss of sync
with the server communication or lock of the client (:ticket:`55`).
- Don't fail import if mx.DateTime module can't be found, even if its
support was built (:ticket:`53`).
- Fixed escape for negative numbers prefixed by minus operator
(:ticket:`57`).
- Fixed refcount issue during copy. Reported and fixed by Dave
Malcolm (:ticket:`58`, Red Hat Bug 711095).
- Trying to execute concurrent operations on the same connection
through concurrent green thread results in an error instead of a
deadlock.
- Fixed detection of pg_config on Window. Report and fix, plus some
long needed setup.py cleanup by Steve Lacy: thanks!

2.4.1

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

- Use own parser for bytea output, not requiring anymore the libpq 9.0
to parse the hex format.
- Don't fail connection if the client encoding is a non-normalized
variant. Issue reported by Peter Eisentraut.
- Correctly detect an empty query sent to the backend (:ticket:`46`).
- Fixed a SystemError clobbering libpq errors raised without SQLSTATE.
Bug vivisectioned by Eric Snow.
- Fixed interaction between NamedTuple and server-side cursors.
- Allow to specify --static-libpq on setup.py command line instead of
just in 'setup.cfg'. Patch provided by Matthew Ryan (:ticket:`48`).

2.4

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

New features and changes:

- Added support for Python 3.1 and 3.2. The conversion has also
brought several improvements:

- Added 'b' and 't' mode to large objects: write can deal with both
bytes strings and unicode; read can return either bytes strings
or decoded unicode.
- COPY sends Unicode data to files implementing 'io.TextIOBase'.
- Improved PostgreSQL-Python encodings mapping.
- Added a few missing encodings: EUC_CN, EUC_JIS_2004, ISO885910,
ISO885916, LATIN10, SHIFT_JIS_2004.
- Dropped repeated dictionary lookups with unicode query/parameters.

- Improvements to the named cursors:

- More efficient iteration on named cursors, fetching 'itersize'
records at time from the backend.
- The named cursors name can be an invalid identifier.

- Improvements in data handling:

- Added 'register_composite()' function to cast PostgreSQL
composite types into Python tuples/namedtuples.
- Adapt types 'bytearray' (from Python 2.6), 'memoryview' (from
Python 2.7) and other objects implementing the "Revised Buffer
Protocol" to 'bytea' data type.
- The 'hstore' adapter can work even when the data type is not
installed in the 'public' namespace.
- Raise a clean exception instead of returning bad data when
receiving bytea in 'hex' format and the client libpq can't parse
them.
- Empty lists correctly roundtrip Python -> PostgreSQL -> Python.

- Other changes:

- 'cursor.description' is provided as named tuples if available.
- The build script refuses to guess values if 'pg_config' is not
found.
- Connections and cursors are weakly referenceable.

Bug fixes:

- Fixed adaptation of None in composite types (:ticket:`26`). Bug
report by Karsten Hilbert.
- Fixed several reference leaks in less common code paths.
- Fixed segfault when a large object is closed and its connection no
more available.
- Added missing icon to ZPsycopgDA package, not available in Zope
2.12.9 (:ticket:`30`). Bug report and patch by Pumukel.
- Fixed conversion of negative infinity (:ticket:`40`). Bug report and
patch by Marti Raudsepp.

2.3.2

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

- Fixed segfault with middleware not passing DateStyle to the client
(:ticket:`24`). Bug report and patch by Marti Raudsepp.

2.3.1

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

- Fixed build problem on CentOS 5.5 x86_64 (:ticket:`23`).

2.3

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

psycopg 2.3 aims to expose some new features introduced in PostgreSQL 9.0.

Main new features:

- `dict` to `hstore` adapter and `hstore` to `dict` typecaster, using both
9.0 and pre-9.0 syntax.
- Two-phase commit protocol support as per DBAPI specification.
- Support for payload in notifications received from the backend.
- `namedtuple`-returning cursor.
- Query execution cancel.

Other features and changes:

- Dropped support for protocol 2: Psycopg 2.3 can only connect to PostgreSQL
servers with version at least 7.4.
- Don't issue a query at every connection to detect the client encoding
and to set the datestyle to ISO if it is already compatible with what
expected.
- `mogrify()` now supports unicode queries.
- Subclasses of a type that can be adapted are adapted as the superclass.
- `errorcodes` knows a couple of new codes introduced in PostgreSQL 9.0.
- Dropped deprecated Psycopg "own quoting".
- Never issue a ROLLBACK on close/GC. This behaviour was introduced as a bug
in release 2.2, but trying to send a command while being destroyed has been
considered not safe.

Bug fixes:

- Fixed use of `PQfreemem` instead of `free` in binary typecaster.
- Fixed access to freed memory in `conn_get_isolation_level()`.
- Fixed crash during Decimal adaptation with a few 2.5.x Python versions
(:ticket:`7`).
- Fixed notices order (:ticket:`9`).

Page 8 of 14

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.