Psycopg

Frameworks & Libraries

The PostgreSQL database adapter for Python.

Latest 3.3.4 · by PsycopgWebsitePyPI · psycopg

Release activity

Release activity — 9 releases across 9 days in the last year. Each cell is one day; darker means more releases that day. Older weeks are hidden at this screen width.
MayJunJulAug
SundayNo releases on Apr 26, 2026No releases on May 3, 2026No releases on May 10, 2026No releases on May 17, 2026No releases on May 24, 2026No releases on May 31, 2026No releases on Jun 7, 2026No releases on Jun 14, 2026No releases on Jun 21, 2026No releases on Jun 28, 2026No releases on Jul 5, 2026No releases on Jul 12, 2026No releases on Jul 19, 2026No releases on Jul 26, 2026No releases on Aug 2, 2026No releases on Aug 9, 2026
MondayNo releases on Apr 27, 2026No releases on May 4, 2026No releases on May 11, 2026No releases on May 18, 2026No releases on May 25, 2026No releases on Jun 1, 2026No releases on Jun 8, 2026No releases on Jun 15, 2026No releases on Jun 22, 2026No releases on Jun 29, 2026No releases on Jul 6, 2026No releases on Jul 13, 2026No releases on Jul 20, 2026No releases on Jul 27, 2026No releases on Aug 3, 2026No releases on Aug 10, 2026
TuesdayNo releases on Apr 28, 2026No releases on May 5, 2026No releases on May 12, 2026No releases on May 19, 2026No releases on May 26, 2026No releases on Jun 2, 2026No releases on Jun 9, 2026No releases on Jun 16, 2026No releases on Jun 23, 2026No releases on Jun 30, 2026No releases on Jul 7, 2026No releases on Jul 14, 2026No releases on Jul 21, 2026No releases on Jul 28, 2026No releases on Aug 4, 2026No releases on Aug 11, 2026
WednesdayNo releases on Apr 29, 2026No releases on May 6, 2026No releases on May 13, 2026No releases on May 20, 2026No releases on May 27, 2026No releases on Jun 3, 2026No releases on Jun 10, 2026No releases on Jun 17, 2026No releases on Jun 24, 2026No releases on Jul 1, 2026No releases on Jul 8, 2026No releases on Jul 15, 2026No releases on Jul 22, 2026No releases on Jul 29, 2026No releases on Aug 5, 2026
ThursdayNo releases on Apr 30, 2026No releases on May 7, 2026No releases on May 14, 2026No releases on May 21, 2026No releases on May 28, 2026No releases on Jun 4, 2026No releases on Jun 11, 2026No releases on Jun 18, 2026No releases on Jun 25, 2026No releases on Jul 2, 2026No releases on Jul 9, 2026No releases on Jul 16, 2026No releases on Jul 23, 2026No releases on Jul 30, 2026No releases on Aug 6, 2026
Friday1 release on May 1, 2026No releases on May 8, 2026No releases on May 15, 2026No releases on May 22, 2026No releases on May 29, 2026No releases on Jun 5, 2026No releases on Jun 12, 2026No releases on Jun 19, 2026No releases on Jun 26, 2026No releases on Jul 3, 2026No releases on Jul 10, 2026No releases on Jul 17, 2026No releases on Jul 24, 2026No releases on Jul 31, 2026No releases on Aug 7, 2026
SaturdayNo releases on May 2, 2026No releases on May 9, 2026No releases on May 16, 2026No releases on May 23, 2026No releases on May 30, 2026No releases on Jun 6, 2026No releases on Jun 13, 2026No releases on Jun 20, 2026No releases on Jun 27, 2026No releases on Jul 4, 2026No releases on Jul 11, 2026No releases on Jul 18, 2026No releases on Jul 25, 2026No releases on Aug 1, 2026No releases on Aug 8, 2026

9 releases in the last year

Changelog

3.3.4

