]>
git.ipfire.org Git - thirdparty/psycopg.git/log
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
Daniele Varrazzo [Sun, 24 Jul 2022 02:22:32 +0000 (03:22 +0100)]
feat(copy): add 'binary' param to copy object
This allows to write binary format even when the query has executed no
COPY operation.
Notice that now we have introduced tests that convert sample_records
into sample_binary: because small numbers would be dumped to int2, use
values large enough to require int4.
Daniele Varrazzo [Sun, 24 Jul 2022 00:37:56 +0000 (01:37 +0100)]
refactor(cursor): rename _set_current_result -> _select_current_result
Daniele Varrazzo [Sat, 23 Jul 2022 22:13:41 +0000 (23:13 +0100)]
feat(copy): add FileWriter to write copy data to a file-like object
Daniele Varrazzo [Sat, 23 Jul 2022 22:02:21 +0000 (23:02 +0100)]
refactor(copy): rename QueueWriter to QueuedLibpqWriter
Daniele Varrazzo [Sat, 23 Jul 2022 21:44:55 +0000 (22:44 +0100)]
perf(copy): use non-thread/task copy writers by default
Further benchmarks show no performance improvement using a writer
thread, and a slight slowdown using a writer async task. If that's the
case we can keep it simpler.
Daniele Varrazzo [Sat, 23 Jul 2022 20:37:48 +0000 (21:37 +0100)]
docs: fix docstrings for copy objects
Daniele Varrazzo [Sun, 12 Jun 2022 22:53:26 +0000 (00:53 +0200)]
refactor(copy): rename ConnectionWriter to LibpqWriter
The class takes a cursor as input so the previous name was misleading.
Daniele Varrazzo [Sat, 11 Jun 2022 22:47:50 +0000 (00:47 +0200)]
refactor(copy): make the writer entirely responsible of the libpq copy state
This way we can create a writer which is entirely independent from the
libpq and the connection, which is useful, for instance, to format a
file with copy data.
Daniele Varrazzo [Sat, 11 Jun 2022 15:19:46 +0000 (17:19 +0200)]
feat(copy): add writer param AsyncCursor.copy()
Add async copy writers similar to the sync ones.
Daniele Varrazzo [Sat, 11 Jun 2022 14:58:02 +0000 (16:58 +0200)]
feat(copy): add ConnectionWriter
This writer allows direct writing to the libpw, without buffering queue,
and provides the interface for a writer using a libpq connection to
write.
Daniele Varrazzo [Sat, 11 Jun 2022 14:56:13 +0000 (16:56 +0200)]
feat(copy): add 'writer' parameter to Cursor.copy()
Daniele Varrazzo [Sat, 11 Jun 2022 14:21:38 +0000 (16:21 +0200)]
refactor(copy): add Writer object
This separation of responsibility will allow to:
- create writers that e.g. produce a file rather than writing to a
connection;
- create writers that write directly instead of using a queue (see
https://github.com/psycopg/psycopg/discussions/111 for an example of users
unhappy about that. I still don't see their nervousness justified, but
I'm ok to provide them an escape hatch if it's easy to implement).
Daniele Varrazzo [Sat, 11 Jun 2022 08:46:01 +0000 (10:46 +0200)]
refactor(copy) use already looked-up pgconn instead of the connection one
Left out of previous refactoring.
Daniele Varrazzo [Mon, 18 Jul 2022 23:43:03 +0000 (00:43 +0100)]
Merge branch 'docs-no-external-modules'
Daniele Varrazzo [Mon, 18 Jul 2022 13:39:55 +0000 (14:39 +0100)]
docs: allow to read the libpq definitions from a local file
For the poor souls which don't have external access building the docs.
See #337.
Daniele Varrazzo [Mon, 18 Jul 2022 13:28:30 +0000 (14:28 +0100)]
docs: upgrade sphinx version to build docs
The version of furo used is not compatible with the newly available
Sphinx.
Martin Weinelt [Mon, 18 Jul 2022 11:58:55 +0000 (13:58 +0200)]
docs: fix build with sphinx 5.0
The `no_docstring` argument to `Documenter.add_content()` has been
deprecated in Sphinx 3.4.0 and removed in Sphinx 5.0.
This will not break compatibility with earlier versions, since the
`no_docstring` argument always carried a default value.
https://github.com/sphinx-doc/sphinx/blob/v4.2.0/sphinx/ext/autodoc/__init__.py#L601
https://github.com/sphinx-doc/sphinx/blob/v4.5.0/sphinx/ext/autodoc/__init__.py#L596
Daniele Varrazzo [Mon, 18 Jul 2022 07:34:25 +0000 (08:34 +0100)]
docs: move documentation from shapely module docstrings to docs
This avoids the dependency on shapely to build the docs.
Daniele Varrazzo [Mon, 18 Jul 2022 07:27:22 +0000 (08:27 +0100)]
docs: move documentation from _dns module docstrings to docs
Allow to build the _dns documentation without importing the module,
which requires external dependencies.
Daniele Varrazzo [Mon, 18 Jul 2022 07:23:55 +0000 (08:23 +0100)]
docs: add skip-list to avoid importing external module
In sandboxed environments dnspython doesn't work because it cannot read
`/etc/resolv.conf`/
See #337 for details.
Daniele Varrazzo [Tue, 12 Jul 2022 23:29:19 +0000 (00:29 +0100)]
test: fix proxy-based tests confused by the PGHOST env var