Latest articles
Psycopg 3.3 released
Posted by Daniele Varrazzo on 2025-12-01
Tagged as
news,
release
We have released Psycopg 3.3 — and you should be excited about it!
Automatic async to sync code conversion
Posted by Daniele Varrazzo on 2024-09-23
Tagged as
psycopg3,
development
Psycopg 3 provides both a sync and an async Python interface: for each object used to perform I/O operations, such as Connection, Cursor, there is an async counterpart: AsyncConnection, AsyncCursor, with an intuitive interface: just add the right async or await keyword where needed:
Psycopg 3.2 released
Posted by Daniele Varrazzo on 2024-06-30
Tagged as
news,
release
It was quite the ride! But we made it!
After almost two years, 846 commits, more than 700 new tests, more than 20000 changes in 310 files (I didn't even realise that there were 310 files in this project...) Psycopg 3.2 has been released!
This release brings a few new feature and hopefully no meaningful non-backward compatible change. The whole list of changes is available in the changelog; these are some of the major points explained.
Pipeline mode in Psycopg
Posted by Denis Laxalde on 2024-05-08
Tagged as
psycopg3,
development
Version 3.1 of Psycopg added support for libpq pipeline mode, bringing significant performance boost, especially when network latency is important. In this article, we’ll briefly describe how it works from users’ perspective and under the hood while also providing a few implementation details.
Psycopg 3.1 released
Posted by Daniele Varrazzo on 2022-08-30
Tagged as
news,
release
Hello,
After several months of development, we are proud to release Psycopg 3.1!
Psycopg 3.1 is a gradual improvement on Psycopg 3.0, introducing new exciting features, redefining what can be done on the boundary between Python and PostgreSQL.
Psycopg 3.0 released
Posted by Daniele Varrazzo on 2021-10-13
Tagged as
news,
release
Hello,
I am extremely excited to announce the first stable release of Psycopg 3!
Psycopg 3.0 beta 1 released!
Posted by Daniele Varrazzo on 2021-08-30
Tagged as
news,
release
We are immensely proud to release on PyPI the first beta package of Psycopg 3!
Building a Django driver for Psycopg 3
Posted by Daniele Varrazzo on 2021-08-02
Tagged as
psycopg3,
development,
recipe
One of the goals of the Psycopg 3 project is to make easy to port code developed from Psycopg 2. For this reason the creation of a Django backend (the module you specify in the settings as your database ENGINE) was a project with a double goal:
- A Django driver is a way to make Psycopg 3 useful from the start, with the possibility of dropping it in a project transparently and have available, when needed the new features offered (for instance the superior COPY support).
- The difficulty of introducing Psycopg 3 in the Django codebase and the type of changes required are indicative of the type of problems that could be found porting other projects.
...and it's done! A few days ago, the new Psycopg 3 Django backend could pass the entire Django test suite!
Psycopg 2.9 released
Posted by Daniele Varrazzo on 2021-06-16
Tagged as
news,
release
Psycopg 2.9 has been released!
This is a relatively small release compared to previous major releases. However the creation of the packages took a lot of effort. The previously used CI system now has reduced support for free software projects - it was decided that package building should be moved to GitHub Actions.
Packaging has also become more complex because of the evolution of the Python packaging standards and the need to support multiple architectures (Intel, ARM, PPC...).
Maintaining a project such as Psycopg requires a lot of effort. For this reason, we are extremely grateful to all our sponsors who are enabling the maintenance and development of Psycopg. Thank you very much!
Designing a connection pool for psycopg3
Posted by Daniele Varrazzo on 2021-01-17
Tagged as
psycopg3,
development
The psycopg2 pool is a pretty simple object, little more than... a pool of open connections, and I think it falls short in several ways:
- the top usability problem is the fact that it cannot be used as context manager;
- if a connection is broken it is not noticed it until it is used by a client;
- if minconn connections are already taken, a new one is created and disposed of as soon as finished using, regardless of whether other clients may need it;
- if more than maxconn connections are requested the client will receive an error.
For psycopg3 I would like something better. I have read around, looking into other pool implementations to figure out what a well designed connection pool ought to do (a very well thought one seems the Java HikariCP) and these are a few ideas I'd like to work on: they are here for a feedback, before I jump into enthusiastically implementing the wrong thing...