Fixed 3
  • Fix possible spurious connection timeout in systems with very long uptimes in C extension
  • Fix client-side adaptation of enums whose name require quotes
  • Consistently populate statusmessage after executemany()
  • Fix possible spurious connection timeout in systems with very long uptimes in C extension (ticket #1280).
  • Fix client-side adaptation of enums whose name require quotes (ticket #1298).
  • Consistently populate statusmessage after executemany() (ticket #1302).
View originalPermalink
How 3.3.4 went

3.3.3

Fixed 2
  • Retain Error.pgconn when raising a single exception for multiple connection attempt errors
  • Return a proper error when server sends ErrorResponse for a Sync after a Parse
  • Retain Error.pgconn when raising a single exception for multiple connection attempt errors (ticket #1246).
  • Return a proper error when server sends ErrorResponse for a Sync after a Parse (ticket #1260).
View originalPermalink
How 3.3.3 went

3.3.2

Fix race condition in adapters at startup (ticket #1230).

View originalPermalink
How 3.3.2 went

3.3.1

Fix iteration on server-side cursors (ticket #1226).

View originalPermalink
How 3.3.1 went

3.3.0

Added 6
  • Add template strings queries
  • Enable adaptation of Python objects to PostgreSQL composites and back even if they are not sequences or if they take keyword arguments
  • Add Cursor.set_result() and Cursor.results() to move across the result sets of queries executed through executemany() or execute() with multiple statements
  • Add Transaction status to report the status during and after a transaction() block
  • Add pq.PGconn.used_gssapi attribute and Capabilities.has_used_gssapi() function
  • Add ConnectionInfo.full_protocol_version attribute and Capabilities.has_full_protocol_version() function
Changed 3
  • Cursors are now iterators, not just iterables, allowing next(cur) or anext(cur) to be called
  • Allow to change loaders using register_loader() on Cursor.adapters after a query result has been already returned
  • Disable default GSSAPI preferential connection in the binary package
Removed 1
  • Drop support for Python 3.8 and 3.9

New top-level features

  • Add template strings queries (ticket #1054).
  • More flexible composite adaptation: it is now possible to adapt Python objects to PostgreSQL composites and back even if they are not sequences or if they take keyword arguments (ticket #932, ticket #1202).
  • Cursors are now iterators, not just iterables. This means you can call next(cur) or anext(cur), which is useful as a type-safe expression (ticket #1064).
  • Add Cursor.set_result() and Cursor.results() to move across the result sets of queries executed though executemany() or execute() with multiple statements (tickets #1080, #1170).
  • Add Transaction status to report the status during and after a transaction() block (ticket #969).
  • Allow to change loaders using register_loader() on Cursor.adapters after a query result has been already returned (ticket #884). New libpq wrapper features
  • Add pq.PGconn.used_gssapi attribute and Capabilities.has_used_gssapi() function (ticket #1138).
  • Add ConnectionInfo.full_protocol_version attribute, Capabilities.has_full_protocol_version() function (ticket #1079). Other changes
  • Disable default GSSAPI preferential connection in the binary package (ticket #1136). Warning Please explicitly set the gssencmode connection parameter or the PGGSSENCMODE environment variable to interact reliably with the GSSAPI.
  • Drop support for Python 3.8 (ticket #976) and 3.9 (ticket #1056).
View originalPermalink
How 3.3.0 went

3.2.13

Changed 1
  • Show the host name in the error message in case of name resolution error
Fixed 2
  • Fix Cursor.copy() and AsyncCursor.copy() to hold the connection lock for the entire operation, preventing concurrent access issues
  • Fix GSSAPI check with C extension built with libpq < v16
  • Show the host name in the error message in case of name resolution error (ticket #1205).
  • Fix Cursor.copy() and AsyncCursor.copy() to hold the connection lock for the entire operation, preventing concurrent access issues (ticket #1210).
  • Fix GSSAPI check with C extension built with libpq < v16 (ticket #1216).
View originalPermalink
How 3.2.13 went

3.2.12

Fixed 1
  • Allow copy to pass different types per column, as long as the database can convert them, fixing a regression introduced in 3.2.11
  • Allow copy to pass different types per column, as long as the database can convert them. Regression introduced in 3.2.11 (ticket #1192).
View originalPermalink
How 3.2.12 went

3.2.11

Changed 1
  • Improve performance of Python conversion on results loading
Fixed 5
  • Fix spurious readiness flags in some of the wait functions
  • Fix high CPU usage using the wait_c function on Windows
  • Fix bad data on error in binary copy
  • Respect Copy.set_types() in TEXT copy in C version, consistently with the Python version
  • Don't raise warning, and don't leak resources, if a builtin function is used as JSON dumper/loader function
  • Fix spurious readiness flags in some of the wait functions (ticket #1141).
  • Fix high CPU usage using the wait_c function on Windows (ticket #645).
  • Fix bad data on error in binary copy (ticket #1147).
  • Respect Copy.set_types() in TEXT copy in C version, consistently with the Python version (ticket #1153).
  • Don’t raise warning, and don’t leak resources, if a builtin function is used as JSON dumper/loader function (ticket #1165).
  • Improve performance of Python conversion on results loading (ticket #1155).
View originalPermalink
How 3.2.11 went

3.2.10

Added 1
  • Add support for Python 3.14
Changed 1
  • Notifications received when a handler is registered via add_notify_handler() will not be yielded by the notifies() generator if the generator is not running
Fixed 5
  • Fix TypeError shadowing CancelledError upon task cancellation during pipeline execution
  • Fix memory leak when lambda/local functions are used as argument for set_json_dumps(), set_json_loads()
  • Fix coordination of executemany() with other concurrent operations on other cursors
  • Fix leak receiving notifications if the notifies() generator is not called
  • Fix psycopg_binary.__version__
Deprecated 1
  • Using both the notifies() generator and add_notify_handler() to receive notifications on the same connection
Security 1
  • Raise a warning if a GSSAPI connection is obtained using the gssencmode=prefer libpq default
  • Fix TypeError shadowing CancelledError upon task cancellation during pipeline execution (ticket #1005).
  • Fix memory leak when lambda/local functions are used as argument for set_json_dumps(), set_json_loads() (ticket #1108).
  • Fix coordination of executemany() with other concurrent operations on other cursors (ticket #1130).
  • Fix leak receiving notifications if the notifies() generator is not called (ticket #1091). Warning This bugfix required the introduction of a change in notifies reception behaviour. If a notification is received when a handler is registered via add_notify_handler() and the notifies() generator is not running the notification will not be yielded by the generator. This is a behaviour similar to before Psycopg 3.2.4, but notifications are not lost if no handler is registered. Using both the generator and handlers to receive notifications on the same connection is therefore deprecated and will now generate a runtime warning.
  • Add support for Python 3.14 (ticket #1053).
  • Fix psycopg_binary.version.
  • Raise a warning if a GSSAPI connection is obtained using the gssencmode=prefer libpq default (see ticket #1136). Warning In a future Psycopg version the default in the binary package will be changed to disable. If you need to interact with the GSSAPI reliably you should explicitly set the gssencmode parameter in the connection string or the PGGSSENCMODE environment variable to prefer or require.
View originalPermalink
How 3.2.10 went

3.2.9

Fixed 1
  • Revert the libpq included in the binary packages from conda forge to vcpkg to fix GSS connection crashes
  • Revert the libpq included in the binary packages from conda forge to vcpkg because GSS connection crashes (ticket #1088).
View originalPermalink
How 3.2.9 went

3.2.8

Added 1
  • Add support for PostgreSQL 18 libpq
Changed 2
  • Report all the attempts error messages in the exception raised for a connection failure
  • Improve logging on connection
Fixed 6
  • DateFromTicks and TimeFromTicks return values to return a date and a time referred to the UTC timezone rather than to the local timezone, and TimestampFromTicks to return a datetime in UTC rather than in the local timezone
  • rownumber after using scroll() on AsyncServerCursor
  • interval parsing with days or other parts and negative time in C module
  • Don't process further connection attempts after Ctrl-C
  • cursors to correctly iterate over rows even if their row factory returns None
  • ConnectionInfo.port when the port is specified as an empty string
  • Fix DateFromTicks and TimeFromTicks return values to return a date and a time referred to the UTC timezone rather than to the local timezone. For consistency, TimestampFromTicks to return a datetime in UTC rather than in the local timezone (ticket #1058).
  • Fix rownumber after using scroll() on AsyncServerCursor (ticket #1066).
  • Fix interval parsing with days or other parts and negative time in C module (ticket #1071).
  • Don’t process further connection attempts after Ctrl-C (ticket #1077).
  • Fix cursors to correctly iterate over rows even if their row factory returns None (ticket #1073).
  • Fix ConnectionInfo.port when the port is specified as an empty string (ticket #1078).
  • Report all the attempts error messages in the exception raised for a connection failure (ticket #1069).
  • Improve logging on connection (ticket #1085).
  • Add support for PostgreSQL 18 libpq (ticket #1082).
View originalPermalink
How 3.2.8 went

3.2.7

Added 2
  • Add SRID support to shapely dumpers/loaders
  • Add support for binary hstore
  • Add SRID support to shapely dumpers/loaders (ticket #1028).
  • Add support for binary hstore (ticket #1030).
View originalPermalink
How 3.2.7 went

3.2.6

Fixed 1
  • Connection semantic when using target_session_attrs=prefer-standby
  • Fix connection semantic when using target_session_attrs=prefer-standby (ticket #1021).
View originalPermalink
How 3.2.6 went

3.2.5

  • 3x faster UUID loading thanks to C implementation (tickets #447, #998).
View originalPermalink
How 3.2.5 went

3.2.4

Changed 3
  • Build macOS dependencies from sources instead of using the Homebrew versions
  • Bump libpq to 17.2 in Linux and macOS binary packages
  • Bump libpq to 16.4 in Windows binary packages, using the vcpkg library
Fixed 3
  • Don't lose notifies received whilst the notifies() iterator is not running
  • Make sure that the notifies callback is called during the use of the notifies() generator
  • Raise the correct error returned by the database such as AdminShutdown or IdleInTransactionSessionTimeout instead of a generic OperationalError when a server error causes a client disconnection
  • Don’t lose notifies received whilst the notifies() iterator is not running (ticket #962). Warning If you were using notifications to bridge the time between issuing a LISTEN on a channel and starting the iterator you might receive duplicate notifications.
  • Make sure that the notifies callback is called during the use of the notifies() generator (ticket #972).
  • Raise the correct error returned by the database (such as AdminShutdown or IdleInTransactionSessionTimeout) instead of a generic OperationalError when a server error causes a client disconnection (ticket #988).
  • Build macOS dependencies from sources instead using the Homebrew versions in order to avoid problems with MACOSX_DEPLOYMENT_TARGET (ticket #858).
  • Bump libpq to 17.2 in Linux and macOS binary packages.
  • Bump libpq to 16.4 in Windows binary packages, using the vcpkg library (ticket #966).
View originalPermalink
How 3.2.4 went
View all

Discussion