]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
3 weeks agochore(ci): bump crdb test versions
Daniele Varrazzo [Fri, 12 Sep 2025 15:13:38 +0000 (17:13 +0200)] 
chore(ci): bump crdb test versions

3 weeks agoci: run lint/tests in any branches
Daniele Varrazzo [Fri, 12 Sep 2025 14:33:23 +0000 (16:33 +0200)] 
ci: run lint/tests in any branches

The `*` results in branches with a `/` excluded.

Also exclude running tests if only docs change.

3 weeks agofix: typo in notifications warning
Daniele Varrazzo [Mon, 8 Sep 2025 11:06:44 +0000 (13:06 +0200)] 
fix: typo in notifications warning

3 weeks agoci: use stable runner windows-2022
Daniele Varrazzo [Sun, 7 Sep 2025 14:12:50 +0000 (16:12 +0200)] 
ci: use stable runner windows-2022

Soon the `-latest` image will become -2025.

3 weeks agochore: bump psycopg package version to 3.2.11.dev1
Daniele Varrazzo [Mon, 8 Sep 2025 09:14:43 +0000 (11:14 +0200)] 
chore: bump psycopg package version to 3.2.11.dev1

4 weeks agochore: bump psycopg package version to 3.2.10 3.2.10
Daniele Varrazzo [Sun, 7 Sep 2025 15:44:54 +0000 (17:44 +0200)] 
chore: bump psycopg package version to 3.2.10

4 weeks agoMerge branch 'pg18-3.2' into maint-3.2
Daniele Varrazzo [Sun, 7 Sep 2025 13:54:22 +0000 (15:54 +0200)] 
Merge branch 'pg18-3.2' into maint-3.2

4 weeks agodocs: mention PostgreSQL v18 support
Daniele Varrazzo [Sun, 11 May 2025 20:50:58 +0000 (22:50 +0200)] 
docs: mention PostgreSQL v18 support

4 weeks agoci: add PostgreSQL 18 to the test grid
Daniele Varrazzo [Sun, 7 Sep 2025 00:35:30 +0000 (02:35 +0200)] 
ci: add PostgreSQL 18 to the test grid

4 weeks agochore: add PostgreSQL 18 exceptions
Daniele Varrazzo [Sun, 11 May 2025 20:48:26 +0000 (22:48 +0200)] 
chore: add PostgreSQL 18 exceptions

4 weeks agofix: add ConnStatus.CONNECTION_AUTHENTICATING value
Daniele Varrazzo [Sun, 11 May 2025 20:43:00 +0000 (22:43 +0200)] 
fix: add ConnStatus.CONNECTION_AUTHENTICATING value

Introduced in PostgreSQL 18

4 weeks agoMerge branch 'fix-1091' into maint-3.2
Daniele Varrazzo [Sun, 7 Sep 2025 11:42:36 +0000 (13:42 +0200)] 
Merge branch 'fix-1091' into maint-3.2

4 weeks agodocs: document the changes to notifies generator 1092/head
Daniele Varrazzo [Sat, 6 Sep 2025 21:44:42 +0000 (23:44 +0200)] 
docs: document the changes to notifies generator

4 weeks agofix: raise a warning when notifies generator and handlers are used together
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

4 weeks agofix: collect notifies only if no handler was registered
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.

4 weeks agoci: move minimum SQLAlchemy git main Python version to 3.10
Daniele Varrazzo [Sat, 6 Sep 2025 18:31:35 +0000 (20:31 +0200)] 
ci: move minimum SQLAlchemy git main Python version to 3.10

4 weeks agoci: run packages build on workflow file change
Daniele Varrazzo [Sat, 6 Sep 2025 18:32:59 +0000 (20:32 +0200)] 
ci: run packages build on workflow file change

4 weeks agoMerge branch 'fix-executemany-lock-3.2' into maint-3.2
Daniele Varrazzo [Sat, 6 Sep 2025 19:18:51 +0000 (21:18 +0200)] 
Merge branch 'fix-executemany-lock-3.2' into maint-3.2

4 weeks agofix: keep a lock for the entire duration of executemany 1159/head
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.

4 weeks agorefactor: auto-generate sync pipeline object from async one
Daniele Varrazzo [Fri, 5 Sep 2025 23:57:52 +0000 (01:57 +0200)] 
refactor: auto-generate sync pipeline object from async one

