]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
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

12 months agorefactor(tests/crdb): generate sync from async
Daniele Varrazzo [Mon, 10 Jun 2024 14:24:21 +0000 (16:24 +0200)] 
refactor(tests/crdb): generate sync from async

13 months agoMerge branch 'pyupgrade'
Daniele Varrazzo [Tue, 4 Jun 2024 19:05:43 +0000 (21:05 +0200)] 
Merge branch 'pyupgrade'

13 months agorefactor: remove more types as strings
Denis Laxalde [Tue, 4 Jun 2024 07:39:14 +0000 (09:39 +0200)] 
refactor: remove more types as strings

I.e. all those suggested by pyupgrade --py38-plus.

13 months agorefactor: use set literals
Denis Laxalde [Tue, 4 Jun 2024 07:40:30 +0000 (09:40 +0200)] 
refactor: use set literals

As suggested by pyupgrade --py38-plus.

13 months agochore: upgrade usage lru_cache decorator for Python 3.8+
Denis Laxalde [Tue, 4 Jun 2024 07:33:34 +0000 (09:33 +0200)] 
chore: upgrade usage lru_cache decorator for Python 3.8+

13 months agoMerge pull request #832 from psycopg/uniform-annotations
Daniele Varrazzo [Tue, 4 Jun 2024 19:03:28 +0000 (21:03 +0200)] 
Merge pull request #832 from psycopg/uniform-annotations

Upgrade annotation syntax to Python 3.8

13 months agofix: fix type annotation for Python 3.8 832/head
Daniele Varrazzo [Thu, 30 May 2024 03:28:59 +0000 (05:28 +0200)] 
fix: fix type annotation for Python 3.8

13 months agorefactor: avoid using types as strings where possible
Daniele Varrazzo [Thu, 30 May 2024 02:14:17 +0000 (04:14 +0200)] 
refactor: avoid using types as strings where possible

13 months agochore: drop unused import
Daniele Varrazzo [Thu, 30 May 2024 01:36:33 +0000 (03:36 +0200)] 
chore: drop unused import

13 months agorefactor: drop use of typing.Set
Daniele Varrazzo [Thu, 30 May 2024 01:35:10 +0000 (03:35 +0200)] 
refactor: drop use of typing.Set

13 months agorefactor: drop use of typing.Tuple
Daniele Varrazzo [Thu, 30 May 2024 01:34:17 +0000 (03:34 +0200)] 
refactor: drop use of typing.Tuple

13 months agorefactor: drop use of typing.Type
Daniele Varrazzo [Thu, 30 May 2024 01:23:56 +0000 (03:23 +0200)] 
refactor: drop use of typing.Type

13 months agorefactor: drop use of typing.Dict
Daniele Varrazzo [Thu, 30 May 2024 01:14:03 +0000 (03:14 +0200)] 
refactor: drop use of typing.Dict

13 months agorefactor: drop use of typing.List
Daniele Varrazzo [Thu, 30 May 2024 01:03:57 +0000 (03:03 +0200)] 
refactor: drop use of typing.List

13 months agorefactor: drop use of typing.Union
Daniele Varrazzo [Thu, 30 May 2024 00:40:30 +0000 (02:40 +0200)] 
refactor: drop use of typing.Union

13 months agorefactor: drop use of typing.Optional
Daniele Varrazzo [Wed, 29 May 2024 23:58:04 +0000 (01:58 +0200)] 
refactor: drop use of typing.Optional

13 months agochore: drop vim syntax marker for interface files
Daniele Varrazzo [Thu, 30 May 2024 00:03:44 +0000 (02:03 +0200)] 
chore: drop vim syntax marker for interface files

13 months agoMerge pull request #642 from psycopg/none-returning-dumper
Daniele Varrazzo [Mon, 3 Jun 2024 16:43:28 +0000 (18:43 +0200)] 
Merge pull request #642 from psycopg/none-returning-dumper

Allow dumpers to return None

13 months agodocs: add documentation about none-returning dumpers 642/head
Daniele Varrazzo [Sat, 1 Jun 2024 11:06:38 +0000 (13:06 +0200)] 
docs: add documentation about none-returning dumpers

