]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Daniele Varrazzo [Tue, 27 Sep 2022 08:54:49 +0000 (09:54 +0100)]
docs: mention named tuples regression fix in change log
Daniele Varrazzo [Tue, 27 Sep 2022 08:51:11 +0000 (09:51 +0100)]
test: more exhaustive test of difficult names/attrs in composites
Jolbas [Sun, 25 Sep 2022 14:11:36 +0000 (16:11 +0200)]
fix: restore pre-3.1 behaviour converting fields to named tuples attributes
Let more valid identifiers through _as_python_identifier(). Also 2.5x faster if no change is needed
Close #386
Jolbas [Sun, 25 Sep 2022 12:32:42 +0000 (14:32 +0200)]
test: check unusual column names and namedtuple
Daniele Varrazzo [Tue, 27 Sep 2022 08:15:21 +0000 (09:15 +0100)]
fix: avoid using type variables in typevar bounds
It is not allowed by the specs. Mypy tolerates it, replacing the
argument with Any, according to @erictraut. Pyright reports it as an
error instead.
See #365, microsoft/pyright#3984
Daniele Varrazzo [Wed, 28 Sep 2022 00:28:41 +0000 (01:28 +0100)]
chore: upgrade mypy to 0.981
Most changes needed by https://github.com/python/typeshed/pull/8446.
Daniele Varrazzo [Sun, 25 Sep 2022 01:41:52 +0000 (02:41 +0100)]
docs: fix plural
Daniele Varrazzo [Sun, 25 Sep 2022 01:39:29 +0000 (02:39 +0100)]
docs: mention macOS arm64 packages distribution
Daniele Varrazzo [Sun, 25 Sep 2022 01:31:22 +0000 (02:31 +0100)]
build: fix starting Postgres in macOS build script
The brew command fails with:
Could not enable service: 125: Domain does not support specified action
Error: Failure while executing; `/bin/launchctl enable gui/501/homebrew.mxcl.postgresql@14` exited with 125.
Daniele Varrazzo [Wed, 21 Sep 2022 11:49:25 +0000 (12:49 +0100)]
docs: typo messge -> message
Thank you, codespell 💀💀💀
Daniele Varrazzo [Wed, 21 Sep 2022 11:46:07 +0000 (12:46 +0100)]
docs: add link to document how to recover the stream from ACTIVE state
See #382.
Daniele Varrazzo [Mon, 19 Sep 2022 17:31:58 +0000 (18:31 +0100)]
chore: bump to next dev version number
Daniele Varrazzo [Mon, 19 Sep 2022 11:08:22 +0000 (12:08 +0100)]
chore: bump to version number 3.1.2
Daniele Varrazzo [Sun, 18 Sep 2022 21:45:48 +0000 (22:45 +0100)]
fix: fix queries with repeated named parameters in ClientCursor
Close #378.
Denis Laxalde [Thu, 15 Sep 2022 10:24:43 +0000 (12:24 +0200)]
test: allow to trace libpq to STDERR, rename option to --pq-trace
By using STDERR, we get the trace directly in pytest output for failing
tests. Though this requires care when used in combination with
--capture=sys because this would make sys.stderr an in-memory file.
When STDERR is used, we don't insert the header since the test case
identifier will be interleaved already.
Denis Laxalde [Thu, 15 Sep 2022 16:28:21 +0000 (18:28 +0200)]
fix: also sync nested pipeline when a transaction is active
Upon enter, transaction() checks the in-transaction status to determine
if a BEGIN (when IDLE) or a SAVEPOINT (otherwise) should be inserted.
However, in pipeline mode, if the pipeline is in "implicit transaction"
(i.e. it has no active BEGIN) and statements have been sent, the
in-transaction status might be ACTIVE if those statements have not yet
completed (typically, when results have not been fetched).
By issuing a sync() before entering a nested pipeline (which will happen
when entering transaction(), if already within a pipeline), we force
completion of those statements, and thus get a predictable
in-transaction status before entering the transaction() block.
Closes #374.
Daniele Varrazzo [Thu, 15 Sep 2022 01:07:57 +0000 (02:07 +0100)]
test: fail test session in case of segfault
Before that, tox reruns would have made tests pass, because failed tests
wouldn't have gotten a chance to be written in the cache.
Daniele Varrazzo [Wed, 14 Sep 2022 21:30:44 +0000 (22:30 +0100)]
Merge branch 'fix-372'
Daniele Varrazzo [Wed, 14 Sep 2022 21:02:38 +0000 (22:02 +0100)]
fix(psycopg_c): propagate exceptions in Transformer.set_pgresult()
Fix #372
Daniele Varrazzo [Wed, 14 Sep 2022 20:57:05 +0000 (21:57 +0100)]
test: add test to verify the behavior of adapters failing init
An exception in loader init doesn't get raised and causes a segfault.
This reproduces the issue in #372.
Daniele Varrazzo [Wed, 14 Sep 2022 14:17:55 +0000 (15:17 +0100)]
Merge branch 'docs/pgconn'
Denis Laxalde [Wed, 14 Sep 2022 12:20:05 +0000 (14:20 +0200)]
docs: document PGconn's tracing methods
Denis Laxalde [Wed, 14 Sep 2022 12:02:43 +0000 (14:02 +0200)]
docs: document PGconn.encrypt_password()
Including an example of usage.
Daniele Varrazzo [Wed, 14 Sep 2022 14:14:32 +0000 (15:14 +0100)]
refactor(psycopg_c): define loggers at module level
Daniele Varrazzo [Wed, 14 Sep 2022 13:40:41 +0000 (14:40 +0100)]
fix(psycopg_c): add missing logger declaration
Daniele Varrazzo [Wed, 14 Sep 2022 12:24:55 +0000 (13:24 +0100)]
Merge branch 'fix-371'
Daniele Varrazzo [Wed, 14 Sep 2022 11:59:14 +0000 (12:59 +0100)]
docs: mention Windows timezone problem fixed in change log
Daniele Varrazzo [Wed, 14 Sep 2022 11:50:05 +0000 (12:50 +0100)]
fix: catch any type of error if ZoneInfo creation fails
OSError would be enough to solve the problem reported in #371. However,
in case of error, Windows C implementation segfaults. I would prefer to
not chase this error just because of weirdness in the tzdata external
library, so let's cast a wider net.
Fix #371
Daniele Varrazzo [Wed, 14 Sep 2022 11:33:23 +0000 (12:33 +0100)]
test: add bad timezone to simulate a reported timezone issue
The bad timezone causes OSError on Windows.
See #371
Daniele Varrazzo [Thu, 8 Sep 2022 12:59:47 +0000 (13:59 +0100)]
chore(pool): bump to next dev version number
Daniele Varrazzo [Wed, 7 Sep 2022 11:01:04 +0000 (12:01 +0100)]
chore: bump psycopg-pool version to 3.1.2
Daniele Varrazzo [Wed, 7 Sep 2022 10:56:43 +0000 (11:56 +0100)]
Merge branch 'fix-370'
Daniele Varrazzo [Tue, 6 Sep 2022 23:49:14 +0000 (00:49 +0100)]
fix(pool): continue growing if the pool is not full yet
Previously, starting from an empty pool, we would have stopped at the
first connection created.
Daniele Varrazzo [Tue, 6 Sep 2022 16:53:40 +0000 (17:53 +0100)]
fix(pool): allow growing again after failing a growing connection attempt
Fix #370
Daniele Varrazzo [Tue, 6 Sep 2022 11:49:19 +0000 (12:49 +0100)]
chore: bump to next dev version number
Daniele Varrazzo [Mon, 5 Sep 2022 12:23:19 +0000 (13:23 +0100)]
chore: bump to version number 3.1.1
Daniele Varrazzo [Mon, 5 Sep 2022 12:21:37 +0000 (13:21 +0100)]
Merge branch 'macos-broken'
Daniele Varrazzo [Mon, 5 Sep 2022 11:28:05 +0000 (12:28 +0100)]
docs: add news entry about Homebrew fix
Daniele Varrazzo [Mon, 5 Sep 2022 11:09:33 +0000 (12:09 +0100)]
refactor: add find_libpq_full_path() to use both in library and tests
Daniele Varrazzo [Mon, 5 Sep 2022 09:56:06 +0000 (10:56 +0100)]
fix(macos): find the libpq in non-standard places
Daniele Varrazzo [Sat, 3 Sep 2022 18:24:52 +0000 (19:24 +0100)]
chore: upgrade QEMU to v2 for build
Also make sure to use a version not affected by bug #304
Daniele Varrazzo [Fri, 2 Sep 2022 15:30:23 +0000 (16:30 +0100)]
fix: make sure to pass a port number to getaddrinfo
Was passing an empty string by mistake, if no port was specified. Mostly
not a problem, except on some platforms, where it causes an
"unrecognized service" error.
Close #366.
Daniele Varrazzo [Fri, 2 Sep 2022 15:29:28 +0000 (16:29 +0100)]
Bump to next dev release
Daniele Varrazzo [Tue, 30 Aug 2022 22:46:46 +0000 (23:46 +0100)]
docs: fix title level in news
Daniele Varrazzo [Mon, 29 Aug 2022 23:01:14 +0000 (00:01 +0100)]
chore: bump version number to release 3.1
Daniele Varrazzo [Mon, 29 Aug 2022 22:52:03 +0000 (23:52 +0100)]
chore: bump to version 3.0.17
Daniele Varrazzo [Mon, 29 Aug 2022 08:58:57 +0000 (09:58 +0100)]
Merge branch 'crdb-ci'
Daniele Varrazzo [Sun, 28 Aug 2022 16:56:08 +0000 (17:56 +0100)]
ci: run CRDB tests in CI
Daniele Varrazzo [Mon, 29 Aug 2022 01:23:03 +0000 (02:23 +0100)]
test(crdb): consider Decimal("Infinity") not supported in CRDB < 22
Daniele Varrazzo [Mon, 29 Aug 2022 00:43:50 +0000 (01:43 +0100)]
test(crdb) Skip tests affected by BEGIN READ ONLY bug
The connection doesn't go in read-only mode if the statement is executed
using the advanced protocol.
See https://github.com/cockroachdb/cockroach/issues/87012
Daniele Varrazzo [Mon, 29 Aug 2022 01:10:27 +0000 (02:10 +0100)]
fix: load bytea as bytes, not memoryview, in Python implementation
Daniele Varrazzo [Sun, 28 Aug 2022 16:35:33 +0000 (17:35 +0100)]
chore(crdb): fix file name where to update OIDs
Daniele Varrazzo [Sat, 27 Aug 2022 20:29:56 +0000 (21:29 +0100)]
fix: use a "finally" to clear the result pointer after handling notifies
The chance for this to fail failed is slim (an error in the logger? A
ctrl-c just there?) but a bit of paranoia has never hurt anyone.
Daniele Varrazzo [Sat, 27 Aug 2022 20:28:22 +0000 (21:28 +0100)]
perf(pq_ctypes): use the faster byref() rather than pointer()
Daniele Varrazzo [Sun, 28 Aug 2022 11:56:52 +0000 (12:56 +0100)]
Merge branch 'pgnotifyfixes'
Daniele Varrazzo [Sun, 28 Aug 2022 10:00:12 +0000 (11:00 +0100)]
docs: add entry about segfault on fork fixed
Florian Apolloner [Sat, 27 Aug 2022 15:36:33 +0000 (17:36 +0200)]
fix: use a static notification function for PQsetNoticeReceiver.
The connection is passed via the optional *arg.
Fixes #300
Daniele Varrazzo [Sat, 27 Aug 2022 11:37:45 +0000 (12:37 +0100)]
build: build ldap with sasl and ssl support
Pass the libpq build prefix to configure in order to find just built
libraries.
Daniele Varrazzo [Sat, 27 Aug 2022 12:12:55 +0000 (13:12 +0100)]
build: upgrade system packages before building libpq
Daniele Varrazzo [Sat, 27 Aug 2022 09:57:09 +0000 (10:57 +0100)]
chore: bump version to 3.1 beta 1 to test building packages
Daniele Varrazzo [Sat, 27 Aug 2022 10:01:48 +0000 (11:01 +0100)]
chore: upgrade libpq dependencies
Daniele Varrazzo [Wed, 24 Aug 2022 17:50:18 +0000 (19:50 +0200)]
docs: fix link to numeric-to-float recipe
Daniele Varrazzo [Tue, 23 Aug 2022 22:39:40 +0000 (00:39 +0200)]
fix: avoid all uses of PQconn.send_query in pipeline mode
We stopped using it in normal querying because, until libpq 14.4, the
libpq complained about "message type 0x33 arrived from server while
idle" (see #314). But usage remained for internal queries such as BEGIN.
In libpq 14.5, Postgres devs tried to fix the issue... and broke
PQsendQuery altogether :(
Hopefully the issue will be solved in future libpq versions, but we can
work around it completely.
Close #350.
Daniele Varrazzo [Tue, 23 Aug 2022 22:18:56 +0000 (00:18 +0200)]
feat: add pq._debug module to investigate libpq issues
Daniele Varrazzo [Mon, 22 Aug 2022 09:42:52 +0000 (11:42 +0200)]
ci: don't install modules in editable mode to run packages test
Something else that broke after setuptools 64 release. See tox-dev/tox#2479
for more details.
Reported something at pypa/setuptools#3557
Daniele Varrazzo [Sat, 13 Aug 2022 21:42:05 +0000 (23:42 +0200)]
test: add missing asserts
Denis Laxalde [Fri, 19 Aug 2022 17:05:05 +0000 (19:05 +0200)]
chore: fix typos spotted by codespell 2.2.1
Sergey Fedoseev [Wed, 17 Aug 2022 16:30:42 +0000 (21:30 +0500)]
Fix typo: shoul => should
Denis Laxalde [Tue, 16 Aug 2022 14:17:29 +0000 (16:17 +0200)]
docs: fix a typo in FileWriter docstring
Daniele Varrazzo [Mon, 15 Aug 2022 11:52:04 +0000 (13:52 +0200)]
fix: consider pipeline mode not supported with libpq 14.5
Improve diagnostics about the reason why the pipeline mode is not
supported. Improve not supported tests.
Daniele Varrazzo [Mon, 15 Aug 2022 11:46:46 +0000 (13:46 +0200)]
test: allow to use the != operator in make.libpq
Daniele Varrazzo [Mon, 15 Aug 2022 11:41:01 +0000 (13:41 +0200)]
feat: use version() as __build_version__ for pq python implementation
Having __build_version__ to be null makes version checking needlessly
convoluted and version() has to be used anyway as fallback.
Daniele Varrazzo [Sat, 13 Aug 2022 01:44:17 +0000 (03:44 +0200)]
refactor(psycopg_c): define and use an ARRAYSIZE macro
Daniele Varrazzo [Sat, 13 Aug 2022 01:19:35 +0000 (03:19 +0200)]
refactor(psycopg_c): drop deprecated use of DEF in Cython
See cython/cython#4310
Daniele Varrazzo [Mon, 15 Aug 2022 00:50:50 +0000 (02:50 +0200)]
perf(psycopg_c): avoid to create a tuple in fetch_many() loop
Daniele Varrazzo [Mon, 15 Aug 2022 00:49:24 +0000 (02:49 +0200)]
refactor: expose optimized functions directly from the origin modules
Don't check for the availability of the optimized module in every module
using potentially optimized functions.
Daniele Varrazzo [Mon, 15 Aug 2022 00:46:19 +0000 (02:46 +0200)]
fix(psycopg_c): guard PQflush calls for invalid connections
Unlike other libpq functions, PQflush() doesn't have a guard for invalid
connections and will segfault if the connection gets closed.
Also check the return value of the PQflush calls: as we are not using
the wrapped version pgconn.flush(), the function doesn't automatically
throw an exception on failure.
Daniele Varrazzo [Sat, 13 Aug 2022 00:32:21 +0000 (02:32 +0200)]
chore: use `license_files` entry in metadata
`license_file` is deprecated.
Daniele Varrazzo [Fri, 12 Aug 2022 23:35:41 +0000 (01:35 +0200)]
ci: specify non-editable install in tox tests
Work around tox-dev/tox#2479 (editable installs in tox broken by setuptools
v64) and tox-dev/tox#2480 (failure to use `toxinidir` in `deps`).
Use -e consistently in the linting steps instead, because they are
defined with skip_install=True so it seems a good idea to use it. These
steps don't seem affect by the setuptools issue.
Daniele Varrazzo [Fri, 12 Aug 2022 02:00:12 +0000 (04:00 +0200)]
refactor: drop repeated operation in sync/async TypeInfo.fetch()
Daniele Varrazzo [Fri, 12 Aug 2022 01:43:59 +0000 (03:43 +0200)]
docs: fix typo "flaot"
Daniele Varrazzo [Fri, 12 Aug 2022 01:40:20 +0000 (03:40 +0200)]
docs: reword blurb about binary copy and make it a warning
Daniele Varrazzo [Fri, 12 Aug 2022 01:25:42 +0000 (03:25 +0200)]
docs: fix typo: "reurned"
Reurned... ⚱️ ->⚱️
Daniele Varrazzo [Fri, 12 Aug 2022 01:25:15 +0000 (03:25 +0200)]
docs: fix example and reword around multiple-query statements
Daniele Varrazzo [Fri, 12 Aug 2022 01:24:25 +0000 (03:24 +0200)]
docs: link to the "from psycopg2" page from the "basic usage" top section
Daniele Varrazzo [Fri, 5 Aug 2022 23:47:54 +0000 (01:47 +0200)]
docs: quote examples of pip install with extras
zsh doesn't parse the square brackets as expected.
See #347.
Sergey Fedoseev [Sat, 30 Jul 2022 12:39:47 +0000 (17:39 +0500)]
Fix syntax in example
Daniele Varrazzo [Thu, 28 Jul 2022 13:19:16 +0000 (15:19 +0200)]
build: use "latest" version of github builders
Daniele Varrazzo [Thu, 28 Jul 2022 11:24:42 +0000 (13:24 +0200)]
Merge branch 'build-macos-arm64'
Daniele Varrazzo [Thu, 28 Jul 2022 11:17:23 +0000 (13:17 +0200)]
docs: mention macOS arm64 build script in news file
Daniele Varrazzo [Sat, 16 Jul 2022 18:50:45 +0000 (19:50 +0100)]
build: add scripts to build macOS arm64 packages
Daniele Varrazzo [Thu, 28 Jul 2022 10:08:06 +0000 (12:08 +0200)]
chore: bump version number to 3.0.16
Daniele Varrazzo [Thu, 28 Jul 2022 10:06:26 +0000 (12:06 +0200)]
Merge branch 'fix-343'
Daniele Varrazzo [Thu, 28 Jul 2022 09:34:57 +0000 (11:34 +0200)]
fix: fix Cursor.rowcount after non-SELECT tuple-returining queries
PQcmdTuples doesn't return a value after SHOW and other type of queries.
Close #343
Daniele Varrazzo [Thu, 28 Jul 2022 09:26:49 +0000 (11:26 +0200)]
test: add tests to reveal the rowcount problem with SHOW
See #343
Daniele Varrazzo [Tue, 26 Jul 2022 12:58:53 +0000 (13:58 +0100)]
docs: mention 3.1 automatic DNS resolution in async page
Also fix several glitches in the dns page documentation.
Daniele Varrazzo [Tue, 26 Jul 2022 12:25:56 +0000 (13:25 +0100)]
docs: NOTIFY command in uppercase
Daniele Varrazzo [Tue, 26 Jul 2022 12:25:49 +0000 (13:25 +0100)]
Merge branch 'copy-writer'
Daniele Varrazzo [Sun, 24 Jul 2022 03:01:25 +0000 (04:01 +0100)]
docs(copy): add documentation for COPY Writer objects
Daniele Varrazzo [Sun, 24 Jul 2022 02:35:28 +0000 (03:35 +0100)]
refactor: unify code paths to set the rowcount