]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
8 months agodocs: further wordsmith around IS/DISTINCT 940/head
Daniele Varrazzo [Wed, 30 Oct 2024 14:44:29 +0000 (15:44 +0100)] 
docs: further wordsmith around IS/DISTINCT

Also restore lost link reference.

8 months agodocs: explicit wording to clarify correspondence between `IS NOT DISTINCT FROM` ...
0xTiger [Fri, 25 Oct 2024 17:50:11 +0000 (18:50 +0100)] 
docs: explicit wording to clarify correspondence between `IS NOT DISTINCT FROM` & `IS`

8 months agochore: ignore type error reported by mypy 1.12, 1.13
Daniele Varrazzo [Wed, 30 Oct 2024 13:26:34 +0000 (14:26 +0100)] 
chore: ignore type error reported by mypy 1.12, 1.13

If a generator returns None, the StopIteration.args tuple is empty. The
fact we explicitly checks for it and in that case we return none looks
now an error for Mypy.

I don't see an obvious way around it.

Maybe related to https://github.com/python/mypy/issues/1933 which is an
historical issue (opened in 2016).

Reported in https://github.com/python/mypy/issues/18073

8 months agotest: avoid peer authentication in password change test
Daniele Varrazzo [Wed, 30 Oct 2024 13:12:09 +0000 (14:12 +0100)] 
test: avoid peer authentication in password change test

9 months agodocs: document the version when TransactionTimeout was added
Daniele Varrazzo [Fri, 11 Oct 2024 00:29:30 +0000 (02:29 +0200)] 
docs: document the version when TransactionTimeout was added

9 months agotest: mark more tests as 'timing'
Augustin Trancart [Thu, 26 Sep 2024 08:32:26 +0000 (10:32 +0200)] 
test: mark more tests as 'timing'

When the machine is under load, any tests relying on a timeout or a sleep is
subject to fail. Let's mark some of them as 'timing'.

9 months agochore: bump psycopg package version to 3.2.4.dev1
Daniele Varrazzo [Sun, 29 Sep 2024 21:22:20 +0000 (23:22 +0200)] 
chore: bump psycopg package version to 3.2.4.dev1

9 months agochore: bump psycopg package version to 3.2.3 3.2.3
Daniele Varrazzo [Sun, 29 Sep 2024 15:54:40 +0000 (17:54 +0200)] 
chore: bump psycopg package version to 3.2.3

9 months agoMerge pull request #917 from psycopg/pg17
Daniele Varrazzo [Sun, 29 Sep 2024 15:42:09 +0000 (17:42 +0200)] 
Merge pull request #917 from psycopg/pg17

Create binary packages with PostgreSQL 17 libpq

9 months agodocs: mention PostgreSQL 17 in binary packages in the news file 917/head
Daniele Varrazzo [Sun, 29 Sep 2024 15:38:56 +0000 (17:38 +0200)] 
docs: mention PostgreSQL 17 in binary packages in the news file

9 months agoci: install flex to build libpq
Daniele Varrazzo [Sat, 28 Sep 2024 22:43:29 +0000 (00:43 +0200)] 
ci: install flex to build libpq

Required from PostgreSQL 17

9 months agoci(macos): fix dylib path for postgres 17 from brew
Daniele Varrazzo [Sat, 28 Sep 2024 16:50:23 +0000 (18:50 +0200)] 
ci(macos): fix dylib path for postgres 17 from brew

Libraries are now installed under `lib/postgresql/` under the brew
package directory instead of just `lib`.

9 months agoci(macos): update brew to install PostgreSQL 17
Daniele Varrazzo [Sat, 28 Sep 2024 12:40:47 +0000 (14:40 +0200)] 
ci(macos): update brew to install PostgreSQL 17

At the moment CI failed with:

    No available formula with the name "postgresql@17". Did you mean
    postgresql@16, postgresql@15, postgresql@14, postgresql@13,
    postgresql@12, postgresql@11 or postgresql@10?

But the formula appears available at https://formulae.brew.sh/formula/postgresql@17

So probably it's a problem that will disappear in a few days.

