]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
3 years agoMove Windows test to separate file to avoid applying the asyncio mark 224/head
H [Thu, 10 Feb 2022 23:50:41 +0000 (23:50 +0000)] 
Move Windows test to separate file to avoid applying the asyncio mark

3 years agoMake synchronous test async to avoid asyncio error
H [Thu, 10 Feb 2022 23:07:18 +0000 (23:07 +0000)] 
Make synchronous test async to avoid asyncio error

3 years agoConfigure codespell to run on a dirty working directory
Daniele Varrazzo [Sun, 6 Feb 2022 00:24:17 +0000 (01:24 +0100)] 
Configure codespell to run on a dirty working directory

3 years agoAdd doc section about server messages handling
Daniele Varrazzo [Sun, 6 Feb 2022 00:23:09 +0000 (01:23 +0100)] 
Add doc section about server messages handling

3 years agoFix typo/improve errors docs
Daniele Varrazzo [Sat, 5 Feb 2022 22:43:13 +0000 (23:43 +0100)] 
Fix typo/improve errors docs

3 years agoFix docs typo
Daniele Varrazzo [Sat, 5 Feb 2022 22:31:51 +0000 (23:31 +0100)] 
Fix docs typo

3 years agoNote Python 3.6 dropped support in pool release notes
Daniele Varrazzo [Sat, 5 Feb 2022 19:25:02 +0000 (20:25 +0100)] 
Note Python 3.6 dropped support in pool release notes

3 years agoPrepare psycopg_pool 3.1 for release pool-3.1
Daniele Varrazzo [Sat, 5 Feb 2022 15:50:37 +0000 (16:50 +0100)] 
Prepare psycopg_pool 3.1 for release

3 years agoFix typo in prepared statements+pooling warning
Chris Roberts [Fri, 4 Feb 2022 21:52:07 +0000 (15:52 -0600)] 
Fix typo in prepared statements+pooling warning

3 years agoFix pool docs typo
Joe Freeman [Wed, 2 Feb 2022 21:22:35 +0000 (21:22 +0000)] 
Fix pool docs typo

3 years agoMerge branch 'black-stable'
Daniele Varrazzo [Mon, 31 Jan 2022 10:37:10 +0000 (10:37 +0000)] 
Merge branch 'black-stable'

3 years agoApply string manipulations from black --preview
Daniele Varrazzo [Sun, 30 Jan 2022 16:57:45 +0000 (16:57 +0000)] 
Apply string manipulations from black --preview

They are stable under the current black and look an improvement.

3 years agoRestore black max line length to its default
Daniele Varrazzo [Sun, 30 Jan 2022 16:40:19 +0000 (16:40 +0000)] 
Restore black max line length to its default

Trying black --preview, it performs several aggressive changes that are
made worse by the stricter margin, so relax it to the default.

3 years agoMove to using the stable black version 22.1.0
Daniele Varrazzo [Sun, 30 Jan 2022 13:38:47 +0000 (13:38 +0000)] 
Move to using the stable black version 22.1.0

3 years agofix: confusing named parameters in example query
Jules Sagot--Gentil [Sat, 29 Jan 2022 17:25:45 +0000 (18:25 +0100)] 
fix: confusing named parameters in example query

In the named parameters example query, the name of the parameters are
Python built in data types: int and str.

This is confusing because it looks like we are casting values passed
as arguments instead of passing named arguments.

3 years agoFix typo
Benji York [Sat, 22 Jan 2022 14:35:06 +0000 (08:35 -0600)] 
Fix typo

Toilets are not to be taken lightly.

3 years agoTypo fixed
Daniele Varrazzo [Thu, 20 Jan 2022 14:37:13 +0000 (14:37 +0000)] 
Typo fixed

3 years agoMerge pull request #211 from The-One-And-Only-H/codespell
Daniele Varrazzo [Wed, 19 Jan 2022 22:17:44 +0000 (22:17 +0000)] 
Merge pull request #211 from The-One-And-Only-H/codespell

