]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
2 days agofix: raise DataError on malformed data in multirange binary loading master
Daniele Varrazzo [Sun, 19 Jul 2026 23:01:13 +0000 (01:01 +0200)] 
fix: raise DataError on malformed data in multirange binary loading

Close #1358

2 days agofix: reject unterminated text copy rows
Joey@macstudio [Sun, 12 Jul 2026 20:13:53 +0000 (04:13 +0800)] 
fix: reject unterminated text copy rows

Close #1361

4 days agotest: fix overflow in faker datetime handling
Dylan Young [Wed, 15 Jul 2026 01:22:06 +0000 (22:22 -0300)] 
test: fix overflow in faker datetime handling

Causes at least test_adapt::test_random to fail sometimes.

4 days agoFix missing f-string prefix in two DataError messages
winklemad [Fri, 17 Jul 2026 01:09:00 +0000 (06:39 +0530)] 
Fix missing f-string prefix in two DataError messages

Two error messages were built from plain string literals containing
{...} placeholders but missing the f prefix, so the literal placeholder
text was shown to the user instead of the offending value:

- types/datetime.py: "timestamp too small (before year 1): {s!r}"
- types/json.py: "unknown jsonb binary format: {data[0]}"

The sibling branches next to the datetime message are already f-strings,
which is what makes the omission stand out. Add the missing prefix to
both so the value is interpolated.

Fixes #1372

4 days agochore: run schedule workflow on the main repo only
Daniele Varrazzo [Sat, 18 Jul 2026 18:11:16 +0000 (20:11 +0200)] 
chore: run schedule workflow on the main repo only

Don't run them on forks too.

4 days agofix: check that we receive exactly one result after executing a command
Daniele Varrazzo [Wed, 1 Jul 2026 17:27:24 +0000 (19:27 +0200)] 
fix: check that we receive exactly one result after executing a command

This should never happen with a working FE-BE communication, but it is
not impossible it seems: see #1337, where I think it is happening for a
lock not behaving correctly in a broken Python runtime. It is also not
impossible that some broken Postgres implementation would send us this
curveball, so let's identify it as an unexpected condition.

Replace #1340 where it was proposed to accept the condition as good, but
this is not a condition to ignore IMO as it underlines something
serious.

6 days agochore: solve mypy 2.3 issue
Daniele Varrazzo [Wed, 15 Jul 2026 22:36:46 +0000 (00:36 +0200)] 
chore: solve mypy 2.3 issue

9 days agochore: fix some linting issues
Dylan Young [Wed, 8 Jul 2026 16:20:34 +0000 (13:20 -0300)] 
chore: fix some linting issues

Caused by:
- mypy upgrade to version 2.2
- types-setuptools upgrade to 83

3 weeks agodev: gitignore any directory prefixed with .venv
Dylan Young [Tue, 23 Jun 2026 01:43:27 +0000 (22:43 -0300)] 
dev: gitignore any directory prefixed with .venv

3 weeks agoMerge pull request #1326 from DylanYoung/fix-none-dumping
Daniele Varrazzo [Sun, 28 Jun 2026 10:44:03 +0000 (12:44 +0200)] 
Merge pull request #1326 from DylanYoung/fix-none-dumping

Fix Dumping non-None values with no NoneType dumper registered in Python implementation

3 weeks agofixup! fix(py): dumping non-None values when no NoneType dumper registered 1326/head
Dylan Young [Tue, 23 Jun 2026 17:26:31 +0000 (14:26 -0300)] 
fixup! fix(py): dumping non-None values when no NoneType dumper registered

3 weeks agodocs: add news entry for fix dumping without NoneType dumper
Dylan Young [Sun, 14 Jun 2026 23:27:49 +0000 (20:27 -0300)] 
docs: add news entry for fix dumping without NoneType dumper