4 weeks agorefactor: separate sync/async pipeline in their own modules
Daniele Varrazzo [Fri, 5 Sep 2025 23:48:48 +0000 (01:48 +0200)] 
refactor: separate sync/async pipeline in their own modules

4 weeks agofix: fix excessive buffer resizing on int16 dump
jerch [Sat, 6 Sep 2025 14:47:31 +0000 (16:47 +0200)] 
fix: fix excessive buffer resizing on int16 dump

Fix #1160

4 weeks agoMerge pull request #1137 from psycopg/gssapi-warning
Daniele Varrazzo [Fri, 5 Sep 2025 21:59:47 +0000 (23:59 +0200)] 
Merge pull request #1137 from psycopg/gssapi-warning

Warn about implicit use of GSS-API

4 weeks agofeat: raise a warning if a GSS connection is obtained using the libpq default 1137/head
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'.

See #1136

4 weeks agofeat: add support for libpq PQconnectionUsedGSSAPI()
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

4 weeks agoMerge branch 'py314-3.2' into maint-3.2
Daniele Varrazzo [Tue, 2 Sep 2025 22:26:28 +0000 (00:26 +0200)] 
Merge branch 'py314-3.2' into maint-3.2

4 weeks agodocs: mention Python 3.14 support in news file
Daniele Varrazzo [Tue, 2 Sep 2025 22:23:15 +0000 (00:23 +0200)] 
docs: mention Python 3.14 support in news file

4 weeks agoci: drop i686 binary packages
Daniele Varrazzo [Mon, 1 Sep 2025 09:31:24 +0000 (11:31 +0200)] 
ci: drop i686 binary packages

Not happy to drop them in a bugfix release, it seems possible to still
produce them with current cibuildwheel, but the documentation doesn't
make obvious how to restore them.

We will try to restore them if someone complains.

4 weeks agochore(pool): use coro test from inspect instead of asyncio
Daniele Varrazzo [Mon, 1 Sep 2025 09:23:59 +0000 (11:23 +0200)] 
chore(pool): use coro test from inspect instead of asyncio

The latter is deprecated in Python 3.14.

5 weeks agotest: fix pproxy compatibility with Python 3.14
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

5 weeks agoci: test with Python 3.14 non-dev
Daniele Varrazzo [Fri, 29 Aug 2025 18:11:05 +0000 (20:11 +0200)] 
ci: test with Python 3.14 non-dev

5 weeks agochore(test): drop use of asyncio event loop policy
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

5 weeks agoci(alpine): install missing libraris required to test and package wheels
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.

5 weeks agochore: bump cibuildwheel to 3.1.4
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.

5 weeks agochore: add Python 3.14 to supported version metadata and docs
Daniele Varrazzo [Tue, 29 Apr 2025 12:26:39 +0000 (14:26 +0200)] 
chore: add Python 3.14 to supported version metadata and docs

5 weeks agoci: add Python 3.14 dev to package build
Daniele Varrazzo [Tue, 29 Apr 2025 12:26:15 +0000 (14:26 +0200)] 
ci: add Python 3.14 dev to package build

5 weeks agoci: add Python 3.14 version to test grid
Daniele Varrazzo [Sun, 27 Apr 2025 21:47:15 +0000 (23:47 +0200)] 
ci: add Python 3.14 version to test grid

5 weeks agochore: bump Cython version
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).

6 weeks agotest: use current timezone name
Daniele Varrazzo [Tue, 19 Aug 2025 14:51:35 +0000 (16:51 +0200)] 
test: use current timezone name

2 months agoMerge branch 'fix-binary-version' into maint-3.2
Daniele Varrazzo [Wed, 23 Jul 2025 00:32:58 +0000 (02:32 +0200)] 
Merge branch 'fix-binary-version' into maint-3.2

2 months agofix(binary): fix __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.

2 months agotest: verify the version is sane
Daniele Varrazzo [Tue, 22 Jul 2025 00:33:22 +0000 (02:33 +0200)] 
test: verify the version is sane

2 months agochore: ignore mypy flag for unused ignore
Daniele Varrazzo [Tue, 22 Jul 2025 11:50:27 +0000 (13:50 +0200)] 
chore: ignore mypy flag for unused ignore