3 years agoAdd codespell to pipeline 211/head
H [Wed, 19 Jan 2022 20:56:18 +0000 (20:56 +0000)] 
Add codespell to pipeline

3 years agoConfigure codespell in tox.ini
H [Wed, 19 Jan 2022 20:57:35 +0000 (20:57 +0000)] 
Configure codespell in tox.ini

3 years agoFix spelling errors found by codespell
H [Wed, 19 Jan 2022 20:57:35 +0000 (20:57 +0000)] 
Fix spelling errors found by codespell

3 years agoRename noe function to no_e
H [Wed, 19 Jan 2022 20:57:34 +0000 (20:57 +0000)] 
Rename noe function to no_e

3 years agoabc.rst: Fix typos discovered by codespell
Christian Clauss [Sun, 16 Jan 2022 09:32:20 +0000 (10:32 +0100)] 
abc.rst: Fix typos discovered by codespell

https://pypi.org/project/codespell/

3 years agoAllow one test to fail on Windows C implementation
Daniele Varrazzo [Fri, 14 Jan 2022 03:44:56 +0000 (04:44 +0100)] 
Allow one test to fail on Windows C implementation

This test doesn't run in tox, so it doesn't benefit from repeats, and it
fails often indeed on flakey tests.

Add pytest option to tolerate a number of failures, and use it.

3 years agoDon't reset the random seed re-running failed tests
Daniele Varrazzo [Fri, 14 Jan 2022 03:17:15 +0000 (04:17 +0100)] 
Don't reset the random seed re-running failed tests

We don't want to make them pass because we didn't like the random draw.
It's not best of three.

3 years agoDrop dataclasses package from constraints file
Daniele Varrazzo [Fri, 14 Jan 2022 01:31:07 +0000 (02:31 +0100)] 
Drop dataclasses package from constraints file

It is part of the stdlib in all supported Python versions, so it is no
more an external dependency.

3 years agoAdd compatibility macro for PQsetTraceFlags
Daniele Varrazzo [Fri, 14 Jan 2022 01:01:48 +0000 (02:01 +0100)] 
Add compatibility macro for PQsetTraceFlags

Avoid a warning of implicit declaration compiling with libpq < 14.

3 years agoFix definitions for pipeline replacements macros
Daniele Varrazzo [Fri, 14 Jan 2022 00:48:12 +0000 (01:48 +0100)] 
Fix definitions for pipeline replacements macros

The previous definition caused a warning for implicit conversion from
void* to int.

3 years agoAllow passing the PIP_CONSTRAINT env var to tox
Daniele Varrazzo [Fri, 14 Jan 2022 01:23:51 +0000 (02:23 +0100)] 
Allow passing the PIP_CONSTRAINT env var to tox

This allows to run tests using the oldest, rather than the newest,
dependency packages, by passing it the tests/constraints.txt file.

3 years agoUse wheel 0.37 as minimum version
Daniele Varrazzo [Fri, 14 Jan 2022 00:07:03 +0000 (01:07 +0100)] 
Use wheel 0.37 as minimum version

It is the first version officially supporting Python 3.10
https://wheel.readthedocs.io/en/stable/news.html

3 years agoDrop explicit tests retries
Daniele Varrazzo [Thu, 13 Jan 2022 21:57:45 +0000 (22:57 +0100)] 
Drop explicit tests retries

Now we just retry all failing tests automatically.

3 years agoRetry automatically flakey tests in tox runs
Daniele Varrazzo [Thu, 13 Jan 2022 21:56:44 +0000 (22:56 +0100)] 
Retry automatically flakey tests in tox runs

3 years agoBump min version required for pytest-asyncio to 0.17.0
Daniele Varrazzo [Thu, 13 Jan 2022 19:00:14 +0000 (20:00 +0100)] 
Bump min version required for pytest-asyncio to 0.17.0