9 months agoci: bump to PostgreSQL 17 in binary packages
Daniele Varrazzo [Sat, 28 Sep 2024 11:20:54 +0000 (13:20 +0200)] 
ci: bump to PostgreSQL 17 in binary packages

It is not possible at the moment to Upgrade OpenSSL to 3.3.2 because of
https://github.com/openssl/openssl/issues/25366

Close #852

9 months agochore: add PostgreSQL 17 TRANSACTION_TIMEOUT error
Daniele Varrazzo [Sat, 28 Sep 2024 11:22:54 +0000 (13:22 +0200)] 
chore: add PostgreSQL 17 TRANSACTION_TIMEOUT error

9 months agoci: Add PostgreSQL 17 to CI test grid, remove PostgreSQL 11
Daniele Varrazzo [Sat, 28 Sep 2024 11:51:16 +0000 (13:51 +0200)] 
ci: Add PostgreSQL 17 to CI test grid, remove PostgreSQL 11

9 months agofix(windows): resolve absolute path to libpq
Alessandro Della Villa [Sat, 28 Sep 2024 14:12:40 +0000 (16:12 +0200)] 
fix(windows): resolve absolute path to libpq

Might solve the problem mentioned in the comments in #912.

9 months agotest(crdb): fix or skip tests that now run because libpq 17 is available
Daniele Varrazzo [Sat, 28 Sep 2024 16:01:22 +0000 (18:01 +0200)] 
test(crdb): fix or skip tests that now run because libpq 17 is available

9 months agotest: fix compatibility of tests with Python 3.8
Daniele Varrazzo [Sat, 28 Sep 2024 11:52:57 +0000 (13:52 +0200)] 
test: fix compatibility of tests with Python 3.8

Avoid using the |= operator on dictionaries, which is unsupported on
Python 3.8.

The test started mysteriously to fail... Turned out that it hadn't run
so far on Python 3.8 because the "latest" libpq was v16, but when it
switched to v17 it started to be executed.

9 months agofix: fix typo in PGRES_PIPELINE_ABORTED enum
Daniele Varrazzo [Sat, 28 Sep 2024 11:32:12 +0000 (13:32 +0200)] 
fix: fix typo in PGRES_PIPELINE_ABORTED enum

Only in Cython and not explicitly used. Python had the right name already.

9 months agochore: test readme cleanup
Daniele Varrazzo [Sat, 28 Sep 2024 11:16:10 +0000 (13:16 +0200)] 
chore: test readme cleanup

9 months agodocs(install): reorganise install page disclaimer
Daniele Varrazzo [Sat, 21 Sep 2024 20:16:15 +0000 (22:16 +0200)] 
docs(install): reorganise install page disclaimer

Show first the happy path and a GOTO usage, then all the possible
reasons why you are unhappy.

(I just learned that this is referred to as the Anna Karenina
principle).

9 months agodocs: polish grammar in the install disclaimer
Daniele Varrazzo [Sat, 21 Sep 2024 20:11:10 +0000 (22:11 +0200)] 
docs: polish grammar in the install disclaimer

9 months agodoc: explain better that binary packages are on a best-effort basis
Daniele Varrazzo [Sat, 21 Sep 2024 18:29:58 +0000 (20:29 +0200)] 
doc: explain better that binary packages are on a best-effort basis

Close #912.

9 months agochore: bump psycopg package version to 3.2.3.dev1
Daniele Varrazzo [Sat, 21 Sep 2024 17:14:45 +0000 (19:14 +0200)] 
chore: bump psycopg package version to 3.2.3.dev1

9 months agoci: fix SQLAlchemy 3rd party test
Daniele Varrazzo [Sun, 15 Sep 2024 17:14:46 +0000 (19:14 +0200)] 
ci: fix SQLAlchemy 3rd party test

Something changed upstream? The package is not found in SQLAlchemy case,
needs sqlalchemy.

9 months agochore: bump psycopg package version to 3.2.2 3.2.2
Daniele Varrazzo [Sun, 15 Sep 2024 11:40:47 +0000 (13:40 +0200)] 
chore: bump psycopg package version to 3.2.2