Flagged by mypy 1.17 on CI, but we need to stay on mypy 1.14 in the
maint 3.2 branch because of Python 3.8 compatibility.

2 months agoci: avoid running jobs on pull requests
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.

2 months agoMerge pull request #1119 from psycopg/fix-cancelled-error-shadowing
Daniele Varrazzo [Sat, 12 Jul 2025 04:38:39 +0000 (05:38 +0100)] 
Merge pull request #1119 from psycopg/fix-cancelled-error-shadowing

Avoid a TypeError shadowing CancelledError on task cancellation

2 months agofix(c): avoid a TypeError shadowing CancelledError on task cancellation 1119/head
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.

3 months agotest: fix failure in test_connection_warn_close
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.

3 months agofix: don't call str(self) or imported objects in __del__
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).

3 months agofix: change signature of SQL.join() to allow a sequence of Any
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.

3 months agochore: run isort before other hooks
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.

3 months agoMerge pull request #1115 from psycopg/fix-jsonb-function-caching
Daniele Varrazzo [Sat, 5 Jul 2025 17:02:11 +0000 (18:02 +0100)] 
Merge pull request #1115 from psycopg/fix-jsonb-function-caching

3 months agochore(json): adapt caching types definition to Python 3.8 1115/head
Daniele Varrazzo [Fri, 4 Jul 2025 23:24:11 +0000 (01:24 +0200)] 
chore(json): adapt caching types definition to Python 3.8

3 months agofix(json): don't leak when lambdas are used as dumps/loads function
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

3 months agofix: add missing interface for PGconn.protocol_version
Daniele Varrazzo [Sat, 5 Jul 2025 13:22:12 +0000 (15:22 +0200)] 
fix: add missing interface for PGconn.protocol_version

3 months agofix(test): work around error with issubclass(collections.ablc.Callable)
Daniele Varrazzo [Wed, 7 May 2025 10:43:23 +0000 (12:43 +0200)] 
fix(test): work around error with issubclass(collections.ablc.Callable)

Reproduced only on Python 3.10

4 months agoci: cancel concurrent binary build jobs
Daniele Varrazzo [Wed, 4 Jun 2025 15:40:29 +0000 (16:40 +0100)] 
ci: cancel concurrent binary build jobs

4 months agotest: skip tests connecting to non-existing dbs for CRDB
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.

4 months agotest: make sure tests don't hang if default connection points to a closed port
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.

4 months agochore: make code compatible with Mypy 1.14 and 1.16
Daniele Varrazzo [Mon, 2 Jun 2025 12:29:56 +0000 (13:29 +0100)] 
chore: make code compatible with Mypy 1.14 and 1.16

The master branch moved to a minimum 1.16, but Python 3.8 is only
supported up to Mypy < 1.15.

Therefore introduce an ignore[override] required in Mypy 1.16 but ignore
the complaint of Mypy 1.14.

4 months agochore: bump psycopg package version to 3.2.10.dev1
Daniele Varrazzo [Wed, 14 May 2025 15:20:22 +0000 (17:20 +0200)] 
chore: bump psycopg package version to 3.2.10.dev1

4 months agochore: bump psycopg package version to 3.2.9 3.2.9
Daniele Varrazzo [Tue, 13 May 2025 14:13:03 +0000 (16:13 +0200)] 
chore: bump psycopg package version to 3.2.9

4 months agoMerge branch 'fix-1088' into maint-3.2
Daniele Varrazzo [Tue, 13 May 2025 14:12:54 +0000 (16:12 +0200)] 
Merge branch 'fix-1088' into maint-3.2

4 months agodocs: mention fix in version 3.2.9
Daniele Varrazzo [Tue, 13 May 2025 14:07:47 +0000 (16:07 +0200)] 
docs: mention fix in version 3.2.9

4 months agoRevert "ci: install win32 libpq from conda force"
Daniele Varrazzo [Tue, 13 May 2025 12:55:17 +0000 (14:55 +0200)] 
Revert "ci: install win32 libpq from conda force"

This reverts commit ba4187d830a90f3e8edba10260d213079b7b5912.

Fix #1088

4 months agochore: bump psycopg package version to 3.2.9.dev1
Daniele Varrazzo [Sun, 11 May 2025 17:17:01 +0000 (19:17 +0200)] 
chore: bump psycopg package version to 3.2.9.dev1