Older versions fail for the presence of asyncio_mode in pytest config,
which is required from 0.17 on instead.

3 years agoConfigure the async loop at test session start
Daniele Varrazzo [Thu, 13 Jan 2022 16:17:37 +0000 (17:17 +0100)] 
Configure the async loop at test session start

Doing it in a fixture is too late: event_loop might have already been
called if the first test running is async, and it would fail on Windows.

This started to be needed after pytest-asyncio 0.17.0 was released.
See <https://github.com/pytest-dev/pytest-asyncio/issues/256>.

3 years agoSet asyncio mode in pytest configuration
Daniele Varrazzo [Thu, 13 Jan 2022 15:17:41 +0000 (16:17 +0100)] 
Set asyncio mode in pytest configuration

Remove the warning raised in pytest-async >= 0.17.0 if the setting is
missing.

3 years agoMerge branch 'null-pool'
Daniele Varrazzo [Thu, 13 Jan 2022 14:07:52 +0000 (15:07 +0100)] 
Merge branch 'null-pool'

3 years agoMore robust null pool tests
Daniele Varrazzo [Sat, 8 Jan 2022 18:37:14 +0000 (19:37 +0100)] 
More robust null pool tests

Fix race conditions of tasks completing before a concurrent client is
queued.

Fix test relying on fixed broken behaviour of copy().

Use connection.info rather than connection.pgconn to obtain higher level
results (e.g. Enum instead of int).

3 years agoRefactor pools to reduce code duplication
Daniele Varrazzo [Sat, 8 Jan 2022 17:35:41 +0000 (18:35 +0100)] 
Refactor pools to reduce code duplication

Use common getconn/putconn implementations and implement only the
different behaviours in subclasses.

3 years agoAdd null-pools documentation
Daniele Varrazzo [Thu, 6 Jan 2022 02:39:42 +0000 (03:39 +0100)] 
Add null-pools documentation

3 years agoAdd NullPool and AsyncNullPool
Daniele Varrazzo [Mon, 3 Jan 2022 19:20:29 +0000 (20:20 +0100)] 
Add NullPool and AsyncNullPool

Close #148

3 years agoMinor changes to pool docs
Daniele Varrazzo [Sun, 9 Jan 2022 17:46:58 +0000 (18:46 +0100)] 
Minor changes to pool docs

3 years agoImprove pool docs, especially pools and connections life cycle
Daniele Varrazzo [Sun, 9 Jan 2022 14:04:55 +0000 (15:04 +0100)] 
Improve pool docs, especially pools and connections life cycle

3 years agoAdd wait parameter to pool.open()
Daniele Varrazzo [Sun, 9 Jan 2022 13:14:14 +0000 (14:14 +0100)] 
Add wait parameter to pool.open()

3 years agoRelax some timing tests tolerances
Daniele Varrazzo [Sat, 8 Jan 2022 22:37:55 +0000 (23:37 +0100)] 
Relax some timing tests tolerances

Seeing them failing regularly in Github workflows.

3 years agoDrop support for Python 3.6
Daniele Varrazzo [Sat, 8 Jan 2022 20:57:14 +0000 (21:57 +0100)] 
Drop support for Python 3.6

3 years agoBump version numbers for release
Daniele Varrazzo [Sat, 8 Jan 2022 18:57:04 +0000 (19:57 +0100)] 
Bump version numbers for release

3 years agoLeave start year only in docs footer
Daniele Varrazzo [Sat, 8 Jan 2022 01:16:57 +0000 (02:16 +0100)] 
Leave start year only in docs footer

3 years agoUpdate, once and for good, the copyright year
Daniele Varrazzo [Sat, 8 Jan 2022 01:09:05 +0000 (02:09 +0100)] 
Update, once and for good, the copyright year