9 months agoMerge pull request #890 from edgarrmondragon/build-cp313-wheels
Daniele Varrazzo [Sun, 15 Sep 2024 11:39:18 +0000 (13:39 +0200)] 
Merge pull request #890 from edgarrmondragon/build-cp313-wheels

Build Python 3.13 wheels

9 months agodocs: add update instructions for new major Python releases 890/head
Edgar Ramírez-Mondragón [Thu, 15 Aug 2024 00:21:18 +0000 (18:21 -0600)] 
docs: add update instructions for new major Python releases

9 months agodocs: add Python 3.13 support news entries
Edgar Ramírez-Mondragón [Thu, 15 Aug 2024 00:13:43 +0000 (18:13 -0600)] 
docs: add Python 3.13 support news entries

9 months agodocs: mention Python 3.13 supported in install docs
Edgar Ramírez-Mondragón [Thu, 15 Aug 2024 00:11:38 +0000 (18:11 -0600)] 
docs: mention Python 3.13 supported in install docs

9 months agochore: add Python 3.13 to trove classifiers
Edgar Ramírez-Mondragón [Thu, 15 Aug 2024 00:11:11 +0000 (18:11 -0600)] 
chore: add Python 3.13 to trove classifiers

9 months agoci: build Python 3.13 wheels
Edgar Ramírez-Mondragón [Thu, 8 Aug 2024 17:44:37 +0000 (11:44 -0600)] 
ci: build Python 3.13 wheels

Related: https://github.com/psycopg/psycopg/issues/889

9 months agodocs: replace fastapi events with lifespan
Vinz [Sat, 14 Sep 2024 13:31:04 +0000 (15:31 +0200)] 
docs: replace fastapi events with lifespan