4 months agochore: bump psycopg package version to 3.2.8 3.2.8
Daniele Varrazzo [Sun, 11 May 2025 11:35:06 +0000 (13:35 +0200)] 
chore: bump psycopg package version to 3.2.8

4 months agoci: make sure versions are strings, not floats
Daniele Varrazzo [Sun, 11 May 2025 10:45:56 +0000 (12:45 +0200)] 
ci: make sure versions are strings, not floats

4 months agochore: add funding link to project metadata
Daniele Varrazzo [Sat, 10 May 2025 19:58:27 +0000 (21:58 +0200)] 
chore: add funding link to project metadata

4 months agofix(c): fix building on 32 bit with libpq 18
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.

4 months agochore(binary): bump OpenSSL to 3.5.0
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.

4 months agochore(binary): bump libpq to 17.5 in binary packages
Daniele Varrazzo [Sat, 10 May 2025 13:30:00 +0000 (15:30 +0200)] 
chore(binary): bump libpq to 17.5 in binary packages

4 months agochore(deps): bump the actions group with 2 updates
dependabot[bot] [Thu, 1 May 2025 07:13:04 +0000 (07:13 +0000)] 
chore(deps): bump the actions group with 2 updates

Bumps the actions group with 2 updates: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) and [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi).

Updates `pypa/cibuildwheel` from 2.23.2 to 2.23.3
- [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.2...v2.23.3)