After getting more information about the matter and having convinced
myself that there is no need, except FOMO, to extend the copyright year
on source code, change all our entries to leave only the start year.

    git ls-tree -r HEAD --name-only \
        | xargs sed -i '/Copyright.*\(Varrazzo\|Psycopg\)/ s/-20..//'

3 years agoDon't leave the connection ACTIVE on error in COPY_OUT
Daniele Varrazzo [Fri, 7 Jan 2022 21:06:20 +0000 (22:06 +0100)] 
Don't leave the connection ACTIVE on error in COPY_OUT

Cancel the active COPY operation if the server has not finished sending
the data yet.

Close #203.

Also fix the tests which were based on this broken behaviour. A case of
self-administered Hyrum's law.

3 years agoUse info instead of pgconn in copy tests
Daniele Varrazzo [Fri, 7 Jan 2022 21:05:02 +0000 (22:05 +0100)] 
Use info instead of pgconn in copy tests

It displays better information in case of assert failed.

3 years agoAdd prepare_threshold connection parameter
Daniele Varrazzo [Fri, 7 Jan 2022 01:07:02 +0000 (02:07 +0100)] 
Add prepare_threshold connection parameter

This can help configuring connections to use PgBouncer. It is possible
to use the attribute in the pool kwargs, for instance, instead of using
the more complex configure callback.

Close #200.

3 years agoExclude mypy 0.931 too from tests
Daniele Varrazzo [Fri, 7 Jan 2022 18:35:03 +0000 (19:35 +0100)] 
Exclude mypy 0.931 too from tests

It seems still affected by https://github.com/python/mypy/issues/11820.

3 years agoDon't overwrite the module of the psycopg.pq.pq_ctypes objects
Daniele Varrazzo [Fri, 7 Jan 2022 17:32:47 +0000 (18:32 +0100)] 
Don't overwrite the module of the psycopg.pq.pq_ctypes objects

It might be useful to tell apart the C version from the python versions
for debugging. The C versions don't do it, so they repr as:

    <psycopg_binary.pq.PGconn [IDLE] (database=piro) at 0x7f8556deb040>

See #201.

3 years agoAdd example about DDL statement with quoted parameter
Daniele Varrazzo [Fri, 7 Jan 2022 01:54:25 +0000 (02:54 +0100)] 
Add example about DDL statement with quoted parameter

See #199.

3 years agoAdd mark for pool tests
Daniele Varrazzo [Thu, 6 Jan 2022 23:23:46 +0000 (00:23 +0100)] 
Add mark for pool tests

Don't auto-skip pool test if import fails. This would miss serious
problems leading to the pool not being importable. If someone wants to
skip the pool tests they can use `-m 'not pool'` now.

3 years agoDrop broken test about setting prepare attributes on the class
Daniele Varrazzo [Fri, 7 Jan 2022 01:11:29 +0000 (02:11 +0100)] 
Drop broken test about setting prepare attributes on the class

I'm just clobbering the property here. It doesn't work. Thankfully it
wasn't documented to work...

3 years agoDon't look up other modules objects in __del__ methods
Daniele Varrazzo [Thu, 6 Jan 2022 16:09:22 +0000 (17:09 +0100)] 
Don't look up other modules objects in __del__ methods

The modules might have been already cleaned up during interpreted
shutdown. See <https://bugs.python.org/issue46256#msg409847> for an
explanation.

The stdlib guards against the same thing happening too. However they
take a reference in the function closure, which is stronger than what we
do. Doing so, on our strictly typed codebase, is a tedious chore, so, if
this is enough (it should be, according to the OP), I'm happy this way.

Close #198.

3 years agoAllow pools to have min_size = 0 as long as they can grow
Daniele Varrazzo [Thu, 6 Jan 2022 21:16:09 +0000 (22:16 +0100)] 
Allow pools to have min_size = 0 as long as they can grow

Add tests to verify they can grow from 0 no problem.

3 years agoAdd ConnectionTimeout subclass of OperationalError
Daniele Varrazzo [Wed, 5 Jan 2022 01:50:25 +0000 (02:50 +0100)] 
Add ConnectionTimeout subclass of OperationalError