13 months agodocs: add news entry about none support in dumpers
Daniele Varrazzo [Wed, 4 Jan 2023 16:06:35 +0000 (16:06 +0000)] 
docs: add news entry about none support in dumpers

13 months agofix(c): allow dumpers to return none in copy
Daniele Varrazzo [Wed, 29 May 2024 19:43:09 +0000 (21:43 +0200)] 
fix(c): allow dumpers to return none in copy

13 months agotest: verify that dumpers returning None are used correctly in copy
Daniele Varrazzo [Mon, 19 Sep 2022 10:47:23 +0000 (11:47 +0100)] 
test: verify that dumpers returning None are used correctly in copy

13 months agofix: manage dumpers returning None in nested dumpers
Daniele Varrazzo [Mon, 19 Sep 2022 01:20:38 +0000 (02:20 +0100)] 
fix: manage dumpers returning None in nested dumpers

13 months agotest: verify that dumpers returning None are used correctly in queries
Daniele Varrazzo [Mon, 19 Sep 2022 00:54:44 +0000 (01:54 +0100)] 
test: verify that dumpers returning None are used correctly in queries

13 months agofix: annotate every dumper to return Optional[Buffer]
Daniele Varrazzo [Mon, 19 Sep 2022 00:42:34 +0000 (01:42 +0100)] 
fix: annotate every dumper to return Optional[Buffer]

Even if these classes never return None, this allows to create
subclasses returning None without making Mypy unhappy.

Similarly, annotate quote() methods as returning Buffer to allow
subclasses to return other types.

13 months agofix: manage None as return value of Dumper.dump()
Daniele Varrazzo [Mon, 19 Sep 2022 00:08:19 +0000 (01:08 +0100)] 
fix: manage None as return value of Dumper.dump()

These are only the changes suggested by Mypy; no test added to verify
that the code paths actually work.

Only Python test fixed, no C yet.

13 months agofeat: extend signature of Dumper.dump() to allow returning None
Daniele Varrazzo [Sun, 18 Sep 2022 23:36:35 +0000 (00:36 +0100)] 
feat: extend signature of Dumper.dump() to allow returning None

13 months agodocs: extend on the type info note
Daniele Varrazzo [Sat, 1 Jun 2024 11:05:54 +0000 (13:05 +0200)] 
docs: extend on the type info note

13 months agofeat: add libpq interface to change a password
Denis Laxalde [Wed, 17 Apr 2024 08:35:45 +0000 (10:35 +0200)] 
feat: add libpq interface to change a password

See https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a7be2a6c262d5352756d909b29c419ea5e5fa1d9:
> drivers built on top of libpq should expose this function and its
> use should be generally encouraged over doing ALTER USER directly for
> password changes.

The test case assumes that the role connected to postgres has CREATEROLE
rights. If this is not true, the test is skipped.

13 months agofix(copy): fix count of chars to escape
Daniele Varrazzo [Wed, 29 May 2024 19:45:57 +0000 (21:45 +0200)] 
fix(copy): fix count of chars to escape

We missed to reset the number of chars to escape at every field. As a
consequence, we end up resizing and scanning all the fields after the
first one requiring an escape and allocating a bit more memory than
needed.