3 weeks agotest: dumping without NoneType dumper registered
Dylan Young [Fri, 5 Jun 2026 17:52:28 +0000 (14:52 -0300)] 
test: dumping without NoneType dumper registered

3 weeks agofix(py): dumping non-None values when no NoneType dumper registered
Dylan Young [Fri, 12 Jun 2026 04:57:07 +0000 (01:57 -0300)] 
fix(py): dumping non-None values when no NoneType dumper registered

- in pure python implementation (c was already correct)

3 weeks agoMerge branch 'fix-wait_selector'
Daniele Varrazzo [Sun, 28 Jun 2026 09:13:21 +0000 (11:13 +0200)] 
Merge branch 'fix-wait_selector'

3 weeks agodocs: add news item about wait_selector fix
Dylan Young [Mon, 15 Jun 2026 03:31:53 +0000 (00:31 -0300)] 
docs: add news item about wait_selector fix

3 weeks agotest: main loop of each of the wait functions
Dylan Young [Mon, 15 Jun 2026 03:27:22 +0000 (00:27 -0300)] 
test: main loop of each of the wait functions

3 weeks agoperf: only reregister fileno when necessary in wait_conn
Dylan Young [Mon, 15 Jun 2026 03:22:26 +0000 (00:22 -0300)] 
perf: only reregister fileno when necessary in wait_conn

3 weeks agofix: wait_selector KeyError
Dylan Young [Mon, 15 Jun 2026 03:16:00 +0000 (00:16 -0300)] 
fix: wait_selector KeyError

3 weeks agodoc(dev): add note about local testing
Dylan Young [Mon, 8 Jun 2026 00:33:31 +0000 (21:33 -0300)] 
doc(dev): add note about local testing

How to exclude the primary tests that are likely to fail when
running tests locally.

3 weeks agoci: add explicit tags-ignore to workflows
Dylan Young [Mon, 8 Jun 2026 00:31:30 +0000 (21:31 -0300)] 
ci: add explicit tags-ignore to workflows

3 weeks agochore: remove unreachable line
Dylan Young [Sun, 7 Jun 2026 02:22:10 +0000 (23:22 -0300)] 
chore: remove unreachable line

3 weeks agoperf(py): avoid unnecessary copy of memoryview to bytes
Dylan Young [Sat, 6 Jun 2026 18:00:33 +0000 (15:00 -0300)] 
perf(py): avoid unnecessary copy of memoryview to bytes

3 weeks agochore(deps): upgrade mypy to version 2.1.0
Dylan Young [Fri, 3 Apr 2026 17:32:43 +0000 (14:32 -0300)] 
chore(deps): upgrade mypy to version 2.1.0

4 weeks agochore: bump cython-lint to latest version
Daniele Varrazzo [Mon, 22 Jun 2026 22:01:03 +0000 (00:01 +0200)] 
chore: bump cython-lint to latest version

4 weeks agofix(c): fix variable used in fetch_many to check for returned errors
Daniele Varrazzo [Mon, 22 Jun 2026 21:51:29 +0000 (23:51 +0200)] 
fix(c): fix variable used in fetch_many to check for returned errors

We were looping on the results previously reurnied, but only checking
the latest one. Apparently this has been enough so far, probably because the
only way it would have filed would have been in a multiple query, one of
which failing with a disconnection, and it doesn't seem it ever happened
in practice.

Change var name in the Python implementation because `res` in the loop
seems to clobber the external one.

5 weeks agoBump OpenSSL version to 3.5.7 for vuln remediation
ddl-ebrown [Tue, 16 Jun 2026 02:45:23 +0000 (19:45 -0700)] 
Bump OpenSSL version to 3.5.7 for vuln remediation

3.5.7
https://github.com/openssl/openssl/releases/tag/openssl-3.5.7

