pypi PyGreSQL 6.3.0b1

56 minutes ago

This is a beta release of PyGreSQL 6.3 with many fixes that were found in a review of the whole code and by measuring the test coverage, particularly for client encodings other than UTF-8. Some changes are not fully backward compatible, because they fix behavior that was wrong or unsafe, for instance bytes parameters being sent as text or text being silently cut off at NUL characters. The changelog lists these changes in a separate section, with hints how to adapt existing code where needed. Please test your applications with this beta and report any problems, especially with databases using encodings other than UTF-8. The final 6.3.0 release will follow as soon as the beta has been tested.

PyGreSQL 6.3 supports Python 3.10 to 3.15 and PostgreSQL 12 to 19.

Install the beta with:

pip install --pre pygresql

Without --pre, pip continues to install the current stable release 6.2.3.

Highlights:

  • Plain bytes parameters are now adapted as bytea instead of text, and all strings are encoded and decoded with the client encoding.
  • Text that cannot be decoded with the client encoding is now returned as bytes.
  • Table names are now always case-sensitive, also when qualified with a schema name.
  • New ConnectError exception for connections that cannot be established.
  • New features such as encrypt_password() and change_password(), ipaddress parameters, procedures in callproc(), ON CONFLICT DO SELECT in upsert() with PostgreSQL 19.
  • Many crashes and memory leaks in the C extension and several SQL injections have been fixed.

See the changelog for all changes, including those that may require adapting existing code.

The source distribution and the wheels can be downloaded from PyPI. Pre-compiled wheels are available for 64-bit Windows with Python 3.10 to 3.15. They are now built and tested automatically and published with trusted publishing. They are built with libpq 19 and do not include libpq, so you need a libpq.dll from PostgreSQL 19 or newer on your PATH.

This version was developed with the help of Claude Code.

Don't miss a new PyGreSQL release

NewReleases is sending notifications on new releases.