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

---
title: PostgreSQL adapter for Python | daily.dev
description: Psycopg 2.7.4 fixes several bugs and splits PyPI distribution into two packages: psycopg2 (source-only starting with 2.8) and psycopg2-binary (Wheel-only). The...
canonical: https://daily.dev/posts/postgresql-adapter-for-python-b73i2kgo9
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.7.4 fixes several bugs and splits PyPI distribution into two packages: psycopg2 (source-only starting with 2.8) and psycopg2-binary (Wheel-only). The...
og:url: https://daily.dev/posts/postgresql-adapter-for-python-b73i2kgo9
og:image: https://api.daily.dev/og/posts/b73i2kGO9.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)** · 4 min read · 0 upvotes · 0 comments

## Summary

Psycopg 2.7.4 fixes several bugs and splits PyPI distribution into two packages: psycopg2 (source-only starting with 2.8) and psycopg2-binary (Wheel-only). The split addresses occasional segfaults caused by conflicting libssl versions when Wheel-installed Psycopg is used alongside Python's ssl library. Users who want binary convenience should switch to psycopg2-binary; those wanting reliability should install psycopg2 from source. Other fixes include NamedTupleCursor field name handling, Solaris 10 support, mogrify on closed cursors, autocommit session characteristics, MinTimeLoggingCursor on Python 3, array-of-points parsing, libpq version building, rowcount after executemany with RETURNING, and pypy3 compatibility. Wheels are now compiled against PostgreSQL 10.1 libpq and OpenSSL 1.0.2n, and Python 2.6 wheels are no longer available.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.psycopg.org/articles/2018/02/08/psycopg-274-released>

## Questions this post answers

### Why does my Python program segfault when using psycopg2 installed from a wheel alongside the ssl library?

The segfault happens because the Wheel-packaged psycopg2 bundles its own libssl, which conflicts with the system libssl already loaded by Python's ssl library (used by urllib or requests). A non-reentrant OpenSSL initialization function invoked by libpq at connection time causes crashes when two different libssl versions are bound in the same process, such as a multithreaded program opening https and database connections concurrently.

_Track library-specific gotchas like this one before they surface as production crashes, on daily.dev._

### What is the difference between psycopg2 and psycopg2-binary on PyPI?

Starting with Psycopg 2.7.4, psycopg2-binary is a Wheels-only package with identical behavior to psycopg2, installed via pip install psycopg2-binary but still imported as import psycopg2. It exists so developers can explicitly choose binary convenience or force a from-source install, since pip lacked a way to express 'install preferably from source.' From version 2.8 onward, the plain psycopg2 package becomes source-only.

_Developers picking between binary convenience and source reliability can follow packaging changes like this on daily.dev._

### Will psycopg2 wheel packages still work after upgrading to Psycopg 2.8?

No, starting from Psycopg 2.8 the psycopg2 PyPI package becomes source-only again, so binary wheel installs must switch to psycopg2-binary instead. Psycopg 2.7.4 already warns on import when installed as binary from the psycopg2 entry, pointing users to install psycopg2-binary to keep using wheels.

_Stay ahead of packaging breaking changes like this psycopg2 wheel removal with daily.dev._

---

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

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

```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-b73i2kgo9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/postgresql-adapter-for-python-b73i2kgo9"},"datePublished":"2026-08-23T12:18:57.185Z","dateModified":"2026-08-23T12:30:38.243Z","description":"Psycopg 2.7.4 fixes several bugs and splits PyPI distribution into two packages: psycopg2 (source-only starting with 2.8) and psycopg2-binary (Wheel-only). The...","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-b73i2kgo9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,postgresql,pip","timeRequired":"PT4M"}
{"@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-b73i2kgo9#faq","mainEntity":[{"@type":"Question","name":"Why does my Python program segfault when using psycopg2 installed from a wheel alongside the ssl library?","acceptedAnswer":{"@type":"Answer","text":"The segfault happens because the Wheel-packaged psycopg2 bundles its own libssl, which conflicts with the system libssl already loaded by Python's ssl library (used by urllib or requests). A non-reentrant OpenSSL initialization function invoked by libpq at connection time causes crashes when two different libssl versions are bound in the same process, such as a multithreaded program opening https and database connections concurrently. Track library-specific gotchas like this one before they surface as production crashes, on daily.dev."}},{"@type":"Question","name":"What is the difference between psycopg2 and psycopg2-binary on PyPI?","acceptedAnswer":{"@type":"Answer","text":"Starting with Psycopg 2.7.4, psycopg2-binary is a Wheels-only package with identical behavior to psycopg2, installed via pip install psycopg2-binary but still imported as import psycopg2. It exists so developers can explicitly choose binary convenience or force a from-source install, since pip lacked a way to express 'install preferably from source.' From version 2.8 onward, the plain psycopg2 package becomes source-only. Developers picking between binary convenience and source reliability can follow packaging changes like this on daily.dev."}},{"@type":"Question","name":"Will psycopg2 wheel packages still work after upgrading to Psycopg 2.8?","acceptedAnswer":{"@type":"Answer","text":"No, starting from Psycopg 2.8 the psycopg2 PyPI package becomes source-only again, so binary wheel installs must switch to psycopg2-binary instead. Psycopg 2.7.4 already warns on import when installed as binary from the psycopg2 entry, pointing users to install psycopg2-binary to keep using wheels. Stay ahead of packaging breaking changes like this psycopg2 wheel removal with daily.dev."}}]}
```