To be used in the connection pool to detect timeout on connection.

Backported to Psycopg 3.0.8 to allow the pool 3.1 to work with it, at
least on diminished capacity (NullPool.connection() would time out only
for clients in the queue, not in case of new connection timeout).

3 years agoMerge branch 'pool-checks'
Daniele Varrazzo [Wed, 5 Jan 2022 22:13:52 +0000 (23:13 +0100)] 
Merge branch 'pool-checks'

3 years agoRaise PoolClosed on wait() on a closed pool
Daniele Varrazzo [Wed, 5 Jan 2022 02:24:52 +0000 (03:24 +0100)] 
Raise PoolClosed on wait() on a closed pool

Previously it might have raised an assert, if, for instance, wait would
have failed and retried.

3 years agoRaise ValueError if the pool min_size is <= 0
Daniele Varrazzo [Mon, 3 Jan 2022 18:52:44 +0000 (19:52 +0100)] 
Raise ValueError if the pool min_size is <= 0

Before it would have created a broken pool, blocking forever on getconn.

3 years agoMove some common checks to the pool base class
Daniele Varrazzo [Mon, 3 Jan 2022 18:40:11 +0000 (19:40 +0100)] 
Move some common checks to the pool base class

3 years agoUse caplog.set_level instead of manual filtering in tests
Daniele Varrazzo [Wed, 5 Jan 2022 19:23:25 +0000 (20:23 +0100)] 
Use caplog.set_level instead of manual filtering in tests

3 years agoSkip tests using the deaf_port fixture on macOS and Windows
Daniele Varrazzo [Wed, 5 Jan 2022 20:52:55 +0000 (21:52 +0100)] 
Skip tests using the deaf_port fixture on macOS and Windows

They fail some 50% of the time, looks like the port is not really
listening, the fact that the function is called listen() is just a
practical joke.

https://github.com/psycopg/psycopg/runs/4719288041?check_suite_focus=true

3 years agoAdd deaf_port fixture and base timeout tests on it
Daniele Varrazzo [Wed, 5 Jan 2022 00:53:07 +0000 (01:53 +0100)] 
Add deaf_port fixture and base timeout tests on it

3 years agoMerge branch 'pool-open'
Daniele Varrazzo [Mon, 3 Jan 2022 18:47:38 +0000 (19:47 +0100)] 
Merge branch 'pool-open'

3 years agoUse the present tense in PoolClosed error messages 196/head
Daniele Varrazzo [Mon, 3 Jan 2022 15:59:29 +0000 (16:59 +0100)] 
Use the present tense in PoolClosed error messages

Thank you John Aldis! https://twitter.com/johnaldis/status/1478016200634425348

3 years agoReport if the pool was closed, or never opened, in getconn() error message
Daniele Varrazzo [Mon, 3 Jan 2022 14:37:54 +0000 (15:37 +0100)] 
Report if the pool was closed, or never opened, in getconn() error message

3 years agoAdd API docs for pool open method/param.
Daniele Varrazzo [Mon, 3 Jan 2022 14:10:54 +0000 (15:10 +0100)] 
Add API docs for pool open method/param.

3 years agoAsyncConnectionPool.open() made async.
Daniele Varrazzo [Mon, 3 Jan 2022 15:03:48 +0000 (16:03 +0100)] 
AsyncConnectionPool.open() made async.

This makes it symmetrical with close(). However it doesn't really do any
async work as it's awkward to call it from init. Something we might do,
if that will be needed, could be to start the scheduler only and use it
to schedule immediately a call to an async _open().

In the future, an anyio-based pool might instead disallow open=True on
init.

See https://github.com/psycopg/psycopg/pull/151 for some discussion
about the topic.

3 years agoAdd open param to pool init
Daniele Varrazzo [Mon, 3 Jan 2022 12:09:38 +0000 (13:09 +0100)] 
Add open param to pool init