6 weeks agochore(deps): bump dnspython from 2.1.0 to 2.6.1
dependabot[bot] [Sun, 7 Jun 2026 22:51:46 +0000 (22:51 +0000)] 
chore(deps): bump dnspython from 2.1.0 to 2.6.1

Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.1.0 to 2.6.1.
- [Release notes](https://github.com/rthalley/dnspython/releases)
- [Changelog](https://github.com/rthalley/dnspython/blob/main/doc/whatsnew.rst)
- [Commits](https://github.com/rthalley/dnspython/compare/v2.1.0...v2.6.1)

---
updated-dependencies:
- dependency-name: dnspython
  dependency-version: 2.6.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
6 weeks agochore(deps): bump black from 26.1.0 to 26.3.1
dependabot[bot] [Sun, 7 Jun 2026 16:41:47 +0000 (16:41 +0000)] 
chore(deps): bump black from 26.1.0 to 26.3.1

Bumps [black](https://github.com/psf/black) from 26.1.0 to 26.3.1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/26.1.0...26.3.1)

---
updated-dependencies:
- dependency-name: black
  dependency-version: 26.3.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
6 weeks agochore(deps): bump wheel from 0.37 to 0.38.1
dependabot[bot] [Sun, 7 Jun 2026 16:29:00 +0000 (16:29 +0000)] 
chore(deps): bump wheel from 0.37 to 0.38.1

Bumps [wheel](https://github.com/pypa/wheel) from 0.37 to 0.38.1.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.37.0...0.38.1)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.38.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
6 weeks agotest: avoid generating date.max + 1 test dates
Daniele Varrazzo [Sun, 7 Jun 2026 22:48:03 +0000 (00:48 +0200)] 
test: avoid generating date.max + 1 test dates

6 weeks agoMerge pull request #1313 from dvarrazzo/syncify-tstring-tests
Daniele Varrazzo [Sun, 7 Jun 2026 22:23:33 +0000 (23:23 +0100)] 
Merge pull request #1313 from dvarrazzo/syncify-tstring-tests

Generate sync tstrings tests module from the async one, perform linting on the Python 3.14 modules too.

6 weeks agochore: fix linting errors in test_tstring modules 1313/head
Daniele Varrazzo [Mon, 1 Jun 2026 11:08:38 +0000 (12:08 +0100)] 
chore: fix linting errors in test_tstring modules

6 weeks agochore: ignore flake8 warning F542 globally
Daniele Varrazzo [Mon, 1 Jun 2026 11:02:39 +0000 (12:02 +0100)] 
chore: ignore flake8 warning F542 globally

See https://github.com/PyCQA/pyflakes/issues/845

6 weeks agoci: run the lint job on Python 3.14 files too
Daniele Varrazzo [Mon, 1 Jun 2026 10:57:19 +0000 (11:57 +0100)] 
ci: run the lint job on Python 3.14 files too

6 weeks agorefactor: convert tstring async module to sync
Daniele Varrazzo [Mon, 1 Jun 2026 10:45:18 +0000 (11:45 +0100)] 
refactor: convert tstring async module to sync

6 weeks agodocs(dev): add info about commit message conventions
Dylan Young [Tue, 2 Jun 2026 02:11:35 +0000 (23:11 -0300)] 
docs(dev): add info about commit message conventions

6 weeks agodocs: set maximum_signature_line_length for legibility
Dylan Young [Tue, 2 Jun 2026 00:56:11 +0000 (21:56 -0300)] 
docs: set maximum_signature_line_length for legibility

6 weeks agofix: use cls instead of self for classmethod
Dylan Young [Mon, 1 Jun 2026 03:35:11 +0000 (00:35 -0300)] 
fix: use cls instead of self for classmethod

6 weeks agotest(utils): Set default timeout in acompat.gather
Dylan Young [Fri, 1 May 2026 18:46:43 +0000 (15:46 -0300)] 
test(utils): Set default timeout in acompat.gather

- also fix it to use the supplied timeout

6 weeks agochore: remove reference to no longer existing acompat.anext
Dylan Young [Sun, 3 May 2026 00:44:27 +0000 (21:44 -0300)] 
chore: remove reference to no longer existing acompat.anext

6 weeks agofeat(dev): Log parsing errors in async_to_sync
Dylan Young [Fri, 3 Apr 2026 03:41:07 +0000 (00:41 -0300)] 
feat(dev): Log parsing errors in async_to_sync

6 weeks agochore(c): use abc.Buffer to silence cython warnings
Dylan Young [Mon, 25 May 2026 04:00:04 +0000 (01:00 -0300)] 
chore(c): use abc.Buffer to silence cython warnings

6 weeks agotest: regression test for incorrect error message in SQL.join
Dylan Young [Sat, 30 May 2026 01:15:06 +0000 (22:15 -0300)] 
test: regression test for incorrect error message in SQL.join

6 weeks agofix: correct error message in SQL.join
Dylan Young [Sun, 12 Apr 2026 23:44:44 +0000 (20:44 -0300)] 
fix: correct error message in SQL.join

6 weeks agofix: correct various typos
Dylan Young [Sun, 29 Mar 2026 19:38:08 +0000 (16:38 -0300)] 
fix: correct various typos

2 months agoMerge pull request #1307 from psycopg/fix-discarding
Daniele Varrazzo [Thu, 21 May 2026 23:48:39 +0000 (16:48 -0700)] 
Merge pull request #1307 from psycopg/fix-discarding

Discard prepared statement upon ALTER or DISCARD statements

2 months agofix: discard prepared statement upon ALTER or DISCARD statements 1307/head
Daniele Varrazzo [Thu, 21 May 2026 16:27:34 +0000 (09:27 -0700)] 
fix: discard prepared statement upon ALTER or DISCARD statements

There is still the case that people may issue a DROP or ALTER into a
prepared statement or something else obfuscating the status message, but
at least now an explicit DISCARD can be used as escape hatch for
whatever client/server state inconsistency.

2 months agodocs: update logo
Daniele Varrazzo [Fri, 8 May 2026 16:52:11 +0000 (18:52 +0200)] 
docs: update logo

2 months agochore: bump psycopg_pool package version to 3.3.2.dev1
Daniele Varrazzo [Fri, 1 May 2026 23:56:42 +0000 (01:56 +0200)] 
chore: bump psycopg_pool package version to 3.3.2.dev1

2 months agochore: bump psycopg package version to 3.3.5.dev1
Daniele Varrazzo [Fri, 1 May 2026 23:56:30 +0000 (01:56 +0200)] 
chore: bump psycopg package version to 3.3.5.dev1

2 months agochore(binary): bump dependency libraries
Daniele Varrazzo [Sat, 18 Apr 2026 15:05:16 +0000 (16:05 +0100)] 
chore(binary): bump dependency libraries

2 months agochore: bump psycopg_pool package version to 3.3.1 3.3.4 pool-3.3.1
Daniele Varrazzo [Fri, 1 May 2026 20:41:15 +0000 (22:41 +0200)] 
chore: bump psycopg_pool package version to 3.3.1

2 months agochore: bump psycopg package version to 3.3.4
Daniele Varrazzo [Fri, 1 May 2026 20:40:51 +0000 (22:40 +0200)] 
chore: bump psycopg package version to 3.3.4

2 months agoMerge pull request #1301 from oliverhaas/fix/sync-pool-open-race
Daniele Varrazzo [Fri, 1 May 2026 20:40:14 +0000 (22:40 +0200)] 
Merge pull request #1301 from oliverhaas/fix/sync-pool-open-race

fix(pool): race in the construction of the sync ConnectionPool lock

2 months agofix(pool): fix race in the construction of the sync ConnectionPool lock 1301/head
Oliver Haas [Thu, 30 Apr 2026 07:52:16 +0000 (09:52 +0200)] 
fix(pool): fix race in the construction of the sync ConnectionPool lock

The lock used to make `ConnectionPool.open()` thread-safe was itself
constructed lazily in `_ensure_lock()` without any guard. Two threads
racing the first `open()` could each create a different `Lock`, defeat
the mutual exclusion in `_open()`, both pass the `_closed` guard, and
both call `_start_workers()`. The second one tripped
`assert not self._workers`.

Construct the sync lock eagerly in `__init__`. The async lock must stay
lazy because `asyncio.Lock` binds to the running event loop.

2 months agochore(deps): bump the actions group across 1 directory with 4 updates
dependabot[bot] [Thu, 30 Apr 2026 20:15:54 +0000 (20:15 +0000)] 
chore(deps): bump the actions group across 1 directory with 4 updates

Bumps the actions group with 4 updates in the / directory: [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action), [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/github-script](https://github.com/actions/github-script).

Updates `docker/setup-qemu-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4)

Updates `pypa/cibuildwheel` from 3.3.1 to 3.4.1
- [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/v3.3.1...v3.4.1)

Updates `actions/upload-artifact` from 6 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

Updates `actions/github-script` from 8 to 9
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v8...v9)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: pypa/cibuildwheel
  dependency-version: 3.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months agofix: retain statusmessage after executemany with returning=False
Daniele Varrazzo [Mon, 30 Mar 2026 16:29:54 +0000 (18:29 +0200)] 
fix: retain statusmessage after executemany with returning=False

2 months agoperf: do less if X in Y: return Y[X] for cache-like patterns
Aarni Koskela [Fri, 27 Mar 2026 11:46:34 +0000 (13:46 +0200)] 
perf: do less if X in Y: return Y[X] for cache-like patterns

2 months agoMerge pull request #1299 from dvarrazzo/fix-camel-enum
Daniele Varrazzo [Thu, 30 Apr 2026 18:56:55 +0000 (20:56 +0200)] 
Merge pull request #1299 from dvarrazzo/fix-camel-enum

Fix client-side representation of enums requiring quotes

2 months agotest: skip test on crdb depending on precise regtype behaviour 1299/head
Daniele Varrazzo [Tue, 28 Apr 2026 19:21:20 +0000 (21:21 +0200)] 
test: skip test on crdb depending on precise regtype behaviour

See https://github.com/cockroachdb/cockroach/issues/169272

2 months agofix: fix client-side representation of enums requiring quotes
Daniele Varrazzo [Tue, 28 Apr 2026 12:01:40 +0000 (14:01 +0200)] 
fix: fix client-side representation of enums requiring quotes

The issue seems limited to the enum type: every other EnumInfo subclass
correctly pass the regtype to the base class init.

Close #1298

2 months agofix(pool): fix error message when min and max size are 0
Cédric Krier [Fri, 24 Apr 2026 09:40:53 +0000 (11:40 +0200)] 
fix(pool): fix error message when min and max size are 0

2 months agodocs(pool): add `closed` docs
Daniele Varrazzo [Fri, 24 Apr 2026 14:05:45 +0000 (16:05 +0200)] 
docs(pool): add `closed` docs

2 months agofix(pool): raise PoolError on reopening attempt
Daniele Varrazzo [Fri, 24 Apr 2026 13:38:25 +0000 (15:38 +0200)] 
fix(pool): raise PoolError on reopening attempt

This is not a breaking change because PoolError is a subclass of the
OperationalError previously raised.

See #1295.

2 months agochore: update build tools to use Python 3.14
Daniele Varrazzo [Wed, 22 Apr 2026 17:35:44 +0000 (19:35 +0200)] 
chore: update build tools to use Python 3.14

Close #1262

3 months agochore: avoid using SQLite cache in Mypy runs
Daniele Varrazzo [Wed, 1 Apr 2026 10:55:24 +0000 (12:55 +0200)] 
chore: avoid using SQLite cache in Mypy runs

Since Mypy 1.20 the SQLite cache is used by default. This highlights
Mypy concurrency issues running pre-commit in the CI, which are known to
the project devs but which we practically never encountered using the
file-based cache. See https://github.com/python/mypy/issues/21136.

The alternative solution of avoiding parallel Mypy runs in pre-commit
using `require_serial: false`, reveals other issues such as
https://github.com/python/mypy/issues/17362.

An alternative which would probably work could be to pass no file names
to mypy and re-mypy the entire codebase at every commit using
`pass_filenames: false`. See https://github.com/python/mypy/issues/13916.
This for me seems about 25% slower when changing a single file.

This commit restores the 1.19 behaviour of using the file-based cache,
which was working adequately for us. In the future we may decide to move
to `pass_filenames: false`.

4 months agoMerge pull request #1277 from Flamefork/issue-1275-waitingclient-cancel-race
Daniele Varrazzo [Thu, 19 Mar 2026 11:46:45 +0000 (12:46 +0100)] 
Merge pull request #1277 from Flamefork/issue-1275-waitingclient-cancel-race

Fix async pool cancellation handoff race

4 months agoFix async pool cancellation handoff race 1277/head
Ilia Ablamonov [Tue, 10 Mar 2026 15:46:40 +0000 (16:46 +0100)] 
Fix async pool cancellation handoff race

Fixes #1275

4 months agoMerge pull request #1280 from ericbuehl/monotonic-double
Daniele Varrazzo [Wed, 18 Mar 2026 23:49:33 +0000 (00:49 +0100)] 
Merge pull request #1280 from ericbuehl/monotonic-double

fix: premature ConnectionTimeout

4 months agofix: premature ConnectionTimeout 1280/head
Eric Buehl [Wed, 18 Mar 2026 17:30:54 +0000 (10:30 -0700)] 
fix: premature ConnectionTimeout

When time.monotonic() returns a large value (e.g. on a long-running system, or when patched by a time-mocking library) causes ConnectionTimeout to fire immediately.

4 months agotest: avoid converting the @skip_sync tests
Daniele Varrazzo [Tue, 10 Mar 2026 17:40:15 +0000 (18:40 +0100)] 
test: avoid converting the @skip_sync tests

4 months agoperf: speed up Python UUID converters
Aarni Koskela [Fri, 27 Feb 2026 16:38:59 +0000 (18:38 +0200)] 
perf: speed up Python UUID converters

5 months agochore: bump psycopg package version to 3.3.4.dev1
Daniele Varrazzo [Wed, 18 Feb 2026 18:07:55 +0000 (19:07 +0100)] 
chore: bump psycopg package version to 3.3.4.dev1

5 months agochore: bump psycopg package version to 3.3.3 3.3.3
Daniele Varrazzo [Wed, 18 Feb 2026 12:12:21 +0000 (13:12 +0100)] 
chore: bump psycopg package version to 3.3.3

5 months agoMerge pull request #1260 from ggevay/sync-error-fix
Daniele Varrazzo [Wed, 18 Feb 2026 12:11:42 +0000 (13:11 +0100)] 
Merge pull request #1260 from ggevay/sync-error-fix

Fix ValueError when server sends ErrorResponse during Sync after Parse

5 months agoFix ValueError when server sends ErrorResponse during Sync after Parse 1260/head
Gabor Gevay [Wed, 18 Feb 2026 10:06:25 +0000 (11:06 +0100)] 
Fix ValueError when server sends ErrorResponse during Sync after Parse

When using prepared statements, psycopg sends Parse+Sync via
PQsendPrepare and assumes libpq returns exactly one PGresult.
However, the PostgreSQL wire protocol allows ErrorResponse during
Sync processing (e.g., when an implicit transaction commit fails).
In this case, libpq returns two PGresult objects — one for the
successful ParseComplete and one for the ErrorResponse — causing
a ValueError: "too many values to unpack (expected 1)".

This commit handles multiple results from PQsendPrepare by
iterating over all returned results and checking each for errors,
consistent with how the non-prepare execute path already works.

5 months agodocs: fix typos
Johnny Deuss [Tue, 17 Feb 2026 22:55:31 +0000 (22:55 +0000)] 
docs: fix typos

Close #1258

5 months agoMerge pull request #1256 from veeceey/fix/tstrings-error-msg-and-docs-improvements
Daniele Varrazzo [Wed, 11 Feb 2026 10:58:18 +0000 (11:58 +0100)] 
Merge pull request #1256 from veeceey/fix/tstrings-error-msg-and-docs-improvements

Fix typo in tstrings error message and incorrect escape_identifier docs example

5 months agofix: fix error message incorrectly generated by Claude AI 1256/head
Daniele Varrazzo [Wed, 11 Feb 2026 10:56:10 +0000 (11:56 +0100)] 
fix: fix error message incorrectly generated by Claude AI

Close #1256.

5 months agofix: correct typo in tstrings error message and fix sql.rst docs
Varun Chawla [Tue, 10 Feb 2026 08:11:28 +0000 (00:11 -0800)] 
fix: correct typo in tstrings error message and fix sql.rst docs

- Fix error message in _tstrings.py: reference nonexistent "sql.Composite"
  corrected to "sql.Composable" (the actual base class)
- Fix docs/api/sql.rst: remove incorrect escape_identifier() example that
  passed a str where bytes is required (closes #421)
- Fix typo "re-exoprts" -> "re-exports" in conninfo.py

Co-Authored-By: Claude Opus 4.6
Note: this MR is AI slop which has been pushed by the author without
even considering if it was correct. Corrected by a human being in the
next commit on this branch.

5 months agochore(deps): bump pypa/cibuildwheel in the actions group
dependabot[bot] [Sun, 1 Feb 2026 07:54:58 +0000 (07:54 +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 3.3.0 to 3.3.1
- [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/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: 3.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agoMerge pull request #1233 from lysnikolaou/pgconn-critical-section
Daniele Varrazzo [Sat, 31 Jan 2026 00:31:25 +0000 (01:31 +0100)] 
Merge pull request #1233 from lysnikolaou/pgconn-critical-section

Use critical section to protect pgconn ptr

5 months agoMerge critical section and nogil blocks into one context manager 1233/head
Lysandros Nikolaou [Tue, 23 Dec 2025 12:56:04 +0000 (14:56 +0200)] 
Merge critical section and nogil blocks into one context manager

5 months agoUse the walrus operator
Lysandros Nikolaou [Tue, 23 Dec 2025 12:51:34 +0000 (14:51 +0200)] 
Use the walrus operator

5 months agoAdjust places with interaction with Python inside critical sections
Lysandros Nikolaou [Tue, 23 Dec 2025 12:35:42 +0000 (14:35 +0200)] 
Adjust places with interaction with Python inside critical sections

5 months agoUse critical section to protect pgconn ptr
Lysandros Nikolaou [Fri, 14 Nov 2025 16:31:11 +0000 (17:31 +0100)] 
Use critical section to protect pgconn ptr

This PR adds critical sections to the PGconn class so that
race condition between calling into the libpq bindings and
calling `close` which sets the `_pgconn_ptr` to NULL are
eliminated.

Also add one high-level and one low-level tests that trigger TSAN
warnings without this PR.

5 months agoMerge pull request #1247 from ewie/fix-operationerror-pgconn
Daniele Varrazzo [Sun, 25 Jan 2026 13:10:20 +0000 (14:10 +0100)] 
Merge pull request #1247 from ewie/fix-operationerror-pgconn

fix: retain pgconn on OperationalError

5 months agofix: retain pgconn on OperationalError 1247/head
Erik Wienhold [Wed, 14 Jan 2026 13:42:18 +0000 (14:42 +0100)] 
fix: retain pgconn on OperationalError

When multiple connection attempts fail, a new OperationalError with the
combined attempt errors is raised without retaining the pgconn attribute
of the original attempt errors.  Fix this by assigning the pgconn from
the last attempt error.

5 months agochore: update black to 26.1, re-lint codebase
Daniele Varrazzo [Wed, 21 Jan 2026 22:51:23 +0000 (23:51 +0100)] 
chore: update black to 26.1, re-lint codebase

Much better, thank you!

6 months agochore(deps): bump the actions group with 2 updates
dependabot[bot] [Thu, 1 Jan 2026 07:10:50 +0000 (07:10 +0000)] 
chore(deps): bump the actions group with 2 updates

Bumps the actions group with 2 updates: [actions/cache](https://github.com/actions/cache) and [actions/upload-artifact](https://github.com/actions/upload-artifact).

Updates `actions/cache` from 4 to 5
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

Updates `actions/upload-artifact` from 5 to 6
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months agochore(ci): drop macos 13 jobs
Daniele Varrazzo [Mon, 15 Dec 2025 13:16:57 +0000 (14:16 +0100)] 
chore(ci): drop macos 13 jobs

Runners closing down in Gitlab Action.

7 months agochore(deps): bump the actions group with 2 updates
dependabot[bot] [Mon, 1 Dec 2025 07:39:07 +0000 (07:39 +0000)] 
chore(deps): bump the actions group with 2 updates

Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel).

Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

Updates `pypa/cibuildwheel` from 3.2.1 to 3.3.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/v3.2.1...v3.3.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: pypa/cibuildwheel
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months agochore: bump psycopg package version to 3.3.3.dev1
Daniele Varrazzo [Sat, 6 Dec 2025 17:41:22 +0000 (18:41 +0100)] 
chore: bump psycopg package version to 3.3.3.dev1

7 months agochore: bump psycopg package version to 3.3.2 3.3.2
Daniele Varrazzo [Fri, 5 Dec 2025 13:23:23 +0000 (14:23 +0100)] 
chore: bump psycopg package version to 3.3.2

7 months agoMerge pull request #1231 from noirbee/fix/1230-adapter-get-dumper-race-condition
Daniele Varrazzo [Fri, 5 Dec 2025 13:21:23 +0000 (14:21 +0100)] 
Merge pull request #1231 from noirbee/fix/1230-adapter-get-dumper-race-condition

Avoid race condition when replacing class name with itself

7 months agofix(adapters): avoid race condition when replacing class name with itself 1231/head
Nicolas Noirbent [Wed, 3 Dec 2025 15:58:25 +0000 (16:58 +0100)] 
fix(adapters): avoid race condition when replacing class name with itself

Another thread may be switched to between the dmap.pop(fqn) instruction
and the dmap[scls] one, typically at program startup when multiple
threads are making their "first" queries.

Close #1230

7 months agofix: mark external libpq C functions as noexcept nogil
Lysandros Nikolaou [Fri, 28 Nov 2025 14:05:04 +0000 (15:05 +0100)] 
fix: mark external libpq C functions as noexcept nogil

Add noexcept nogil declarations to libpq bindings and endian conversion
functions. This improves things for when we start using critical
sections inside Cython-defines types. It's also more accurate this way,
instead of only marking the APIs that are explicitly used in a nogil
block.

7 months agodocs: larger font for 3.3.0 release
Daniele Varrazzo [Tue, 2 Dec 2025 21:45:44 +0000 (22:45 +0100)] 
docs: larger font for 3.3.0 release

7 months agochore: bump psycopg package version to 3.3.2.dev1
Daniele Varrazzo [Tue, 2 Dec 2025 21:28:38 +0000 (22:28 +0100)] 
chore: bump psycopg package version to 3.3.2.dev1