10 months agochore(deps): bump pypa/cibuildwheel in the actions group
dependabot[bot] [Sun, 1 Sep 2024 07:59:50 +0000 (07:59 +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.19.2 to 2.20.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.19.2...v2.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
10 months agoFix typo in cursor table
Nils K [Sun, 25 Aug 2024 10:59:16 +0000 (12:59 +0200)] 
Fix typo in cursor table

10 months agodocs: fix typo in Basic module usage
Artemy Vakhrushev [Mon, 19 Aug 2024 13:59:12 +0000 (18:59 +0500)] 
docs: fix typo in Basic module usage

11 months agochore: drop debug logging in pq import attempts
Daniele Varrazzo [Thu, 8 Aug 2024 11:59:02 +0000 (13:59 +0200)] 
chore: drop debug logging in pq import attempts

It confuses people who enable logging too broadly. See #807.

11 months agochore(deps): bump pypa/cibuildwheel in the actions group
dependabot[bot] [Thu, 1 Aug 2024 07:26:42 +0000 (07:26 +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.19.1 to 2.19.2
- [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.19.1...v2.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
11 months agorefactor(c): avoid violating strict aliasing rule in interval binary loader 879/head
Daniele Varrazzo [Thu, 25 Jul 2024 09:57:02 +0000 (11:57 +0200)] 
refactor(c): avoid violating strict aliasing rule in interval binary loader

See conversation in #877

11 months agoMerge pull request #877 from psycopg/fix-warnings
Daniele Varrazzo [Wed, 24 Jul 2024 19:56:12 +0000 (21:56 +0200)] 
Merge pull request #877 from psycopg/fix-warnings

Fix warnings

11 months agorefactor(c): more idiomatic type-punned pointer warning workaround 877/head
Daniele Varrazzo [Wed, 24 Jul 2024 08:37:30 +0000 (10:37 +0200)] 
refactor(c): more idiomatic type-punned pointer warning workaround

We are using memcpy in all the other cases.

11 months agochore(c): drop warnings related to breaking strict-aliasing rules
Daniele Varrazzo [Wed, 24 Jul 2024 08:32:32 +0000 (10:32 +0200)] 
chore(c): drop warnings related to breaking strict-aliasing rules

11 months agochore(c): drop warnings related to discarding const qualifiers
Daniele Varrazzo [Wed, 24 Jul 2024 08:31:00 +0000 (10:31 +0200)] 
chore(c): drop warnings related to discarding const qualifiers

11 months agochore(c): declare notice_receiver as not raising exceptions
Daniele Varrazzo [Wed, 24 Jul 2024 08:29:06 +0000 (10:29 +0200)] 
chore(c): declare notice_receiver as not raising exceptions

The function indeed doesn't raise exceptions, as the possible one is
handled internally. Avoid a Cython compiler warning.

11 months agoci: add test on strict aliasing warnings
Daniele Varrazzo [Wed, 24 Jul 2024 08:44:46 +0000 (10:44 +0200)] 
ci: add test on strict aliasing warnings

11 months agochore: bump typing-extension version
Daniele Varrazzo [Wed, 24 Jul 2024 09:52:46 +0000 (11:52 +0200)] 
chore: bump typing-extension version

Previously requested 4.4 is not compatible with the now requested mypy
version 1.11

11 months agochore: bump mypy
Daniele Varrazzo [Wed, 24 Jul 2024 09:10:10 +0000 (11:10 +0200)] 
chore: bump mypy

12 months agodocs: reword to remove a typo
Daniele Varrazzo [Tue, 9 Jul 2024 20:36:32 +0000 (22:36 +0200)] 
docs: reword to remove a typo

12 months agodocs: document drop of support for macOS < 14 arm64 packages
Daniele Varrazzo [Tue, 9 Jul 2024 12:12:11 +0000 (14:12 +0200)] 
docs: document drop of support for macOS < 14 arm64 packages

See ticket #858.

12 months agodocs: fix sentence in async notification docs
Daniele Varrazzo [Tue, 9 Jul 2024 11:39:43 +0000 (13:39 +0200)] 
docs: fix sentence in async notification docs

12 months agodocs(sql): fix Composite/Composed imprecision
Daniele Varrazzo [Wed, 3 Jul 2024 12:57:33 +0000 (14:57 +0200)] 
docs(sql): fix Composite/Composed imprecision

Close #862.

12 months agoMerge pull request #774 from dlax/doc-libpq-cancelconn
Daniele Varrazzo [Tue, 2 Jul 2024 09:13:51 +0000 (11:13 +0200)] 
Merge pull request #774 from dlax/doc-libpq-cancelconn

document libpq 17 features

12 months agodocs: document PGconn.change_password() 774/head
Denis Laxalde [Mon, 1 Jul 2024 06:28:15 +0000 (08:28 +0200)] 
docs: document PGconn.change_password()

12 months agodocs: document libpq 17 cancellation API
Denis Laxalde [Tue, 2 Apr 2024 09:41:42 +0000 (11:41 +0200)] 
docs: document libpq 17 cancellation API

12 months agodocs: set libpq version to '17'
Denis Laxalde [Mon, 1 Jul 2024 06:21:42 +0000 (08:21 +0200)] 
docs: set libpq version to '17'

Branch REL_17_STABLE is now available in Postgres repository.

Using this version is needed to build the documentation with the next
commit.

12 months agofix: drop string TypeAlias definitions from public modules
Daniele Varrazzo [Mon, 1 Jul 2024 22:10:54 +0000 (00:10 +0200)] 
fix: drop string TypeAlias definitions from public modules

The definition of the aliases as strings breaks composition with other
types. For instance `DictRow | tuple` is not valid. We could ask people
to use strings on their own, but this is a regression anyway.

In this changesets only the types reasonably exposed to the public are
fixed. Others are internal and I don't think would affect anyone (or, at
least, we can ditch the blame and put it on the user...) Modules
considered to clean from string typedefs are:

- psycopg
- psycopg.abc
- psycopg.pq
- psycopg.pq.abc
- psycopg.rows
- psycopg_pool
- psycopg_pool.abc

Close #860.

12 months agofix(bump_version): take requirement suffix into account
Daniele Varrazzo [Tue, 2 Jul 2024 09:03:35 +0000 (11:03 +0200)] 
fix(bump_version): take requirement suffix into account

It caused #853 and made so that version 3.2.0 had a lifetime shorter
than a fruit fly.

12 months agochore: bump psycopg package version to 3.2.2.dev1
Daniele Varrazzo [Tue, 2 Jul 2024 09:03:11 +0000 (11:03 +0200)] 
chore: bump psycopg package version to 3.2.2.dev1

12 months agochore: make typing-extension conditional to Pyton < 3.13
Daniele Varrazzo [Mon, 1 Jul 2024 21:50:56 +0000 (23:50 +0200)] 
chore: make typing-extension conditional to Pyton < 3.13

12 months agochore: bump psycopg package version to 3.2.1 3.2.1
Daniele Varrazzo [Mon, 1 Jul 2024 02:45:15 +0000 (04:45 +0200)] 
chore: bump psycopg package version to 3.2.1

12 months agofix: fix versions in packaging metadata
Daniele Varrazzo [Mon, 1 Jul 2024 02:40:17 +0000 (04:40 +0200)] 
fix: fix versions in packaging metadata

Close #853.

12 months agodocs: fix title level of major releases
Daniele Varrazzo [Mon, 1 Jul 2024 02:15:58 +0000 (04:15 +0200)] 
docs: fix title level of major releases

12 months agodocs: mention dropping Python 3.7 in psycopg 3.2 release
Daniele Varrazzo [Sun, 30 Jun 2024 23:13:10 +0000 (01:13 +0200)] 
docs: mention dropping Python 3.7 in psycopg 3.2 release

12 months agodocs: better organization of the 3.2 release notes
Daniele Varrazzo [Sun, 30 Jun 2024 17:57:35 +0000 (19:57 +0200)] 
docs: better organization of the 3.2 release notes

12 months agochore: bump psycopg package version to 3.2.0 3.2.0
Daniele Varrazzo [Sat, 29 Jun 2024 18:35:40 +0000 (20:35 +0200)] 
chore: bump psycopg package version to 3.2.0

12 months agochore: bump psycopg package version to 3.1.20
Daniele Varrazzo [Sat, 29 Jun 2024 18:20:26 +0000 (20:20 +0200)] 
chore: bump psycopg package version to 3.1.20

12 months agoMerge pull request #846 from eli-schwartz/tomllib
Daniele Varrazzo [Fri, 28 Jun 2024 16:37:51 +0000 (18:37 +0200)] 
Merge pull request #846 from eli-schwartz/tomllib

build: avoid installing tomli on recent python

12 months agostyle: shorter line in pyproject.toml 846/head
Daniele Varrazzo [Fri, 28 Jun 2024 16:35:26 +0000 (17:35 +0100)] 
style: shorter line in pyproject.toml

12 months agobuild: avoid installing tomli on recent python
Eli Schwartz [Wed, 26 Jun 2024 03:22:17 +0000 (23:22 -0400)] 
build: avoid installing tomli on recent python

It is in the stdlib. No need to have wheel building require downloading
yet another build dependency.

12 months agofix: avoid to dump [multi]range as text when binary is requested
Daniele Varrazzo [Sun, 23 Jun 2024 23:53:26 +0000 (01:53 +0200)] 
fix: avoid to dump [multi]range as text when binary is requested

If a range has no type information (e.g. is empty and it is a base
class, not a specific range subtype), `upgrade()` would have returned a
text dumper. This would have resulted in protocol violation, such as
requesting unhealthy amount of memory to the backend... and it was
tested too!

Restoring sanity has a drawback. If we have an array of ranges, none of
which has type information, we now fail binary dumping. Previously this
worked, provided that a cast `::int8range[]` was provided, but I think
with an extreme stretch of the protocol: we were producing binary arrays
containing text representation of the ranges.

I don't think the latter is quite valid. So I have a preference for
dropping the feature in exchange of not violating the protocol. We trade
a better dumping of the basic type (an xfail less there) in exchange of
losing the ability of dumping an array of ranges, all empty, using a
cast, in binary format. Binary dump works using a subclass such as
`Int8Range` instead of `Range`.

The lost use case is so marginal that I don't feel the need to document
it. We don't even have documentation for the `Range` subclasses.

12 months agoMerge pull request #847 from psycopg/update-libs
Daniele Varrazzo [Fri, 28 Jun 2024 16:06:01 +0000 (18:06 +0200)] 
Merge pull request #847 from psycopg/update-libs

Update openssl to 3.3.1

12 months agodocs: add release note about OpenSSL 3.3.x 847/head
Daniele Varrazzo [Wed, 26 Jun 2024 13:35:19 +0000 (15:35 +0200)] 
docs: add release note about OpenSSL 3.3.x

12 months agochore: bump ldap version to 2.6.8
Daniele Varrazzo [Sun, 23 Jun 2024 21:46:43 +0000 (23:46 +0200)] 
chore: bump ldap version to 2.6.8

12 months agochore: bump openssl to 3.3.1
Daniele Varrazzo [Sun, 23 Jun 2024 21:45:51 +0000 (23:45 +0200)] 
chore: bump openssl to 3.3.1

Drop fallback version in build_libpq.sh script. It was useful to save
some typing in development but now it is confusing to have two versions.

12 months agoci: more robust libpq build script
Daniele Varrazzo [Sun, 23 Jun 2024 21:46:24 +0000 (23:46 +0200)] 
ci: more robust libpq build script

12 months agotest: add missing fixture to multirange test
Daniele Varrazzo [Tue, 25 Jun 2024 05:56:18 +0000 (07:56 +0200)] 
test: add missing fixture to multirange test

12 months agoMerge branch 'ci-binary-build-fix'
Daniele Varrazzo [Mon, 24 Jun 2024 09:34:35 +0000 (11:34 +0200)] 
Merge branch 'ci-binary-build-fix'

12 months agoci: set macOS deployment target env vars
Daniele Varrazzo [Sun, 23 Jun 2024 21:00:23 +0000 (23:00 +0200)] 
ci: set macOS deployment target env vars

Seems required moving from cibuildwheel 2.16.5 to maybe 2.18.1.

12 months agochore: bump libpq to 16.3
Daniele Varrazzo [Sun, 23 Jun 2024 20:44:52 +0000 (22:44 +0200)] 
chore: bump libpq to 16.3

Mostly with the intent to zap the cache.

12 months agoci: add openssl-dev dependency to build musllinux packages
Daniele Varrazzo [Sun, 23 Jun 2024 20:39:00 +0000 (22:39 +0200)] 
ci: add openssl-dev dependency to build musllinux packages

12 months agochore: bump cibuildwheel version
Daniele Varrazzo [Sun, 23 Jun 2024 14:03:02 +0000 (16:03 +0200)] 
chore: bump cibuildwheel version

12 months agotest: use numpy 1.18 for real in minimal versions tests
Daniele Varrazzo [Sun, 23 Jun 2024 20:51:13 +0000 (22:51 +0200)] 
test: use numpy 1.18 for real in minimal versions tests

12 months agoMerge pull request #839 from psycopg/raw-server-cursors
Daniele Varrazzo [Sun, 23 Jun 2024 14:04:48 +0000 (16:04 +0200)] 
Merge pull request #839 from psycopg/raw-server-cursors

Add RawServerCursor class

12 months agofeat: add RawServerCursor class 839/head
Daniele Varrazzo [Mon, 18 Dec 2023 01:43:18 +0000 (02:43 +0100)] 
feat: add RawServerCursor class

12 months agofix: fix compatibility with numpy 2.0
Daniele Varrazzo [Sun, 23 Jun 2024 11:12:34 +0000 (13:12 +0200)] 
fix: fix compatibility with numpy 2.0

The only meaningful code change is with the bool class, whose type name
changed from `numpy.bool_` to `numpy.bool`. Note that using `bool`
causes a FutureWarning on import for numpy > 1.20, therefore we avoid
testing it (we still successfully test the `bool_` alias).

Other changes are related to tests: certain constant aliases are no more
available, so we skip those tests conditionally to numpy version.

Pin a minimum numpy version, to make sure we test also a numpy v1.
Picking 1.18,  released back in Dec 2019, as it's the first minor
version offering binary packages for Python 3.8. This min dependency will
need to be updated when dropping Python 3.8 support.

12 months agodocs(rows): add examples showing the rows returned by basic factories
Daniele Varrazzo [Sun, 23 Jun 2024 09:55:57 +0000 (11:55 +0200)] 
docs(rows): add examples showing the rows returned by basic factories

12 months agoMerge pull request #835 from psycopg/capabilities-has-closed-prepared
Daniele Varrazzo [Mon, 17 Jun 2024 15:04:05 +0000 (17:04 +0200)] 
Merge pull request #835 from psycopg/capabilities-has-closed-prepared

feat(capabilities): add has_send_close_prepared()

12 months agochore(capability): drop has_pgbouncer_prepared() 835/head
Daniele Varrazzo [Thu, 13 Jun 2024 21:09:20 +0000 (23:09 +0200)] 
chore(capability): drop has_pgbouncer_prepared()

Document to use the `has_send_closed_prepared()` capability instead,
which is a necessary condition for PgBouncer support, and doesn't give
the impression to be sufficient.

12 months agofeat(capabilities): add has_send_close_prepared()
Daniele Varrazzo [Mon, 10 Jun 2024 14:40:27 +0000 (16:40 +0200)] 
feat(capabilities): add has_send_close_prepared()

12 months agoMerge pull request #760 from psycopg/blocking-notifies
Daniele Varrazzo [Thu, 13 Jun 2024 21:03:27 +0000 (23:03 +0200)] 
Merge pull request #760 from psycopg/blocking-notifies

12 months agofix: lock the connection during a 'notifies()' call 760/head
Daniele Varrazzo [Mon, 1 Apr 2024 23:18:50 +0000 (23:18 +0000)] 
fix: lock the connection during a 'notifies()' call

With the previous implementation, it was possible to sneak an execute()
while the generator is consumed. This gives the false impression that
it's possible to use the connection while listening (see #756), which is
false for reason better explored in #757.

Therefore, lock the connection while listening to notifications. If
someone wants to mix commands with listening on the same connection,
they should do it collaboratively with an adequately short notifies()
timeout.

12 months agochore: drop pq enums aliases on connection and cursor
Daniele Varrazzo [Mon, 10 Jun 2024 14:50:43 +0000 (16:50 +0200)] 
chore: drop pq enums aliases on connection and cursor

Unused in the codebase, and not documented. Only used in the test suite.

12 months agoMerge pull request #794 from dlax/cursor-stream-chunks
Daniele Varrazzo [Thu, 13 Jun 2024 14:06:23 +0000 (16:06 +0200)] 
Merge pull request #794 from dlax/cursor-stream-chunks

12 months agofeat: add a size parameter to Cursor.stream() 794/head
Denis Laxalde [Wed, 17 Apr 2024 09:38:43 +0000 (11:38 +0200)] 
feat: add a size parameter to Cursor.stream()

This triggers results retrieval by chunks from the server, if > 1,
leveraging the "chunked rows mode" from libpq 17.

A new has_stream_chunked() capability is added.

12 months agoMerge pull request #834 from psycopg/cancel-conn-encoding
Daniele Varrazzo [Thu, 13 Jun 2024 14:04:49 +0000 (16:04 +0200)] 
Merge pull request #834 from psycopg/cancel-conn-encoding

12 months agofix: typo 834/head
Daniele Varrazzo [Thu, 13 Jun 2024 09:09:44 +0000 (10:09 +0100)] 
fix: typo

Co-authored-by: Denis Laxalde <denis.laxalde@dalibo.com>
12 months agofeat: add get_error_message() methods
Daniele Varrazzo [Wed, 12 Jun 2024 10:38:04 +0000 (12:38 +0200)] 
feat: add get_error_message() methods

The method is available on PGconn, PGconnCancel, PGresult.

The generic function error_message() is retained only because it was
documented so we don't want to drop it. Internally only the
get_error_message() method is used.

12 months agorefactor: make PGcancelConn.error_message return bytes
Daniele Varrazzo [Mon, 10 Jun 2024 15:42:17 +0000 (17:42 +0200)] 
refactor: make PGcancelConn.error_message return bytes

This is more consistent with PGconn and PGresult.

There doesn't seem to be the need of extending pq.misc.error_message as
we never pass it a PGcancelConn object.

Close #781

12 months agofix: fix PQclosePortal not supported error message
Daniele Varrazzo [Wed, 12 Jun 2024 17:02:58 +0000 (19:02 +0200)] 
fix: fix PQclosePortal not supported error message