]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Federico Caselli [Thu, 5 Jan 2023 21:41:29 +0000 (22:41 +0100)]
Use to_regtype instead of ::regtype in type info queries on supported dbs
Daniele Varrazzo [Tue, 3 Jan 2023 19:40:38 +0000 (19:40 +0000)]
fix: report the MultirangeInfo object exposed by psycopg.types.multirange
Daniele Varrazzo [Mon, 2 Jan 2023 21:48:03 +0000 (21:48 +0000)]
Merge branch 'build-backend'
Daniele Varrazzo [Mon, 2 Jan 2023 01:59:26 +0000 (01:59 +0000)]
ci: add in-tree build backend to avoid installing Cython if not needed
Only install Cython when there are pyx files to build. If there aren't,
it means that the c files are already available and Cython is not
required.
Close #471.
Daniele Varrazzo [Mon, 2 Jan 2023 03:26:32 +0000 (03:26 +0000)]
ci: use the 'build' python package as build frontend
Daniele Varrazzo [Mon, 2 Jan 2023 03:01:41 +0000 (03:01 +0000)]
ci: fix building source packages
Something was broken recently and installing from the package root
doesn't work anymore.
Daniele Varrazzo [Mon, 2 Jan 2023 02:10:34 +0000 (02:10 +0000)]
Merge branch 'test-lower-bound-depsendencies'
Daniele Varrazzo [Sat, 31 Dec 2022 03:07:39 +0000 (03:07 +0000)]
ci: include a single test with the oldest dependencies versions
Daniele Varrazzo [Sat, 31 Dec 2022 03:07:17 +0000 (03:07 +0000)]
chore: update the lower bound dependencies in the constraint file
Lower minimum dependency on pytest-randomly to version 3.5, as
version 3.6 requires a newer importlib-metadata.
Daniele Varrazzo [Mon, 26 Dec 2022 03:47:42 +0000 (03:47 +0000)]
fix: raise known errors before checking for signals in waiting
Daniele Varrazzo [Mon, 26 Dec 2022 06:09:34 +0000 (06:09 +0000)]
test: add psycopg2 in green mode to benchmark script
This is a more accurate comparison between psycopg2 and 3.
Daniele Varrazzo [Fri, 23 Dec 2022 04:24:51 +0000 (04:24 +0000)]
test: add --concurrency option to benchmark script
Investigate the poor parallelism mentioned in #448.
Daniele Varrazzo [Wed, 28 Dec 2022 03:26:43 +0000 (03:26 +0000)]
style: uniform variable name between sync and async cursor
Daniele Varrazzo [Fri, 23 Dec 2022 18:04:14 +0000 (18:04 +0000)]
fix: raise OperationalError instead of MemoryError on several operations
Failure is related to the operation executed, not to memory not
available to store the result.
Daniele Varrazzo [Thu, 29 Dec 2022 00:48:22 +0000 (00:48 +0000)]
chore: add Documentation, Changes links to metadata
Daniele Varrazzo [Thu, 29 Dec 2022 00:31:30 +0000 (00:31 +0000)]
feat(bump-version): add --actions option
Daniele Varrazzo [Thu, 29 Dec 2022 00:53:19 +0000 (00:53 +0000)]
Merge branch 'refactor-version-from-metadata'
Daniele Varrazzo [Thu, 29 Dec 2022 00:26:33 +0000 (00:26 +0000)]
chore(bump-version): find versions to maintain in setup.cfg files
Daniele Varrazzo [Wed, 28 Dec 2022 23:45:23 +0000 (23:45 +0000)]
docs: move comments about version scheme and coordination to setup.ini
stengah [Thu, 22 Dec 2022 14:44:05 +0000 (20:29 +0545)]
refactor(pool): get package version from metadata
stengah [Thu, 22 Dec 2022 05:13:46 +0000 (10:58 +0545)]
refactor(c): get package version from metadata
stengah [Wed, 21 Dec 2022 16:00:33 +0000 (21:45 +0545)]
refactor: get package version from metadata
Daniele Varrazzo [Thu, 22 Dec 2022 22:19:07 +0000 (22:19 +0000)]
chore(c): lean win32
Daniele Varrazzo [Thu, 22 Dec 2022 21:28:12 +0000 (21:28 +0000)]
chore(c): fix build warnings on win32
Daniele Varrazzo [Thu, 22 Dec 2022 16:25:40 +0000 (16:25 +0000)]
ci: uniform and clean up test workflow
Daniele Varrazzo [Thu, 22 Dec 2022 22:48:44 +0000 (22:48 +0000)]
test(crdb): skip inet tests on v22.2.1
Work around https://github.com/cockroachdb/cockroach/issues/94192
Daniele Varrazzo [Thu, 22 Dec 2022 19:07:10 +0000 (19:07 +0000)]
chore(pool): add pyproject.toml
Daniele Varrazzo [Tue, 20 Dec 2022 20:19:23 +0000 (20:19 +0000)]
ci: configure the database to run two-phase-commit tests
We can't use the Github Actions PostgreSQL service because it doesn't
seem possible to configure the server for stored transactions:
- the service yaml definition doesn't take args to pass to run
- we can't overwrite the entry point with a script of ours because the
service starts before actions/checkout
- the postgres image doesn't allow to pass extra parameters to the
server via an env var
Daniele Varrazzo [Thu, 22 Dec 2022 03:04:10 +0000 (03:04 +0000)]
test: fix int mixin enum in test
Daniele Varrazzo [Wed, 21 Dec 2022 23:00:32 +0000 (23:00 +0000)]
perf: micro-optimize AdaptersMap.get_dumper
Minimal amount of opcodes in case of fast-path (there is an adapter
precisely for the class queried).
Daniele Varrazzo [Tue, 20 Dec 2022 15:25:14 +0000 (15:25 +0000)]
ci: separate source and binary package workflows
Daniele Varrazzo [Tue, 20 Dec 2022 15:56:34 +0000 (15:56 +0000)]
chore: bump psycopg_pool package version to 3.1.6.dev1
Daniele Varrazzo [Tue, 20 Dec 2022 15:56:23 +0000 (15:56 +0000)]
chore: bump psycopg package version to 3.1.8.dev1
Daniele Varrazzo [Tue, 20 Dec 2022 15:14:42 +0000 (15:14 +0000)]
test: mark another couple of tests flakey to avoid delaying releases
Daniele Varrazzo [Tue, 20 Dec 2022 03:46:30 +0000 (03:46 +0000)]
chore: bump psycopg_pool package version to 3.1.5
Daniele Varrazzo [Tue, 20 Dec 2022 03:46:27 +0000 (03:46 +0000)]
chore: bump psycopg package version to 3.1.7
Daniele Varrazzo [Tue, 20 Dec 2022 03:43:46 +0000 (03:43 +0000)]
feat(bump_version): create release tags too
Daniele Varrazzo [Tue, 20 Dec 2022 03:13:17 +0000 (03:13 +0000)]
feat(bump_version): update history file too
Daniele Varrazzo [Mon, 19 Dec 2022 23:58:18 +0000 (23:58 +0000)]
Merge branch 'fix-464'
Daniele Varrazzo [Mon, 19 Dec 2022 22:46:42 +0000 (22:46 +0000)]
fix: consider cursor description results in row factories
Fix #464
Daniele Varrazzo [Mon, 19 Dec 2022 13:21:02 +0000 (13:21 +0000)]
Merge branch 'detox'
Daniele Varrazzo [Sun, 18 Dec 2022 19:14:16 +0000 (19:14 +0000)]
test: drop --allow-fail and --no-collect-ok options
They were needed to deal with problem caused by tox. Not needed anymore.
Daniele Varrazzo [Sun, 18 Dec 2022 15:23:26 +0000 (15:23 +0000)]
ci: enable subprocess-based tests in ci
Daniele Varrazzo [Sun, 18 Dec 2022 02:54:08 +0000 (02:54 +0000)]
test: skip test on windows, C implementation, in ci
No idea why ctypes doesn't work, and I really don't care.
Daniele Varrazzo [Thu, 8 Dec 2022 14:44:36 +0000 (14:44 +0000)]
ci: drop tox from tests
Daniele Varrazzo [Fri, 16 Dec 2022 15:29:48 +0000 (15:29 +0000)]
Merge branch 'fix-438'
Daniele Varrazzo [Fri, 16 Dec 2022 03:21:38 +0000 (03:21 +0000)]
fix(pool): make sure that check() fills an empty pool
Close #438.
Daniele Varrazzo [Fri, 16 Dec 2022 15:29:21 +0000 (15:29 +0000)]
Merge branch 'test-crdb-v22.2'
Daniele Varrazzo [Fri, 16 Dec 2022 03:32:42 +0000 (03:32 +0000)]
test(crdb): re-introduce a mix of Python and libpq versions
Rafi Shamim [Mon, 12 Dec 2022 21:47:33 +0000 (16:47 -0500)]
Run tests against CockroachDB v22.2
v22.2 was released recently, so we can test it. This upgrade revealed a
regression in CRDB that we must workaround
(https://github.com/cockroachdb/cockroach/issues/93739).
This also removes testing for v21.2, since it is no longer supported.
Daniele Varrazzo [Thu, 15 Dec 2022 15:54:25 +0000 (15:54 +0000)]
ops: add script to bump package version
Daniele Varrazzo [Thu, 15 Dec 2022 15:49:31 +0000 (15:49 +0000)]
test: skip a flakey test on release
For 3.1.6 release, three package jobs failed on this test. One of them,
a ppc manylinux, took more than 30 minutes to rerun. Not pleasurable.
Daniele Varrazzo [Thu, 15 Dec 2022 15:36:20 +0000 (15:36 +0000)]
chore: bump psycopg package version to 3.1.7.dev1
Daniele Varrazzo [Thu, 15 Dec 2022 11:12:37 +0000 (11:12 +0000)]
chore: bump version number for 3.1.6 release
Daniele Varrazzo [Thu, 15 Dec 2022 11:11:22 +0000 (11:11 +0000)]
Merge branch 'fix-460'
Daniele Varrazzo [Thu, 15 Dec 2022 11:03:44 +0000 (11:03 +0000)]
fix(copy): don't create a row maker on copy
A COPY_OUT result has columns, but no names for the columns. This case
must be handled in cur.description (see #235) but we don't need to
handle it in copy. If we did handle it in copy, we would need a column
name fallback, which we forgot to handle, hence the problem in #460.
Close #460.
Daniele Varrazzo [Thu, 15 Dec 2022 09:39:59 +0000 (09:39 +0000)]
chore(binary): upgrade packaged libraries to libpq 15.1, openssl 1.1.1s
Daniele Varrazzo [Thu, 15 Dec 2022 09:42:17 +0000 (09:42 +0000)]
chore: bump to dev version 3.1.6.dev0
Daniele Varrazzo [Tue, 13 Dec 2022 14:23:56 +0000 (14:23 +0000)]
ci: run tests on Python 3.11 on macOS
Daniele Varrazzo [Tue, 13 Dec 2022 14:20:37 +0000 (14:20 +0000)]
chore: bump version number for 3.1.5 release
Daniele Varrazzo [Tue, 13 Dec 2022 12:49:23 +0000 (12:49 +0000)]
perf(rows): reduce row_factories overhead
Drop the call to cur.description, which is very heavy. Use the low-level
PGresult to get the fields names.
Close #457.
Daniele Varrazzo [Tue, 13 Dec 2022 05:19:05 +0000 (05:19 +0000)]
perf: drop call to pgconn_encoding per query
Cursor._encoding converted to property. It is only used in error
messages and infrequent operations.
Use uniformly the fallback value of utf-8 in *_encoding() functions,
especially when the connection is closed.
Daniele Varrazzo [Tue, 13 Dec 2022 04:04:04 +0000 (04:04 +0000)]
test: fix resource leaking in tests
It results in spurious warnings on ``gc_collect()`` in some innocent test
downstream::
ResourceWarning: unclosed <socket.socket fd=14,
family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Daniele Varrazzo [Tue, 13 Dec 2022 03:05:39 +0000 (03:05 +0000)]
test: ignore error looking for leaks
The leaks counter frequently reports a leak between run 1 and 2 of the
tests. It turns out to be a Decimal Context whose items() method reports
no content. So the problem is related to Python, not psycopg, and it is
not an unbound leak.
Can't reproduce it in CI, but it happens on my laptop, since switching
to Ubuntu 22.04 with Python 3.10.
Daniele Varrazzo [Tue, 13 Dec 2022 04:25:46 +0000 (04:25 +0000)]
fix: don't re-export TypeAlias from _compat module
Pyright special-cases that type and requires to import it from typing or
typing_extensions only (see https://github.com/microsoft/pyright/issues/4197).
Drop conditional dependency on typing_extension and always import
TypeAlias from there.
Fix #439.
Daniele Varrazzo [Mon, 12 Dec 2022 14:41:54 +0000 (14:41 +0000)]
docs: fix ticket number in news file
Daniele Varrazzo [Mon, 12 Dec 2022 14:40:52 +0000 (14:40 +0000)]
Merge branch 'wait-select'
Daniele Varrazzo [Mon, 12 Dec 2022 14:39:48 +0000 (14:39 +0000)]
docs: report select speedup in news file
Close #411.
Daniele Varrazzo [Sun, 11 Dec 2022 20:25:12 +0000 (20:25 +0000)]
perf(c): add fast-call Cython function to PQflush wrapper
Daniele Varrazzo [Sun, 11 Dec 2022 19:48:32 +0000 (19:48 +0000)]
perf(c): small optimization tweaks to wait_c
Daniele Varrazzo [Tue, 1 Nov 2022 23:38:50 +0000 (00:38 +0100)]
test: skip high fd number test on Windows
Windows is pretty simple in regards of the wait function, because it only
implement select, and it doesn't have the same limit of the Unix select.
However this test sometimes fails in weird ways: on the pgconn.socket >
1024 assert, for instance. So, let's just skip it.
Daniele Varrazzo [Tue, 1 Nov 2022 22:39:22 +0000 (23:39 +0100)]
test: allow choosing a wait function using the PSYCOPG_WAIT_FUNC env var
We won't make this public yet, possibly we never will (I think we are
the people responsible for this choice), but it might be useful for
testing.
Daniele Varrazzo [Sat, 29 Oct 2022 23:37:01 +0000 (01:37 +0200)]
perf(c): use poll() instead of select() for waiting, where available
Daniele Varrazzo [Sat, 29 Oct 2022 10:27:10 +0000 (12:27 +0200)]
fix(c): guard select() from high number file descriptors
The Python `select.select()` wrapper raises ValueError. Without a guard,
the C `wait_select()` segfaults. The C way to say you have been naughty.
On Windows this seems not only not needed, but it actually stops from creating
any connection at all.
Daniele Varrazzo [Wed, 26 Oct 2022 01:02:14 +0000 (03:02 +0200)]
fix(c): allow wait_select() to be interrupted by signals
Daniele Varrazzo [Tue, 25 Oct 2022 21:14:58 +0000 (23:14 +0200)]
fix(c): fix import on Windows
Daniele Varrazzo [Tue, 25 Oct 2022 20:31:11 +0000 (22:31 +0200)]
perf(c): add C version of select waiting function
'Wait' and 'Ready' enums moved into the '_enums' module to avoid a
circular import.
Daniele Varrazzo [Tue, 25 Oct 2022 16:13:15 +0000 (18:13 +0200)]
perf: use wait_select() as even if kqueue is the default
There is a bit less overhead using this simpler function than using
wait_selector.
Daniele Varrazzo [Wed, 19 Oct 2022 16:33:07 +0000 (17:33 +0100)]
test: add test on wait_select
Refactor tests to make a better use of pytest parametrization and skip
conditions.
Daniele Varrazzo [Wed, 19 Oct 2022 15:38:20 +0000 (16:38 +0100)]
perf: use wait_select on Windows
On windows, the default selector strategy is select. As a consequence
using the higher level selector object comes with a performance penalty.
Daniele Varrazzo [Mon, 17 Oct 2022 02:12:24 +0000 (03:12 +0100)]
feat: add wait_select() function
A few tests show that using select() from Python has a lower overhead.
See #414.
Use this function wherever defined and epoll() is the default select
strategy instead. This is mostly a draft to figure out where this
strategy can be used with success.
Daniele Varrazzo [Mon, 17 Oct 2022 09:42:33 +0000 (10:42 +0100)]
test: add simple test to compare performances in refactoring
This test is inspired to the problem open in #411, and is pretty much a
simple operation in a tight loop. It is used, at the moment, to compare
different ways to test I/O completion strategies with simple and fast
queries under no concurrency.
Daniele Varrazzo [Wed, 7 Dec 2022 20:33:46 +0000 (20:33 +0000)]
chore: declare Copy.read to return a buffer object
We still return memoryview, but leave the possibility open to return
something different, such as bytes.
Daniele Varrazzo [Thu, 8 Dec 2022 14:11:00 +0000 (14:11 +0000)]
fix: add C Float4 dumper
It would be used when looked up by oid. At the moment there is only a
Python version for it.
Daniele Varrazzo [Thu, 8 Dec 2022 16:20:04 +0000 (16:20 +0000)]
lint(c): avoid types warning building on Windows
Daniele Varrazzo [Sat, 10 Dec 2022 13:08:09 +0000 (13:08 +0000)]
Merge branch 'array-speedup'
Daniele Varrazzo [Tue, 6 Dec 2022 12:40:27 +0000 (13:40 +0100)]
docs: add a note about further optimizing text array loading
Daniele Varrazzo [Tue, 6 Dec 2022 12:23:15 +0000 (13:23 +0100)]
perf(c/array): cache the scratch area in the dumper
Daniele Varrazzo [Tue, 6 Dec 2022 11:50:03 +0000 (12:50 +0100)]
perf(c/array): cache the element loader in the array loader
Daniele Varrazzo [Tue, 6 Dec 2022 07:03:58 +0000 (08:03 +0100)]
docs: report array speedup in the news
Daniele Varrazzo [Sun, 27 Nov 2022 14:20:10 +0000 (15:20 +0100)]
perf(c/array): add C implementation of array loader
With this change we get to load an array without the transformer calling
any Python code (if the element loader is a CLoader as well).
We don't need to subclass the binary loader anymore because all the
required info is now taken from the loaded data. As a consequence, we
don't need a BaseArrayLoader anymore.
Daniele Varrazzo [Sun, 27 Nov 2022 11:12:50 +0000 (12:12 +0100)]
perf(c/array): reuse buffer to unescape array tokens
Save a malloc and setting up an exception per element, replaced by
realloc when needed and a single exception per array.
Daniele Varrazzo [Fri, 25 Nov 2022 14:48:05 +0000 (15:48 +0100)]
fix(c/array): null-terminate strings in text array loading
Daniele Varrazzo [Wed, 9 Nov 2022 14:52:55 +0000 (14:52 +0000)]
perf(c): optimise access to C item loaders in array loading
Daniele Varrazzo [Fri, 21 Oct 2022 15:44:17 +0000 (17:44 +0200)]
perf(c/array): build binary array recursively instead of rearranging them
Daniele Varrazzo [Thu, 20 Oct 2022 23:13:45 +0000 (01:13 +0200)]
perf(c/array): optimize reassembling multidimensional arrays as nested lists
Daniele Varrazzo [Thu, 20 Oct 2022 21:58:08 +0000 (23:58 +0200)]
refactor(c/array): types hygiene around endianness conversions
Daniele Varrazzo [Thu, 20 Oct 2022 21:41:03 +0000 (23:41 +0200)]
fix: get element oid from the array itself in binary format
Getting it from the type was causing problems in CRDB because they seem
to have a different interpretation of what Int2 and Int4 are. Refactor
the binary parser to take a transformer, instead of a loader function,
in order to look up the loader from the oid parsed from the array.
Also refactor the text array parser to take the whole loader instead of
the load function only, which will be useful in order to optimize the
use of C loaders.
Daniele Varrazzo [Wed, 14 Sep 2022 11:33:00 +0000 (12:33 +0100)]
perf: add C implementation of array load
This implementation can be still improved: we always call the Python
loader to decode the single elements; we can try and call the C loader
if available.
Daniele Varrazzo [Sat, 10 Sep 2022 17:53:20 +0000 (18:53 +0100)]
perf(array): introduce mockup of optimized array loading functions