@psycopg@fosstodon.org
@psycopg@fosstodon.org avatar

psycopg

@psycopg@fosstodon.org

I am the most used and most advanced PostgreSQL driver for Python! (it/its)

This profile is from a federated server and may be incomplete. Browse more on the original instance.

psycopg, to random
@psycopg@fosstodon.org avatar

Very exciting! Just a couple of features to finish, and a few MRs that are on the way to be merged, and then Psycopg 3.2 can be released!

https://github.com/psycopg/psycopg/milestones/3.2

psycopg, to random
@psycopg@fosstodon.org avatar

@dlax is the main author of the pipeline mode available in Psycopg 3.1, a massive work that allowed a great performance boost.

He has written an in-depth article for @dalibo about pipeline mode and its development and he has kindly republished it on the Psycopg website: https://www.psycopg.org/articles/2024/05/08/psycopg3-pipeline-mode/

Thank you very much!

psycopg, to random
@psycopg@fosstodon.org avatar

Psycopg has a few features whose availability depends on the libpq version used, and others are about to be added in 3.2: pipelines, support for prepared statements with PgBouncer, secure cancel...

Should we add a capabilities() feature to allow programs to check if a version is supported?

The idea is at <https://github.com/psycopg/psycopg/issues/772>. Comments are welcome!

fog, to random

@psycopg what about the "usual" photo in front of PostgreSQL stand?

psycopg,
@psycopg@fosstodon.org avatar

@fog I'm sorry, I couldn't make it to FOSDEM this year 🙂 Have fun!

psycopg, to random
@psycopg@fosstodon.org avatar

Just released Psycopg 3.1.14, a little but exciting release!

  • added pypy support (one line of code needed to be changed, but a lot to test)
  • added gevent support (one line of code needed to be changed - more or less).

Both are in the test suite now, so support is there to stay!

Thank you very much, happy hacking!

https://www.psycopg.org/psycopg3/docs/news.html#psycopg-3-1-14

psycopg, to random
@psycopg@fosstodon.org avatar

🎉🎉Psycopg 3.1.13 released!🎉🎉

Quite a few bugs fixed.