Updates `prefix-dev/setup-pixi` from 0.8.4 to 0.8.8
- [Release notes](https://github.com/prefix-dev/setup-pixi/releases)
- [Commits](https://github.com/prefix-dev/setup-pixi/compare/v0.8.4...v0.8.8)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: 2.23.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prefix-dev/setup-pixi
  dependency-version: 0.8.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months agoci: install win32 libpq from conda force
trim21 [Sun, 23 Feb 2025 09:25:45 +0000 (17:25 +0800)] 
ci: install win32 libpq from conda force

4 months agoMerge branch 'better-logging' into maint-3.2
Daniele Varrazzo [Sat, 10 May 2025 13:46:56 +0000 (15:46 +0200)] 
Merge branch 'better-logging' into maint-3.2

4 months agodocs: add section about connection logging
Daniele Varrazzo [Sat, 10 May 2025 02:55:45 +0000 (04:55 +0200)] 
docs: add section about connection logging

4 months agorefactor: more succinct expression for multiple attempts error
Daniele Varrazzo [Fri, 9 May 2025 01:14:16 +0000 (03:14 +0200)] 
refactor: more succinct expression for multiple attempts error

4 months agofeat: restore connection attempts logging
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.

4 months agoci: add Django LTS 5.2 3rd party integration test
Daniele Varrazzo [Sat, 10 May 2025 02:22:26 +0000 (04:22 +0200)] 
ci: add Django LTS 5.2 3rd party integration test

4 months agoci: fix 3rd party test after the pip django package went lowercase
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

4 months agoMerge pull request #1084 from psycopg/libpq-v18
Daniele Varrazzo [Fri, 9 May 2025 23:26:34 +0000 (00:26 +0100)] 
Merge pull request #1084 from psycopg/libpq-v18

Add support for libpq v18

4 months agoci: include PostgreSQL 18 libpq in tests 1084/head
Daniele Varrazzo [Fri, 9 May 2025 22:00:52 +0000 (00:00 +0200)] 
ci: include PostgreSQL 18 libpq in tests

4 months agofix: fix building with PostgreSQL v18 libpq
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

4 months agochore(tests): import module only locally as it won't be imported/used in C
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

4 months agochore: import module to avoid confusing mypy situations
Daniele Varrazzo [Fri, 9 May 2025 14:34:37 +0000 (16:34 +0200)] 
chore: import module to avoid confusing mypy situations

4 months agoMerge branch 'port-may-be-none' into maint-3.2
Daniele Varrazzo [Fri, 9 May 2025 13:10:57 +0000 (15:10 +0200)] 
Merge branch 'port-may-be-none' into maint-3.2

4 months agofix: avoid a blank "port=" in the repr() of object with connection
Daniele Varrazzo [Thu, 8 May 2025 20:47:50 +0000 (22:47 +0200)] 
fix: avoid a blank "port=" in the repr() of object with connection

4 months agofix: return the compiled port if PQport returns an empty string
Daniele Varrazzo [Thu, 8 May 2025 17:09:08 +0000 (19:09 +0200)] 
fix: return the compiled port if PQport returns an empty string

Looking at the docs this seems the default value when an empty string is
specified, as opposite as the value in the PGPORT env var. See
<https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-PORT>.

This change is an improvement on top of 40dfa0b, where we allowed PGport
to return NULL. This is likely a libpq bug (reported in
<https://www.postgresql.org/message-id/CA%2Bmi_8YTS8WPZPO0PAb2aaGLwHuQ0DEQRF0ZMnvWss4y9FwDYQ%40mail.gmail.com>)
but now it's in the wild so we better support it rather than dying of
assert or by int()'ing an empty string.

4 months agoMerge branch 'row-maker-none' into maint-3.2
Daniele Varrazzo [Fri, 9 May 2025 13:07:48 +0000 (15:07 +0200)] 
Merge branch 'row-maker-none' into maint-3.2

4 months agotest: actually test server cursors when row makers return None
Daniele Varrazzo [Fri, 9 May 2025 11:10:46 +0000 (13:10 +0200)] 
test: actually test server cursors when row makers return None

4 months agodocs: add release notes entry about row maker returning none fixed
Martin Baláž [Thu, 8 May 2025 00:03:01 +0000 (02:03 +0200)] 
docs: add release notes entry about row maker returning none fixed

4 months agotest: test behaviour of cursors with a row maker returning None
Martin Baláž [Wed, 7 May 2025 20:10:06 +0000 (22:10 +0200)] 
test: test behaviour of cursors with a row maker returning None

4 months agofix: fix loading of rows when row maker returns None
Martin Baláž [Wed, 7 May 2025 15:25:13 +0000 (17:25 +0200)] 
fix: fix loading of rows when row maker returns None

Close #1073

4 months agofix(c): don't use Cython 3.1 or following to build the extension
Daniele Varrazzo [Thu, 8 May 2025 23:47:26 +0000 (01:47 +0200)] 
fix(c): don't use Cython 3.1 or following to build the extension

The resulting module seems affected by a memory leak.

https://github.com/cython/cython/issues/6850

4 months agofix: improve error message trying to fetch from a no recordset result
Daniele Varrazzo [Fri, 2 May 2025 22:18:10 +0000 (00:18 +0200)] 
fix: improve error message trying to fetch from a no recordset result

Print the last command status with the error. For example:

    the last operation didn't produce records (command status: NOTIFY)

or, if the result doesn't even have a command status:

    the last operation didn't produce records (result status: EMPTY_QUERY)

4 months agoMerge branch 'dev/danielfrankcom/show-all-connection-errors' into maint-3.2
Daniele Varrazzo [Thu, 8 May 2025 05:13:09 +0000 (07:13 +0200)] 
Merge branch 'dev/danielfrankcom/show-all-connection-errors' into maint-3.2

4 months agofix: show all connection errors on attempt failure
Daniel Frankcom [Wed, 7 May 2025 23:20:43 +0000 (16:20 -0700)] 
fix: show all connection errors on attempt failure

4 months agoMerge branch 'no-attempts-after-ctrl-c' into maint-3.2
Daniele Varrazzo [Wed, 7 May 2025 23:14:39 +0000 (01:14 +0200)] 
Merge branch 'no-attempts-after-ctrl-c' into maint-3.2

4 months agofix: don't process further attempt if ctrl-c is pressed during connection
Daniele Varrazzo [Wed, 7 May 2025 21:39:20 +0000 (23:39 +0200)] 
fix: don't process further attempt if ctrl-c is pressed during connection

See for example #1055 where this behaviour is reported, #1076 where it
is further discussed.

4 months agofix: remove assert calling informative libpq function
Daniele Varrazzo [Wed, 7 May 2025 21:40:23 +0000 (23:40 +0200)] 
fix: remove assert calling informative libpq function

At least calling PQport on a connection with multiple attempts ends up
returning a NULL instead of an empty string (libpq from Postgres 17.4).

4 months agoMerge pull request #1072 from psycopg/fix-1071
Daniele Varrazzo [Wed, 7 May 2025 15:32:26 +0000 (16:32 +0100)] 
Merge pull request #1072 from psycopg/fix-1071

Fix interval parsing with day/month/year and negative time