Psycopg2

Latest version: v2.9.9

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

Scan your dependencies

Page 10 of 14

2.0.11

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

New features:

- DictRow and RealDictRow now use less memory. If you inherit on them
remember to set __slots__ for your new attributes or be prepare to
go back to old memory usage.

Bug fixes:

- Fixed exception in setup.py.
- More robust detection of PostgreSQL development versions.
- Fixed exception in RealDictCursor, introduced in 2.0.10.

2.0.10

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

New features:

- A specialized type-caster that can parse time zones with seconds is
now available. Note that after enabling it (see extras.py) "wrong"
time zones will be parsed without raising an exception but the
result will be rounded.
- DictCursor can be used as a named cursor.
- DictRow now implements more dict methods.
- The connection object now expose PostgreSQL server version as the
.server_version attribute and the protocol version used as
.protocol_version.
- The connection object has a .get_parameter_status() methods that
can be used to obtain useful information from the server.

Bug fixes:

- None is now correctly always adapted to NULL.
- Two double memory free errors provoked by multithreading and
garbage collection are now fixed.
- Fixed usage of internal Python code in the notice processor; this
should fix segfaults when receiving a lot of notices in
multithreaded programs.
- Should build again on MSVC and Solaris.
- Should build with development versions of PostgreSQL (ones with
-devel version string.)
- Fixed some tests that failed even when psycopg was right.

2.0.9

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

New features:

- COPY TO/COPY FROM queries now can be of any size and psycopg will
correctly quote separators.
- float values Inf and NaN are now correctly handled and can
round-trip to the database.
- executemany() now return the numer of total INSERTed or UPDATEd
rows. Note that, as it has always been, executemany() should not
be used to execute multiple SELECT statements and while it will
execute the statements without any problem, it will return the
wrong value.
- copy_from() and copy_to() can now use quoted separators.
- "import psycopg2.extras" to get UUID support.

Bug fixes:

- register_type() now works on connection and cursor subclasses.
- fixed a memory leak when using lobjects.

2.0.8

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

New features:

- The connection object now has a get_backend_pid() method that
returns the current PostgreSQL connection backend process PID.
- The PostgreSQL large object API has been exposed through the
Cursor.lobject() method.

Bug fixes:

- Some fixes to ZPsycopgDA have been merged from the Debian package.
- A memory leak was fixed in Cursor.executemany().
- A double free was fixed in pq_complete_error(), that caused crashes
under some error conditions.

2.0.7

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

Improved error handling:

- All instances of psycopg2.Error subclasses now have pgerror,
pgcode and cursor attributes. They will be set to None if no
value is available.
- Exception classes are now chosen based on the SQLSTATE value from
the result. (184)
- The commit() and rollback() methods now set the pgerror and pgcode
attributes on exceptions. (152)
- errors from commit() and rollback() are no longer considered
fatal. (194)
- If a disconnect is detected during execute(), an exception will be
raised at that point rather than resulting in "ProgrammingError:
no results to fetch" later on. (186)

Better PostgreSQL compatibility:

- If the server uses standard_conforming_strings, perform
appropriate quoting.
- BC dates are now handled if psycopg is compiled with mxDateTime
support. If using datetime, an appropriate ValueError is
raised. (203)

Other bug fixes:

- If multiple sub-interpreters are in use, do not share the Decimal
type between them. (192)
- Buffer objects obtained from psycopg are now accepted by psycopg
too, without segfaulting. (209)
- A few small changes were made to improve DB-API compatibility.
All the dbapi20 tests now pass.

Miscellaneous:

- The PSYCOPG_DISPLAY_SIZE option is now off by default. This means
that display size will always be set to "None" in
cursor.description. Calculating the display size was expensive,
and infrequently used so this should improve performance.
- New QueryCanceledError and TransactionRollbackError exceptions
have been added to the psycopg2.extensions module. They can be
used to detect statement timeouts and deadlocks respectively.
- Cursor objects now have a "closed" attribute. (164)
- If psycopg has been built with debug support, it is now necessary
to set the PSYCOPG_DEBUG environment variable to turn on debug
spew.

2.0.6

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

Better support for PostgreSQL, Python and win32:

- full support for PostgreSQL 8.2, including NULLs in arrays
- support for almost all existing PostgreSQL encodings
- full list of PostgreSQL error codes available by importing the
psycopg2.errorcodes module
- full support for Python 2.5 and 64 bit architectures
- better build support on win32 platform

Support for per-connection type-casters (used by ZPsycopgDA too, this
fixes a long standing bug that made different connections use a random
set of date/time type-casters instead of the configured one.)

Better management of times and dates both from Python and in Zope.

copy_to and copy_from now take an extra "columns" parameter.

Python tuples are now adapted to SQL sequences that can be used with
the "IN" operator by default if the psycopg2.extensions module is
imported (i.e., the SQL_IN adapter was moved from extras to extensions.)

Fixed some small buglets and build glitches:

- removed double mutex destroy
- removed all non-constant initializers
- fixed PyObject_HEAD declarations to avoid memory corruption
on 64 bit architectures
- fixed several Python API calls to work on 64 bit architectures
- applied compatibility macros from PEP 353
- now using more than one argument format raise an error instead of
a segfault

Page 10 of 14

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.