| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Close #325, close #706.
|
| |
|
|
| |
Fix #679
|
| |
|
|
|
|
|
| |
Use a macro trick to add the quotes. This seems more portable than
passing the quotes to the command line (see #658).
https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
|
| |
|
|
|
| |
timeradd is missing on Solaris 10, but is present as a macro in
<sys/time.h> on SmartOS, illumos, and likely Solaris 11.
|
| |
|
|
| |
Regression on unsupported Postgres versions after fixing bug #580
|
| | |
|
| |
|
|
| |
Fix #579.
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
|
|
| |
Many editors automatically trim whitespace on save. By trimming all
files in one go, makes future diffs cleaner without extraneous
whitespace changes.
|
| |
|
|
| |
Closes #633.
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| | |
Solaris does not have timeradd and timersub. Add solaris_support.c which
provides emulated versions of them on Solaris.
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
| |
It was registered as side effect of an excessive definition that got
cleaned up in 338dbe70a6c78c7edddea985e2386ebd864378c6.
Looking at other removed redundant type oids, this was the only one
missing from the `string_types` map.
Close #578.
|
| |
|
|
| |
Close #554
|
| |
|
|
| |
Using integers the wrong size. Faithfully segfaulting since 1970.
|
| |
|
|
|
|
| |
Should close #558, but I'm curious to know if a number is returned
for interval < 1 day too (which wouldn't trigger the overflow, but will
finish parsing with part=0).
|
| |
|
|
|
|
| |
The wrong associations are overwritten in the typecaster map by the
right ones, so they have been harmless to date, but only because of the
order of creation of the adapters.
|
| |
|
|
|
|
|
|
|
| |
It fails on Py3 after receiving a SIGABRT. Because we don't handle it
here it will resurface later with nonsense such as:
SystemError: <some function> returned a result with an error set
Close #551
|
| |\ |
|
| | |
| |
| |
| | |
Close #547.
|
| |\ \ |
|
| | |/ |
|
| |/ |
|
| |
|
|
| |
Close #410
|
| |
|
|
| |
Close #536.
|
| |
|
|
|
|
| |
Some extra bonus refactoring to improve the function readability (don't
reuse names for variables with different refcount rules, don't pass
separate obj/self, async pass-through...)
|
| |
|
|
|
|
| |
Note that we don't leak anymore the password length.
Fix #528
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From the DB-API (https://www.python.org/dev/peps/pep-0249/):
OperationalError
Exception raised for errors that are related to the database's
operation and not necessarily under the control of the programmer,
e.g. an unexpected disconnect occurs, [...]
Additionally, psycopg2 was inconsistent, at least in the async case:
depending on how the "connection closed" error was reported from the
kernel to libpq, it would sometimes raise OperationalError and
sometimes DatabaseError. Now it always raises OperationalError.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's a race condition that only seems to happen over Unix-domain
sockets. Sometimes, the closed socket is reported by the kernel to
libpq like this (captured with strace):
sendto(3, "Q\0\0\0\34select pg_backend_pid()\0", 29, MSG_NOSIGNAL, NULL, 0) = 29
recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating "..., 16384, 0, NULL, NULL) = 110
recvfrom(3, 0x12d0330, 16384, 0, 0, 0) = -1 ECONNRESET (Connection reset by peer)
That is, psycopg2/libpq sees no error when sending the first query
after the connection is closed, but gets an error reading the result.
In that case, everything worked fine.
But sometimes, the error manifests like this:
sendto(3, "Q\0\0\0\34select pg_backend_pid()\0", 29, MSG_NOSIGNAL, NULL, 0) = -1 EPIPE (Broken pipe)
recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating "..., 16384, 0, NULL, NULL) = 110
recvfrom(3, "", 16274, 0, NULL, NULL) = 0
recvfrom(3, "", 16274, 0, NULL, NULL) = 0
i.e. libpq received an error when sending the query. This manifests as
a slightly different exception from a slightly different place. More
importantly, in this case connection.closed is left at 0 rather than
being set to 2, and that is the bug I'm fixing here.
Note that we see almost identical behaviour for sync and async
connections, and the fixes are the same. So I added extremely similar
test cases.
Finally, there is still a bug here: for async connections, we
sometimes raise DatabaseError (incorrect) and sometimes raise
OperationalError (correct). Will fix that next.
|
| |
|
|
|
|
|
| |
Only defined in Postgres 9.3
Should close #520, but let's wait for the CI response (build on
Windows etc.)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
(almost... except for micros rounding)
While this is probably an improvement on the previous implementation,
I am largely waving a dead chicken at windows, which keeps failing to
pass the seconds overflow test. If it doesn't pass now either I'll start
blaming Python's timedelta.
|
| |
|
|
|
| |
Previous commit doesn't pass on Windows: it looks like window's floor()
has an integer overflow.
|
| |
|
|
| |
Close #512.
|
| |
|
|
|
|
| |
When moving from autocommit True -> False reset only the server
parameters that were actually specified by psycopg to honour the
serssion characteristics.
|
| | |
|
| | |
|
| |
|
|
| |
Legacy method is legacy.
|
| | |
|
| |
|
|
|
| |
Apparently only MSVC 2015 x64 had defined these types. Changed check to
work for all versions of MSVC. Does not affect 2015x64.
|