<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7" -->

---
title: PostgreSQL adapter for Python | daily.dev
description: Psycopg 2.8, the most popular PostgreSQL adapter for Python, has been released after roughly two years since the previous major version. Key additions include...
canonical: https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: PostgreSQL adapter for Python | daily.dev
og:description: Psycopg 2.8, the most popular PostgreSQL adapter for Python, has been released after roughly two years since the previous major version. Key additions include...
og:url: https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7
og:image: https://api.daily.dev/og/posts/6UbubORq7.png
og:image:alt: PostgreSQL adapter for Python
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL adapter for Python

**[Psycopg](https://daily.dev/sources/psycopg)** · 3 min read · 0 upvotes · 0 comments

## Summary

Psycopg 2.8, the most popular PostgreSQL adapter for Python, has been released after roughly two years since the previous major version. Key additions include mapping PostgreSQL errors to Python exceptions, a new connection.info object for inspecting connection state, improvements to query result introspection, and refactored asynchronous communication and concurrency handling. Support for Python 2.6, 3.2, and 3.3 has been dropped, the psycopg1 module and several deprecated APIs are removed, and binary wheels are now installed only via the separate psycopg2-binary package. Wheels are compiled against OpenSSL 1.0.2r and PostgreSQL 11.2 libpq.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.psycopg.org/articles/2019/04/04/psycopg-28-released>

## Questions this post answers

### What breaking changes come with upgrading to psycopg2 2.8?

Psycopg2 2.8 drops support for Python 2.6, 3.2, and 3.3, removes the psycopg1 module, and no longer installs binary packages by default, requiring the separate psycopg2-binary package. It also drops the deprecated register_tstz_w_secs() function, the PersistentConnectionPool class, the PSYCOPG_DISPLAY_SIZE build parameter, and default mxDateTime support, plus stops using 2to3 during installation.

_Track breaking changes like this before upgrading psycopg2 in production with daily.dev._

### How does psycopg2 2.8 handle PostgreSQL errors differently than before?

Psycopg2 2.8 introduces an errors module that converts every PostgreSQL error into a specific Python exception class, replacing generic error handling with a more idiomatic exception-based approach. This change was tracked under ticket #682 and lets developers catch specific PostgreSQL error types directly in Python code.

_Developers adapting error handling to new library releases can follow changes like this on daily.dev._

### How do I get PostgreSQL connection details in psycopg2 2.8?

Psycopg2 2.8 adds a connection.info object that exposes various PostgreSQL connection information directly, introduced under ticket #726. It also adds get_native_connection() and pgconn_ptr/pgresult_ptr to expose raw PGconn and PGresult structures for interacting with libpq via C extensions or ctypes.

_daily.dev helps developers keep up with new introspection APIs in libraries like psycopg2._

---

Tags: [#python](https://daily.dev/tags/python), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"PostgreSQL adapter for Python","url":"https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7"},"datePublished":"2026-08-23T12:18:56.348Z","dateModified":"2026-08-23T12:30:31.201Z","description":"Psycopg 2.8, the most popular PostgreSQL adapter for Python, has been released after roughly two years since the previous major version. Key additions include...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b0cbd2ac8948f96ab39fa6a90db7464f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b0cbd2ac8948f96ab39fa6a90db7464f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Psycopg","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Psycopg","logo":"https://media.daily.dev/image/upload/s--5N-KNNWk--/f_auto,q_auto/v1787487485/logos/psycopg?_a=BAMAMicg0","url":"https://daily.dev/sources/psycopg"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,postgresql","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Psycopg","item":"https://daily.dev/sources/psycopg"},{"@type":"ListItem","position":3,"name":"PostgreSQL adapter for Python"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/postgresql-adapter-for-python-6ububorq7#faq","mainEntity":[{"@type":"Question","name":"What breaking changes come with upgrading to psycopg2 2.8?","acceptedAnswer":{"@type":"Answer","text":"Psycopg2 2.8 drops support for Python 2.6, 3.2, and 3.3, removes the psycopg1 module, and no longer installs binary packages by default, requiring the separate psycopg2-binary package. It also drops the deprecated register_tstz_w_secs() function, the PersistentConnectionPool class, the PSYCOPG_DISPLAY_SIZE build parameter, and default mxDateTime support, plus stops using 2to3 during installation. Track breaking changes like this before upgrading psycopg2 in production with daily.dev."}},{"@type":"Question","name":"How does psycopg2 2.8 handle PostgreSQL errors differently than before?","acceptedAnswer":{"@type":"Answer","text":"Psycopg2 2.8 introduces an errors module that converts every PostgreSQL error into a specific Python exception class, replacing generic error handling with a more idiomatic exception-based approach. This change was tracked under ticket #682 and lets developers catch specific PostgreSQL error types directly in Python code. Developers adapting error handling to new library releases can follow changes like this on daily.dev."}},{"@type":"Question","name":"How do I get PostgreSQL connection details in psycopg2 2.8?","acceptedAnswer":{"@type":"Answer","text":"Psycopg2 2.8 adds a connection.info object that exposes various PostgreSQL connection information directly, introduced under ticket #726. It also adds get_native_connection() and pgconn_ptr/pgresult_ptr to expose raw PGconn and PGresult structures for interacting with libpq via C extensions or ctypes. daily.dev helps developers keep up with new introspection APIs in libraries like psycopg2."}}]}
```