3 years agoDisallow pool re-opening
Denis Laxalde [Tue, 16 Nov 2021 09:55:26 +0000 (10:55 +0100)] 
Disallow pool re-opening

There seems to be no use case for re-opening a closed pool, so disable
this now (until we find a real use-case).

3 years agoFactor out a _stop_workers() method on connection pool classes
Denis Laxalde [Mon, 15 Nov 2021 08:43:04 +0000 (09:43 +0100)] 
Factor out a _stop_workers() method on connection pool classes

The method is symmetrical with open().
In particular, we take advantage of this method in
ConnectionPool.__del__() to remove some duplication.

3 years agoReset workers state in *ConnectionPool.close()
Denis Laxalde [Mon, 15 Nov 2021 08:28:36 +0000 (09:28 +0100)] 
Reset workers state in *ConnectionPool.close()

This way, the pools may be re-opened after a close, even if we'll
disallow this later on.

3 years agoAdd an open() method to connection pool classes
Denis Laxalde [Mon, 15 Nov 2021 08:13:04 +0000 (09:13 +0100)] 
Add an open() method to connection pool classes

This method is responsible for setting the '_closed' attribute, which
hence now defaults to True in the base class, along with the
_sched_runner attribute, which is reset to None in close().

3 years agoRemove occurrences of "thread" term in pool_async
Denis Laxalde [Thu, 11 Nov 2021 17:41:27 +0000 (18:41 +0100)] 
Remove occurrences of "thread" term in pool_async

There is no threading involved here, only async tasks. Adjust comments
and docstrings to avoid confusion.

3 years agoSeparate pool packages building into a different workflow
Daniele Varrazzo [Mon, 3 Jan 2022 15:37:37 +0000 (16:37 +0100)] 
Separate pool packages building into a different workflow

Psycopg and pool releases are separate.

3 years agoBump pool minor version to start adding features
Daniele Varrazzo [Mon, 3 Jan 2022 12:35:04 +0000 (13:35 +0100)] 
Bump pool minor version to start adding features

3 years agoHopefully more robust test to identify a closed connection
Daniele Varrazzo [Sun, 2 Jan 2022 21:19:15 +0000 (22:19 +0100)] 
Hopefully more robust test to identify a closed connection

3 years agoMerge branch 'executemany-returning'
Daniele Varrazzo [Sun, 2 Jan 2022 21:15:24 +0000 (22:15 +0100)] 
Merge branch 'executemany-returning'

3 years agoAdd returning parameter on executemany() 181/head
Daniele Varrazzo [Sun, 2 Jan 2022 19:37:14 +0000 (20:37 +0100)] 
Add returning parameter on executemany()

3 years agoKeep results from all queries run through executemany()
Denis Laxalde [Wed, 15 Dec 2021 12:57:31 +0000 (13:57 +0100)] 
Keep results from all queries run through executemany()

Instead of overwriting cursor's results at each execution in
executemany() we now accumulate the results of all queries on cursor
state by turning _set_results() into _extend_results(). This way, each
result remains accessible and one can use nextset() to move from one
result to another.

3 years agoDrop unneeded method signatures in docs
Daniele Varrazzo [Sun, 2 Jan 2022 20:02:26 +0000 (21:02 +0100)] 
Drop unneeded method signatures in docs

3 years agoRename a couple of internal cursor methods for clarity
Daniele Varrazzo [Sun, 2 Jan 2022 18:47:37 +0000 (19:47 +0100)] 
Rename a couple of internal cursor methods for clarity

3 years agoRefactor cur._raise_from_results() into _raise_for_result()
Daniele Varrazzo [Sun, 2 Jan 2022 18:46:32 +0000 (19:46 +0100)] 
Refactor cur._raise_from_results() into _raise_for_result()

The case of raising with different statuses doesn't practically happen.

