]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Daniele Varrazzo [Tue, 26 Aug 2025 11:22:12 +0000 (13:22 +0200)]
ci: use separate build caches between psycopg 3.2 and 3.3
Introduce a suffix to change the cache key arbitrarily, to keep libpq
builds on different branches separate and not pollute each other's
cache.
Daniele Varrazzo [Tue, 26 Aug 2025 02:47:57 +0000 (04:47 +0200)]
fix: change default gssencmode to disable in built libpq
Fix #1136
Daniele Varrazzo [Tue, 26 Aug 2025 01:28:16 +0000 (03:28 +0200)]
feat: raise a warning if a GSS connection is obtained using the libpq default
Suggest the user to specify a 'gssencmode' setting explicitly so that,
in the future, we will be able to change the setting default to 'disable'.
Note: the warning in psycopg 3.3 is a runtime warning; in 3.2.x was a
deprectation warning.
See #1136
Daniele Varrazzo [Sun, 7 Sep 2025 14:05:58 +0000 (16:05 +0200)]
chore: restrict flake8 ignore on generated file to lines length only
Daniele Varrazzo [Sun, 7 Sep 2025 13:53:56 +0000 (15:53 +0200)]
Merge branch 'pg18'
Daniele Varrazzo [Sat, 5 Jul 2025 12:54:39 +0000 (14:54 +0200)]
feat: add `ConnectionInfo.full_protocol_version`
Add matching Capabilities methods too to allow checking if supported.
Daniele Varrazzo [Sat, 5 Jul 2025 11:50:02 +0000 (13:50 +0200)]
feat: add PGconn.full_protocol_version attributes
Wrap libpq 18 PQfullProtocolVersion functions.
See #1079
Daniele Varrazzo [Sun, 11 May 2025 20:50:58 +0000 (22:50 +0200)]
docs: mention PostgreSQL v18 support
Daniele Varrazzo [Sun, 7 Sep 2025 11:46:57 +0000 (13:46 +0200)]
ci: add PostgreSQL 18 to the test grid
Daniele Varrazzo [Sun, 11 May 2025 20:48:26 +0000 (22:48 +0200)]
chore: add PostgreSQL 18 exceptions
Daniele Varrazzo [Sun, 11 May 2025 20:43:00 +0000 (22:43 +0200)]
fix: add ConnStatus.CONNECTION_AUTHENTICATING value
Introduced in PostgreSQL 18
Daniele Varrazzo [Sun, 7 Sep 2025 11:42:25 +0000 (13:42 +0200)]
Merge branch 'fix-notifies-leak'
Daniele Varrazzo [Sat, 6 Sep 2025 21:44:42 +0000 (23:44 +0200)]
docs: document the changes to notifies generator
Daniele Varrazzo [Sat, 6 Sep 2025 22:14:48 +0000 (00:14 +0200)]
fix: raise a warning when notifies generator and handlers are used together
Daniele Varrazzo [Wed, 14 May 2025 15:16:03 +0000 (17:16 +0200)]
fix: collect notifies only if no handler was registered
If someone is listening to notifications by using an handler, the
notifies backlog would fill without ever being emptied.
This change has the risk of breaking something if someone is relying on
notifies being received both via callback and via generator, but I don't
know how to satisfy it without creating a leak to users who don't use the
generator. Will ask around...
Fix #1091.
Daniele Varrazzo [Sat, 6 Sep 2025 20:22:46 +0000 (22:22 +0200)]
Merge branch 'fix-executemany-lock'
Daniele Varrazzo [Sat, 6 Sep 2025 01:00:24 +0000 (03:00 +0200)]
fix: keep a lock for the entire duration of executemany
Before this change we had the lock context inside the pipeline context,
because conn.pipepline() and Pipeline.__enter/exit__ take a lock. But
this created windows of opportunities for other threads to execute
concurrent operations on the connection, resulting in "another command
is already in progress" errors.
Fix #1130.
Daniele Varrazzo [Fri, 5 Sep 2025 23:57:52 +0000 (01:57 +0200)]
refactor: auto-generate sync pipeline object from async one
Daniele Varrazzo [Fri, 5 Sep 2025 23:48:48 +0000 (01:48 +0200)]
refactor: separate sync/async pipeline in their own modules
Daniele Varrazzo [Sat, 6 Sep 2025 00:21:22 +0000 (02:21 +0200)]
refactor: introduce ALock/Lock in acompat
jerch [Sat, 6 Sep 2025 14:47:31 +0000 (16:47 +0200)]
fix: fix excessive buffer resizing on int16 dump
Fix #1160
Daniele Varrazzo [Tue, 2 Sep 2025 22:25:57 +0000 (00:25 +0200)]
Merge pull request #1053 from psycopg/py314
Add support for Python 3.14
Daniele Varrazzo [Tue, 2 Sep 2025 22:23:15 +0000 (00:23 +0200)]
docs: mention Python 3.14 support in news file
Daniele Varrazzo [Sun, 31 Aug 2025 19:20:50 +0000 (21:20 +0200)]
test: fix pproxy compatibility with Python 3.14
Work around the issue reported in https://github.com/qwj/python-proxy/issues/200
Daniele Varrazzo [Fri, 29 Aug 2025 18:11:05 +0000 (20:11 +0200)]
ci: test with Python 3.14 non-dev
Daniele Varrazzo [Fri, 29 Aug 2025 16:52:42 +0000 (18:52 +0200)]
chore(test): drop use of asyncio event loop policy
Deprecated since Python 3.14
Daniele Varrazzo [Fri, 29 Aug 2025 15:11:54 +0000 (17:11 +0200)]
ci(alpine): install missing libraris required to test and package wheels
Since some recent alpine version the krb5-libs package is not installed by
default anymore. When building the libpq the package got installed as a
side effect of installing krb5-dev, but, in case libpq build was cached,
the libraries would have been missing when packaging the wheel or
importing psycopg for test.
Daniele Varrazzo [Tue, 26 Aug 2025 15:54:24 +0000 (17:54 +0200)]
chore: bump cibuildwheel to 3.1.4
It should help with Python 3.14 builds.
Daniele Varrazzo [Tue, 29 Apr 2025 12:26:39 +0000 (14:26 +0200)]
chore: add Python 3.14 to supported version metadata and docs
Daniele Varrazzo [Tue, 29 Apr 2025 12:26:15 +0000 (14:26 +0200)]
ci: add Python 3.14 dev to package build
Daniele Varrazzo [Sun, 27 Apr 2025 21:47:15 +0000 (23:47 +0200)]
ci: add Python 3.14 version to test grid
Daniele Varrazzo [Mon, 1 Sep 2025 09:16:22 +0000 (11:16 +0200)]
chore(tests): drop deprecated unittest redefinitions
Not used anymore in legacy tests.
Ao Liu, Ph.D., CSM [Sat, 30 Aug 2025 00:36:23 +0000 (19:36 -0500)]
doc: fix formatting of SQL command in documentation
Daniele Varrazzo [Tue, 26 Aug 2025 15:11:33 +0000 (17:11 +0200)]
docs: fix reST typo
Daniele Varrazzo [Tue, 26 Aug 2025 15:07:36 +0000 (17:07 +0200)]
docs: add notes about how to add libpq wrapper functions
Daniele Varrazzo [Tue, 26 Aug 2025 15:07:04 +0000 (17:07 +0200)]
Merge pull request #1140 from psycopg/add-used-gssapi
Add `PGconn.used_gssapi` attribute
Daniele Varrazzo [Tue, 26 Aug 2025 02:16:25 +0000 (04:16 +0200)]
feat: expose used_gssapi attribute to the public API
Already implemented in 3.1.10, but kept as internal implementation.
Fix #1138
Daniele Varrazzo [Mon, 25 Aug 2025 16:35:30 +0000 (18:35 +0200)]
feat: add support for libpq PQconnectionUsedGSSAPI()
We will not advertise its presence as PGconn.used_gssapi until Psycopg
3.3. However we can use it internally to implement a warning to check
the implicit usage of gssencmode=prefer.
See #1136
Daniele Varrazzo [Tue, 26 Aug 2025 03:24:48 +0000 (05:24 +0200)]
docs: fix confusing comment from readme
Daniele Varrazzo [Tue, 26 Aug 2025 03:22:55 +0000 (05:22 +0200)]
docs: drop pip upgrade info from readme
Most systems will have the minimum required version 20.3 already.
Daniele Varrazzo [Tue, 26 Aug 2025 02:00:48 +0000 (04:00 +0200)]
fix: fix typo require version X and greater -> or greater
Daniele Varrazzo [Tue, 19 Aug 2025 14:51:35 +0000 (16:51 +0200)]
test: use current timezone name
Daniele Varrazzo [Tue, 22 Jul 2025 11:44:16 +0000 (13:44 +0200)]
chore: bump mypy to 1.17 in dev extra dependencies too
Daniele Varrazzo [Tue, 22 Jul 2025 11:39:05 +0000 (13:39 +0200)]
Merge branch 'fix-binary-version'
Daniele Varrazzo [Tue, 22 Jul 2025 01:31:15 +0000 (03:31 +0200)]
fix(binary): fix __version__
It was taken from the psycopg-c package, so it might have been wrong or,
more likely, reported as 0.0.0.0 because not installed.
Daniele Varrazzo [Tue, 22 Jul 2025 00:33:22 +0000 (02:33 +0200)]
test: verify the version is sane
Daniele Varrazzo [Tue, 22 Jul 2025 00:16:21 +0000 (02:16 +0200)]
chore: bump mypy to 1.17
Daniele Varrazzo [Wed, 16 Jul 2025 13:08:38 +0000 (15:08 +0200)]
Merge branch 'cursor-results'
Daniele Varrazzo [Sat, 12 Jul 2025 05:42:59 +0000 (07:42 +0200)]
test: more comprehensive results() tests
Test the records returned, not only the generator results.
Daniele Varrazzo [Sat, 12 Jul 2025 05:44:04 +0000 (07:44 +0200)]
chore(async-to-sync): handle generator expressions
Daniele Varrazzo [Sat, 12 Jul 2025 05:08:45 +0000 (07:08 +0200)]
test: fix results() test
Test a server-side cursor for real, drop unneeded parametrization.
Daniele Varrazzo [Sat, 12 Jul 2025 05:03:08 +0000 (07:03 +0200)]
docs: cleanup of `results()` documentation
Martin Baláž [Fri, 9 May 2025 10:10:05 +0000 (12:10 +0200)]
docs: document Cursor.results() and add rease note
Martin Baláž [Fri, 9 May 2025 10:08:54 +0000 (12:08 +0200)]
test: test Cursor.results() method
Martin Baláž [Fri, 9 May 2025 10:08:05 +0000 (12:08 +0200)]
feat: add Cursor.results() method
Daniele Varrazzo [Sat, 12 Jul 2025 04:39:48 +0000 (06:39 +0200)]
Merge branch 'fix-cancelled-error-shadowing'
Daniele Varrazzo [Fri, 11 Jul 2025 23:13:32 +0000 (01:13 +0200)]
fix(c): avoid a TypeError shadowing CancelledError on task cancellation
Fix #1005.
Daniele Varrazzo [Wed, 9 Jul 2025 11:23:28 +0000 (13:23 +0200)]
Merge branch 'dependabot/github_actions/master/actions-
d86b61c7bf '
Daniele Varrazzo [Sat, 5 Jul 2025 17:38:43 +0000 (19:38 +0200)]
chore: drop i686 images build
It has become opt-in in cibuildwheel, so it's a good moment to remove
these packages.
dependabot[bot] [Tue, 1 Jul 2025 09:16:38 +0000 (09:16 +0000)]
chore(deps): bump pypa/cibuildwheel in the actions group
Bumps the actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel).
Updates `pypa/cibuildwheel` from 2.23.3 to 3.0.0
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.23.3...v3.0.0)
---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
dependency-version: 3.0.0
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
...
Signed-off-by: dependabot[bot] <support@github.com>
Daniele Varrazzo [Sat, 5 Jul 2025 22:47:40 +0000 (00:47 +0200)]
test: fix failure in test_connection_warn_close
Create all the connections beforehand otherwise some may reuse the same
address, resulting in a duplicated warning message, which would be
omitted and fail the test.
Daniele Varrazzo [Wed, 30 Apr 2025 00:37:23 +0000 (02:37 +0200)]
fix: don't call str(self) or imported objects in __del__
We easily end up trying to access resources already unavailable in the
objects representation. In Python 3.14 this seems to happen aggressively
(or maybe it's just more visible because testing a dev version).
Daniele Varrazzo [Tue, 20 May 2025 15:06:06 +0000 (17:06 +0200)]
fix: change signature of SQL.join() to allow a sequence of Any
We declared accepting a sequence of Composable, but, because we passed
the joined values to `Composite`, actually non-composable were
interpreted as `Literal`.
Make this behaviour explicit by testing it and fixing the signature.
Daniele Varrazzo [Mon, 12 May 2025 15:13:57 +0000 (17:13 +0200)]
chore: run isort before other hooks
It's quicker to fail than mypy.
Daniele Varrazzo [Sat, 5 Jul 2025 17:07:52 +0000 (19:07 +0200)]
Merge branch 'fix-jsonb-function-caching-master'
Daniele Varrazzo [Fri, 4 Jul 2025 18:00:43 +0000 (20:00 +0200)]
fix(json): don't leak when lambdas are used as dumps/loads function
Cache functions on the code, not on the function identity itself:
different lambdas or local functions are different objects but he
underlying code object is the same.
Avoid caching if the function is a closure because it then becomes a can
of worms (if the argument is not hashable etc). Throw a warning in that
case.
Fix #1108
fix(json): don't leak when lambdas are used as loads function
Daniele Varrazzo [Sat, 5 Jul 2025 13:22:12 +0000 (15:22 +0200)]
fix: add missing interface for PGconn.protocol_version
Daniele Varrazzo [Wed, 4 Jun 2025 19:09:09 +0000 (20:09 +0100)]
Merge branch 'fix-1088'
Daniele Varrazzo [Wed, 4 Jun 2025 15:40:29 +0000 (16:40 +0100)]
ci: cancel concurrent binary build jobs
Daniele Varrazzo [Tue, 13 May 2025 14:07:47 +0000 (16:07 +0200)]
docs: mention fix in version 3.2.9
Daniele Varrazzo [Wed, 4 Jun 2025 15:38:36 +0000 (16:38 +0100)]
Revert "ci: install win32 libpq from conda force"
This reverts commit
a05131ded8f1ec1816528341c5453fd586e70a4b .
Fix #1088
Daniele Varrazzo [Mon, 2 Jun 2025 12:43:38 +0000 (13:43 +0100)]
test: skip tests connecting to non-existing dbs for CRDB
For CRDB, every database exists.
Daniele Varrazzo [Mon, 2 Jun 2025 10:37:26 +0000 (11:37 +0100)]
test: make sure tests don't hang if default connection points to a closed port
They might hang is the server doesn't accept connections on the standard
port.
Tested by forcing the default connection to go to an unresponsive port,
using:
export PGHOST=192.0.2.1
export PSYCOPG_TEST_DSN="host=localhost dbname=psycopg_test"
and fixing all the tests hanging because they try to connect to the
unroutable hostname, not taking into account the test dsn.
Daniele Varrazzo [Fri, 30 May 2025 21:30:45 +0000 (22:30 +0100)]
chore: bump mypy version
Daniele Varrazzo [Thu, 29 May 2025 18:32:40 +0000 (19:32 +0100)]
docs(pool): fix random connection lifetime reduction: 5%, not 10%
Close #1100.
Daniele Varrazzo [Tue, 27 May 2025 16:34:29 +0000 (17:34 +0100)]
docs: fix errors in template strings docs
Daniele Varrazzo [Mon, 26 May 2025 01:43:00 +0000 (02:43 +0100)]
docs: fix typo
Daniele Varrazzo [Sun, 25 May 2025 22:22:13 +0000 (23:22 +0100)]
docs: add preview of template strings query documentation
Daniele Varrazzo [Wed, 21 May 2025 16:54:43 +0000 (18:54 +0200)]
chore: bump Cython version
Skip version 3.1.0 because of https://github.com/cython/cython/issues/6850
I understand that >= 3.1.0 is required for the free threading support (#1096).
Daniele Varrazzo [Wed, 21 May 2025 09:34:50 +0000 (11:34 +0200)]
fix(test): wait for thread end before reading process stdout
Should solve what seems a race condition on PyPy and free-threaded
Python (see #1096).
Daniele Varrazzo [Mon, 12 May 2025 08:10:41 +0000 (10:10 +0200)]
docs: cleanup logging section
As per kind dive-by review in #1085.
Daniele Varrazzo [Sun, 11 May 2025 19:09:06 +0000 (21:09 +0200)]
refactor(pool): add function wrapper to call either async/sync version
Daniele Varrazzo [Sun, 11 May 2025 20:33:29 +0000 (22:33 +0200)]
chore: use the github url in update_errors
The official repo raises a 429 and doesn't allow to download blobs
anymore.
Daniele Varrazzo [Sun, 11 May 2025 11:35:06 +0000 (13:35 +0200)]
chore: bump psycopg package version to 3.2.8
Daniele Varrazzo [Sun, 11 May 2025 12:06:55 +0000 (14:06 +0200)]
ci: avoid running jobs on pull requests
Jobs run anyway on push. This setting results in duplicate runs.
Daniele Varrazzo [Sun, 11 May 2025 10:45:56 +0000 (12:45 +0200)]
ci: make sure versions are strings, not floats
Daniele Varrazzo [Sat, 10 May 2025 19:58:27 +0000 (21:58 +0200)]
chore: add funding link to project metadata
Daniele Varrazzo [Sat, 10 May 2025 16:27:50 +0000 (18:27 +0200)]
fix(c): fix building on 32 bit with libpq 18
The previous code was protected by a HAVE_LONG_INT_64 macro.
Daniele Varrazzo [Sat, 10 May 2025 15:55:05 +0000 (17:55 +0200)]
chore(binary): bump OpenSSL to 3.5.0
On Windows the libpq 17.5 package depends on it.
Daniele Varrazzo [Sat, 10 May 2025 13:30:00 +0000 (15:30 +0200)]
chore(binary): bump libpq to 17.5 in binary packages
Daniele Varrazzo [Sat, 10 May 2025 13:13:41 +0000 (14:13 +0100)]
Merge pull request #1085 from psycopg/better-logging
Better logging
Daniele Varrazzo [Sat, 10 May 2025 02:55:45 +0000 (04:55 +0200)]
docs: add section about connection logging
Daniele Varrazzo [Fri, 9 May 2025 01:14:16 +0000 (03:14 +0200)]
refactor: more succinct expression for multiple attempts error
Daniele Varrazzo [Fri, 9 May 2025 00:48:25 +0000 (02:48 +0200)]
feat: restore connection attempts logging
It was deleted in #1076, with the introduction of the multi-message
exception but it is still useful, looking at #888.
Daniele Varrazzo [Sat, 10 May 2025 02:22:26 +0000 (04:22 +0200)]
ci: add Django LTS 5.2 3rd party integration test
Daniele Varrazzo [Sat, 10 May 2025 02:11:29 +0000 (04:11 +0200)]
ci: fix 3rd party test after the pip django package went lowercase
Daniele Varrazzo [Fri, 9 May 2025 23:27:42 +0000 (01:27 +0200)]
Merge branch 'libpq-v18'
Daniele Varrazzo [Fri, 9 May 2025 22:00:52 +0000 (00:00 +0200)]
ci: include PostgreSQL 18 libpq in tests
Daniele Varrazzo [Fri, 9 May 2025 13:00:34 +0000 (15:00 +0200)]
fix: fix building with PostgreSQL v18 libpq
Use 64 bits support from C99 types.
Fix #1082
Daniele Varrazzo [Fri, 9 May 2025 14:36:55 +0000 (16:36 +0200)]
chore(tests): import module only locally as it won't be imported/used in C