13 months agochore(deps): bump pypa/cibuildwheel in the actions group
dependabot[bot] [Thu, 30 May 2024 20:33:57 +0000 (20:33 +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.17.0 to 2.18.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/v2.17.0...v2.18.1)

---
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>
13 months agoMerge pull request #824
Daniele Varrazzo [Thu, 30 May 2024 20:33:15 +0000 (22:33 +0200)] 
Merge pull request #824

Updates action versions and add dependabot to check monthly for updates

13 months agoci: merge all produced artifacts into a single artifact for ease of downloading 824/head
Trenton Holmes [Sat, 18 May 2024 20:21:04 +0000 (13:21 -0700)] 
ci: merge all produced artifacts into a single artifact for ease of downloading

13 months agoci: updates action versions and add dependabot to check monthly for updates
Trenton Holmes [Sat, 18 May 2024 01:41:51 +0000 (18:41 -0700)] 
ci: updates action versions and add dependabot to check monthly for updates

13 months agochore: fix typo in comment
Daniele Varrazzo [Mon, 27 May 2024 14:20:38 +0000 (16:20 +0200)] 
chore: fix typo in comment

13 months agodocs: improve docs about query protocols and PgBouncer
Daniele Varrazzo [Fri, 17 May 2024 00:42:32 +0000 (02:42 +0200)] 
docs: improve docs about query protocols and PgBouncer

13 months agofix: use the simple query protocol to execute BEGIN/COMMIT out of pipeline
Daniele Varrazzo [Tue, 14 May 2024 11:18:40 +0000 (13:18 +0200)] 
fix: use the simple query protocol to execute BEGIN/COMMIT out of pipeline

We started using the extended protocol in e5079184 to fix #350, but,
probably to keep symmetry, we also changed the behaviour out of the
pipeline.

This turns out to be a problem for people connecting to the PgBouncer
admin console. They can use the `ClientCursor`, which tries to use the
simple protocol as much as it can, but they currently have to use
autocommit. With this changeset autocommit shouldn't be needed anymore.
See #808.

13 months agoMerge pull request #811 from psycopg/refactor-typeinfo
Daniele Varrazzo [Wed, 15 May 2024 16:29:30 +0000 (18:29 +0200)] 
Merge pull request #811 from psycopg/refactor-typeinfo

Remove type modifier decoding from Column object

13 months agotest: adapt type representation tests to crdb and postgres < 15 811/head
Daniele Varrazzo [Thu, 9 May 2024 01:49:24 +0000 (03:49 +0200)] 
test: adapt type representation tests to crdb and postgres < 15

13 months agofeat: add Column.type_display
Daniele Varrazzo [Thu, 9 May 2024 01:27:29 +0000 (03:27 +0200)] 
feat: add Column.type_display

13 months agofix: fix representation of bit/varbit columns
Daniele Varrazzo [Thu, 9 May 2024 00:02:08 +0000 (02:02 +0200)] 
fix: fix representation of bit/varbit columns

13 months agofix: improve column type display
Daniele Varrazzo [Wed, 8 May 2024 23:39:30 +0000 (01:39 +0200)] 
fix: improve column type display

Make sure that what displayed is the same displayed by postgres for all
supported types.

13 months agorefactor(column): remove ColumnData internal object
Daniele Varrazzo [Wed, 8 May 2024 21:57:11 +0000 (23:57 +0200)] 
refactor(column): remove ColumnData internal object

13 months agorefactor: dispatch type modifier parsing to type-specific objects
Daniele Varrazzo [Wed, 8 May 2024 21:49:19 +0000 (23:49 +0200)] 
refactor: dispatch type modifier parsing to type-specific objects

This changeset is enough to pass the current test suite, but probably it
might require some cleanup.

Close #450

13 months agostyle(typeinfo): more modern type annotations
Daniele Varrazzo [Fri, 3 May 2024 19:45:24 +0000 (21:45 +0200)] 
style(typeinfo): more modern type annotations

13 months agoAdd instructions for pgbouncer simple query protocol
Ruben Laguna [Tue, 14 May 2024 13:48:08 +0000 (15:48 +0200)] 
Add instructions for pgbouncer simple query protocol

13 months agodocs: add README to build the docs
Daniele Varrazzo [Tue, 14 May 2024 12:03:45 +0000 (14:03 +0200)] 
docs: add README to build the docs

Close #821.

14 months agochore: bump psycopg_pool package version to 3.2.2
Daniele Varrazzo [Fri, 10 May 2024 00:05:25 +0000 (02:05 +0200)] 
chore: bump psycopg_pool package version to 3.2.2

14 months agochore: bump psycopg package version to 3.1.19
Daniele Varrazzo [Fri, 10 May 2024 00:01:14 +0000 (02:01 +0200)] 
chore: bump psycopg package version to 3.1.19

14 months agoci(macos): test and build macOS packages on M1 runners
Daniele Varrazzo [Tue, 9 Apr 2024 23:57:50 +0000 (01:57 +0200)] 
ci(macos): test and build macOS packages on M1 runners

Separate macos runners because:

The macos-14 runner can build amd64 images, but doesn't have Python <
3.10.

The macos-12 runner can only build x86_64 images.

Run Postgres from CI rather than from cibuildwheel, as cibw won't use a
docker image on macOS anyway. It makes it more uniform w.r.t. other
runners and doesn't require a "before" script.

14 months agoMerge pull request #791
Daniele Varrazzo [Wed, 8 May 2024 20:12:01 +0000 (22:12 +0200)] 
Merge pull request #791

Replace SELECT 1 with an empty query

14 months agodocs(pool): mention running an empty query on check in news file 791/head
Daniele Varrazzo [Wed, 8 May 2024 16:49:41 +0000 (18:49 +0200)] 
docs(pool): mention running an empty query on check in news file

14 months agorefactor(pool): replace --ping with empty string
Eyal Halpern Shalev [Sat, 4 May 2024 12:57:56 +0000 (15:57 +0300)] 
refactor(pool): replace --ping with empty string

14 months agoperf(pool): replace SELECT 1 with an empty query
Eyal Halpern Shalev [Mon, 15 Apr 2024 23:09:45 +0000 (02:09 +0300)] 
perf(pool): replace SELECT 1 with an empty query

14 months agoMerge pull request #746 from ankane/copy-performance
Daniele Varrazzo [Wed, 8 May 2024 16:35:58 +0000 (18:35 +0200)] 
Merge pull request #746 from ankane/copy-performance

Improve performance of copy

14 months agoperf(copy): only flush at every row on copy on macOS 746/head
Daniele Varrazzo [Mon, 6 May 2024 16:43:10 +0000 (18:43 +0200)] 
perf(copy): only flush at every row on copy on macOS

With some benchmark, it seems that on Linux and Windows performances are worse.
See #746 for details.

14 months agotest(copy): add minimal copy benchmark framework
Daniele Varrazzo [Fri, 3 May 2024 11:08:11 +0000 (13:08 +0200)] 
test(copy): add minimal copy benchmark framework

14 months agoImprove performance of copy
Andrew Kane [Mon, 4 Mar 2024 22:34:56 +0000 (14:34 -0800)] 
Improve performance of copy

14 months agofix(pool): avoid possible deadlock (until timeout) on pool closing
Daniele Varrazzo [Mon, 6 May 2024 09:21:33 +0000 (11:21 +0200)] 
fix(pool): avoid possible deadlock (until timeout) on pool closing

With the previous change to avoid finding open connections in the pool
(#784), stopping the worker was moved into the critical section. This
can create a deadlock in case a worker is in the process of obtaining a
new connection, because putting it to the pool requires the lock. The
deadlock only last for the default 5s timeout passed to _stop_workers().

Solve the problem by guarding _add_to_pool() to avoid it to try to add
the connection if the pool is closed.

However, refactor the pool closing sequence too and close the workers
and other resources that now out of the state outside the critical
section to keep the operation running under lock to a minimum.

14 months agotest: fix running pool tests using Psycopg 3.1
Daniele Varrazzo [Sat, 20 Apr 2024 22:03:56 +0000 (00:03 +0200)] 
test: fix running pool tests using Psycopg 3.1

Avoid using Capabilities at import time in the test suite.

14 months agoMerge branch 'fix-734'
Daniele Varrazzo [Sat, 20 Apr 2024 21:46:46 +0000 (23:46 +0200)] 
Merge branch 'fix-734'

14 months agofix(c): solve undefined behaviour caused by unaligned access 735/head
Daniele Varrazzo [Sun, 11 Feb 2024 01:34:20 +0000 (02:34 +0100)] 
fix(c): solve undefined behaviour caused by unaligned access

Close #734

14 months agoci: add test to check for misaligned memory access
Daniele Varrazzo [Wed, 10 Apr 2024 23:24:02 +0000 (01:24 +0200)] 
ci: add test to check for misaligned memory access

14 months agofix: fix handling of floating point values for connect_timeout 796/head
Daniele Varrazzo [Thu, 18 Apr 2024 01:38:17 +0000 (03:38 +0200)] 
fix: fix handling of floating point values for connect_timeout

14 months agoMerge pull request #780 from dlax/cancel-safe-timeout
Daniele Varrazzo [Wed, 17 Apr 2024 21:52:02 +0000 (23:52 +0200)] 
Merge pull request #780 from dlax/cancel-safe-timeout

feat: add a timeout parameter to Connection.cancel_safe()

14 months agorefactor: set the meaningful timeout for _try_cancel() as a default 780/head
Denis Laxalde [Tue, 16 Apr 2024 07:11:30 +0000 (09:11 +0200)] 
refactor: set the meaningful timeout for _try_cancel() as a default

14 months agofix: avoid to swallow exceptions in public cancel methods
Daniele Varrazzo [Sat, 13 Apr 2024 10:23:38 +0000 (12:23 +0200)] 
fix: avoid to swallow exceptions in public cancel methods

Only ignore errors in every internal usage, in order to cancel as a best
effort and don't clobber a likely more meaningful exception.

14 months agodocs: adjust cancel_safe() docstring
Daniele Varrazzo [Sat, 13 Apr 2024 10:23:38 +0000 (12:23 +0200)] 
docs: adjust cancel_safe() docstring

14 months agodocs: reword notes on cancellation
Daniele Varrazzo [Sat, 13 Apr 2024 10:23:38 +0000 (12:23 +0200)] 
docs: reword notes on cancellation

14 months agotest: more uniform treatment of timeout approx check
Daniele Varrazzo [Fri, 12 Apr 2024 22:51:22 +0000 (00:51 +0200)] 
test: more uniform treatment of timeout approx check

14 months agorefactor: check if cancel safe is implemented via capabilities
Daniele Varrazzo [Fri, 12 Apr 2024 22:36:36 +0000 (00:36 +0200)] 
refactor: check if cancel safe is implemented via capabilities

14 months agotest(proxy): use 127.0.0.1 rather than localhost
Daniele Varrazzo [Fri, 12 Apr 2024 12:46:49 +0000 (14:46 +0200)] 
test(proxy): use 127.0.0.1 rather than localhost

Try to fix the flakiness shown by deaf_listen() in CI. Maybe there is a
race condition in listen()/connect() but I have also seen problems
related with localhost in the /etc/hosts file and ipv6, so let's first
try this.

14 months agofeat: add a timeout parameter to Connection.cancel_safe()
Denis Laxalde [Mon, 8 Apr 2024 13:00:17 +0000 (15:00 +0200)] 
feat: add a timeout parameter to Connection.cancel_safe()

This will only work for PGcancelConn, i.e. libpq >= 17, or thanks to
added waiting logic in AsyncConnection's implementation; so we add a
note about the limitation in Connection's documentation.

14 months agofeat: add libpq interface for retrieving results in chunks 793/head
Denis Laxalde [Wed, 17 Apr 2024 08:35:45 +0000 (10:35 +0200)] 
feat: add libpq interface for retrieving results in chunks

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4643a2b265e967cc5f13ffa0c7c6912dbb3466d0

14 months agofix(c): fix the goto label in the HAVE_POLL branch of wait_c_impl()
Denis Laxalde [Tue, 16 Apr 2024 14:21:16 +0000 (16:21 +0200)] 
fix(c): fix the goto label in the HAVE_POLL branch of wait_c_impl()

This resolves the following warning when building the extension module:

    $ python psycopg_c/setup.py build_ext -i
    [...]
    building 'psycopg_c._psycopg' extension
    x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/denis/.local/pgsql/include -I/home/denis/src/psycopg3/.venv/include -I/usr/include/python3.11 -c psycopg_c/_psycopg.c -o build/temp.linux-x86_64-cpython-311/psycopg_c/_psycopg.o
    psycopg_c/_psycopg.c: In function ‘wait_c_impl’:
    psycopg_c/_psycopg.c:1649:1: warning: label ‘error’ defined but not used [-Wunused-label]
     1649 |
          | ^

14 months agoMerge branch 'cancel-exceptions-swallow'
Daniele Varrazzo [Fri, 12 Apr 2024 22:11:15 +0000 (00:11 +0200)] 
Merge branch 'cancel-exceptions-swallow'

14 months agofix: avoid explicit str() call when logging exception 785/head
Daniele Varrazzo [Fri, 12 Apr 2024 12:11:22 +0000 (14:11 +0200)] 
fix: avoid explicit str() call when logging exception

This was done as paranoia check for Sentry which might uses the repr of
the exception even if we asked for `%s` and therefore might leak
secrets, but frankly it's not our responsibility.

https://github.com/getsentry/sentry-python/issues/2417

14 months agorefactor: clearer cancel_safe implementation
Daniele Varrazzo [Wed, 10 Apr 2024 20:37:24 +0000 (22:37 +0200)] 
refactor: clearer cancel_safe implementation

Avoid catching NotSupported, just check for the libpq version.

Also avoid the half exception handler in `_cancel_gen()`: as in the
legacy branch, warn and ignore any error happening in the outermost
method, without adding an ignore exception policy in an implementation
method.

Close #778.

14 months agorefactor: drop _try_cancel internal method.
Daniele Varrazzo [Wed, 10 Apr 2024 20:16:47 +0000 (22:16 +0200)] 
refactor: drop _try_cancel internal method.

This method was useful before introducing cancel_safe, which is now the
function of choice for internal cancelling.

Also refactor the exception handling to account for possible errors in
`PGcancel.cancel()`, not only in `PGconn.get_cancel()`, to make sure to
not clobber an exception bubbling up with ours, whatever happens to the
underlying connection.

14 months agoMerge branch 'capabilities'
Daniele Varrazzo [Fri, 12 Apr 2024 22:09:23 +0000 (00:09 +0200)] 
Merge branch 'capabilities'

14 months agorefactor(capabilities): add caching to capabilities check 782/head
Daniele Varrazzo [Fri, 12 Apr 2024 12:04:57 +0000 (14:04 +0200)] 
refactor(capabilities): add caching to capabilities check

14 months agorefactor(pipeline): use Capabilities to implement is_supported
Daniele Varrazzo [Tue, 9 Apr 2024 22:13:18 +0000 (00:13 +0200)] 
refactor(pipeline): use Capabilities to implement is_supported

14 months agodocs: add capabilities documentation
Daniele Varrazzo [Tue, 9 Apr 2024 21:41:28 +0000 (23:41 +0200)] 
docs: add capabilities documentation

14 months agofeat: add psycopg.capability
Daniele Varrazzo [Tue, 9 Apr 2024 20:30:43 +0000 (22:30 +0200)] 
feat: add psycopg.capability

Close #772

14 months agorefactor: use consistently the version_pretty() function
Daniele Varrazzo [Tue, 9 Apr 2024 20:15:39 +0000 (22:15 +0200)] 
refactor: use consistently the version_pretty() function

14 months agofeat: add pq.version_pretty() function
Daniele Varrazzo [Tue, 9 Apr 2024 13:54:55 +0000 (15:54 +0200)] 
feat: add pq.version_pretty() function

14 months agoMerge branch 'async-to-sync-refactor'
Daniele Varrazzo [Fri, 12 Apr 2024 22:07:29 +0000 (00:07 +0200)] 
Merge branch 'async-to-sync-refactor'

14 months agorefactor(async-to-sync): rename --convert-all option to --all 787/head
Daniele Varrazzo [Fri, 12 Apr 2024 22:05:00 +0000 (00:05 +0200)] 
refactor(async-to-sync): rename --convert-all option to --all

14 months agochore(async-to-sync): drop --all argument
Daniele Varrazzo [Fri, 12 Apr 2024 17:37:25 +0000 (19:37 +0200)] 
chore(async-to-sync): drop --all argument

Working on all inputs is a meaningful default.

14 months agorefactor(async-to-sync): use pattern matching for more compact tests
Daniele Varrazzo [Fri, 12 Apr 2024 00:47:05 +0000 (02:47 +0200)] 
refactor(async-to-sync): use pattern matching for more compact tests

14 months agorefactor(async-to-sync): simpler pattern to convert string literals
Daniele Varrazzo [Thu, 11 Apr 2024 23:32:18 +0000 (01:32 +0200)] 
refactor(async-to-sync): simpler pattern to convert string literals