Psycopg2

Latest version: v2.9.10

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

Scan your dependencies

Page 10 of 14

2.0.12

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

New features:

- The connection object now has a reset() method that can be used to
reset the connection to its default state.

Bug fixes:

- copy_to() and copy_from() now accept a much larger number of columns.
- Fixed PostgreSQL version detection.
- Fixed ZPsycopgDA version check.
- Fixed regression in ZPsycopgDA that made it behave wrongly when
receiving serialization errors: now the query is re-issued as it
should be by propagating the correct exception to Zope.
- Writing "large" large objects should now work.

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.

Page 10 of 14

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.