3 years agoDrop Cursor._set_results()
Daniele Varrazzo [Sun, 2 Jan 2022 18:22:34 +0000 (19:22 +0100)] 
Drop Cursor._set_results()

Split it into a _check_results() and leave the caller manage the cursor state.

3 years agoShorten traceback on executemany
Daniele Varrazzo [Sun, 2 Jan 2022 19:06:45 +0000 (20:06 +0100)] 
Shorten traceback on executemany

3 years agoFix typo in comment
Daniele Varrazzo [Sun, 2 Jan 2022 18:59:02 +0000 (19:59 +0100)] 
Fix typo in comment

3 years agoFix test suite to run on database in locales different from English
Daniele Varrazzo [Sun, 2 Jan 2022 17:58:17 +0000 (18:58 +0100)] 
Fix test suite to run on database in locales different from English

3 years agoNote in news file that 3.0.8 is still unreleased
Daniele Varrazzo [Sun, 2 Jan 2022 17:03:08 +0000 (18:03 +0100)] 
Note in news file that 3.0.8 is still unreleased

3 years agoFix spurious warning about variable referenced before assignment
Daniele Varrazzo [Sun, 2 Jan 2022 16:54:36 +0000 (17:54 +0100)] 
Fix spurious warning about variable referenced before assignment

3 years agoAdd flake8 configuration in other package dirs
Daniele Varrazzo [Sun, 2 Jan 2022 15:57:47 +0000 (16:57 +0100)] 
Add flake8 configuration in other package dirs

Vim ALE is confused otherwise. I don't really get how is that it picks
the package directory as the starting one (maybe it finds the setup.py)?

3 years agoChange type of `wait` in `pool_async.py` 195/head
Nikita Sobolev [Sun, 2 Jan 2022 11:51:11 +0000 (14:51 +0300)] 
Change type of `wait` in `pool_async.py`

Will become an incompatible type in assignment with the release of
https://github.com/python/typeshed/pull/6783

3 years agoFix py_codecs data type
Daniele Varrazzo [Sun, 2 Jan 2022 15:37:09 +0000 (16:37 +0100)] 
Fix py_codecs data type

It doesn't contain str anymore since 3.0.4.

A stricter definition revealed a couple of wrong usages of the mapping.
Use more consistently the higher level `conninfo_encoding()` function
instead of directly the mapping.

3 years agoUse conninfo encoding to encode errors on connection
Daniele Varrazzo [Sun, 2 Jan 2022 14:37:54 +0000 (15:37 +0100)] 
Use conninfo encoding to encode errors on connection

PostgreSQL returns connection errors in the encoding specified in
lc_messages (e.g. EUC-JP for a server with `lc_messages=ja_JP.EUC-JP`).
However, because we don't have a connection, the message was decoded in
the fallback utf-8.

If the client has specified a client_encoding, use it to decode the
error message. Be more lenient than usual to look up the encoding
(because it is not normalised by the server and we don't care about
performance as this only happens on error handling). As for any other
error messages, still use an error=replace policy to avoid exploding
reporting an error in the wrong encoding.

Close #194.

3 years agoFix typo: a raw data -> raw data
Daniele Varrazzo [Wed, 29 Dec 2021 21:42:58 +0000 (22:42 +0100)] 
Fix typo: a raw data -> raw data

3 years agoFix doc link to transactions management
Daniele Varrazzo [Wed, 29 Dec 2021 21:32:41 +0000 (22:32 +0100)] 
Fix doc link to transactions management

Also, "transactions", not "transaction".

3 years agoAdd note about installing libpq via psql
Daniele Varrazzo [Fri, 24 Dec 2021 07:59:31 +0000 (08:59 +0100)] 
Add note about installing libpq via psql

3 years agoMerge branch 'dependencies-bounds'
Daniele Varrazzo [Thu, 23 Dec 2021 17:26:29 +0000 (18:26 +0100)] 
Merge branch 'dependencies-bounds'