The most important is the management of connection strings with multiple hosts (which is actually a new feature, as the libpq doesn't do it by itself with async connections and we had to re-implement it in Python).

There was also a memory leak to be ashamed of (but only in Python, not in C, because C is easier).

Details at https://www.psycopg.org/psycopg3/docs/news.html#psycopg-3-1-13

Happy Friday, happy hacking!

psycopg, (edited ) to random
@psycopg@fosstodon.org avatar

The psycopg3 Connection.notifies() generator actually proved harder to use than expected. You can't do anything with the connection, it is not simple to stop.

MR 673 proposes to add timeout and maximum number of notifications to receive.

https://github.com/psycopg/psycopg/pull/673

Is this the right way to make something easier to use? Feedback is welcome!

psycopg, to random
@psycopg@fosstodon.org avatar

Feels weird, but it''s time to stop considering Psycopg 2 the present and Psycopg 3 the future.

We have entered the time in which Psycopg 3 is the present and Psycopg 2 the respectable past.

Updated the feature page, and a few other resources on the website, to reflect this: https://www.psycopg.org/features/

Thank you for the immense trust!

psycopg, to random
@psycopg@fosstodon.org avatar

More and more, there are people using psycopg connection pool expecting the pool to always return working connections. 🏊

Connections in the pool can be lost for several reasons: network problems, idle_session_timeout, middleware closing them... 🦈

Starting to consider to add a callback for check on getconn. The pool wouldn't actively check for connections quality, but the client would pay the price. 🤝

Details here for feedback and collaborations 💜 https://github.com/psycopg/psycopg/issues/656

psycopg, to random
@psycopg@fosstodon.org avatar

Python 3.12 support added to psycopg[binary] 3.1.12 and psycopg2-binary 2.9.9.

Go Python! 🐍 🐘 🐍 🐘 🐍 🐘

psycopg, to random
@psycopg@fosstodon.org avatar

Apparently there are new, juicy features in libpq 16, such as the sslcertmode connection parameter. so we just

🎉 released psycopg 2.9.8 🎉

which bundles libpq 16 in the binary package.

Users of the non-binary package just need to update libpq on their client to benefit of the new libpq features!

In the meantime, Psycopg 3 packages were already bundling libpq 16 a week ago... 💅

https://www.psycopg.org/docs/news.html#what-s-new-in-psycopg-2-9-8

psycopg, to random
@psycopg@fosstodon.org avatar

...released! Second release in a week, with plenty of bugs fixed.

Nasty surprises: you don't want to know that epoll() will hang forever if you close the fd it's listening on... 🤐 So, instead of discovering it the hard way, upgrade to psycopg 3.1.12!

https://www.psycopg.org/psycopg3/docs/news.html#psycopg-3-1-12

psycopg, to random
@psycopg@fosstodon.org avatar

5 lines of debug code that proved to be more useful than several graphical tools to find the cause of a memory leak in psycopg 😛

https://github.com/psycopg/psycopg/issues/647#issuecomment-1734143902

Which also mean that a new bugfix release is due, as this leak affects Django+Celery, a combo not unheard of.

psycopg, to random
@psycopg@fosstodon.org avatar

The psycopg 3 pool uses the logging module to monitor its key operations. This has been invaluable to solve bugs, but actually never documented... so here it is!

https://www.psycopg.org/psycopg3/docs/advanced/pool.html#debugging-pool-usage

psycopg, to random
@psycopg@fosstodon.org avatar

Thank you very much @theory: your Github Actions image to test PostgreSQL extensions allowed to port PGMP CI tests from Travis to Github in a breeze!

psycopg,
@psycopg@fosstodon.org avatar

@theory Oh cool, I didn't notice that. Will try it for sure 👍

psycopg, to random
@psycopg@fosstodon.org avatar

Psycopg 3.1.10 released! It adds supports for faster json packages such as orjson, helps to write easier error management around copy, and includes a smattering of other bugfixes.

Also added support for Python 3.12, but no binary packages yet until official release!

https://www.psycopg.org/psycopg3/docs/news.html#psycopg-3-1-10

psycopg, to random
@psycopg@fosstodon.org avatar

Cursor.executemany() in Psycopg 3 has returning=True!

But watch out! It returns as many result as the input records, and fetch*() will only fetch from the first! If you want to fetch all the result you have to skip to them using nextset().

We have improved the documentation to explain it. Check it out: https://www.psycopg.org/psycopg3/docs/api/cursors.html#psycopg.Cursor.executemany

psycopg, to random
@psycopg@fosstodon.org avatar

Remember that if you use a ConnectionPool with a server configured with max_idle_timeout, you are essentially looking for a fight between the client and the server!

If your server is configured with a non-zero idle timeout default, this is what you can do to avoid problems: https://www.psycopg.org/psycopg3/docs/advanced/pool.html#pool-and-idle-session-timeout-setting

psycopg, to random
@psycopg@fosstodon.org avatar

Thanks to @apollo13, Psycopg 3 has now integration tests with @django! Thank you very much for your help!

Enjoy a success! https://github.com/psycopg/psycopg/actions/runs/4870732796

psycopg, to random
@psycopg@fosstodon.org avatar

Packaging psycopg 3.1.9! We fixed several bugs in this little release, involving:

  • async cancellation
  • complex composite types dumping and restoring
  • more than 1024 FDs open

which shows how the driver is used at scale and in new and interesting ways. Looks good! 😋

Thank you very much for your trust!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • khanakhh
  • kavyap
  • thenastyranch
  • everett
  • tacticalgear
  • rosin
  • Durango
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • megavids
  • ethstaker
  • ngwrru68w68
  • cisconetworking
  • modclub
  • tester
  • osvaldo12
  • cubers
  • GTA5RPClips
  • normalnudes
  • Leos
  • provamag3
  • anitta
  • lostlight
  • All magazines