<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/psycopg2.git/psycopg/pqpath.c, branch separate-binary</title>
<subtitle>github.com: psycopg/psycopg2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/'/>
<entry>
<title>Collect rowcount in executemany even when discarding results</title>
<updated>2017-11-29T15:38:02+00:00</updated>
<author>
<name>Daniele Varrazzo</name>
<email>daniele.varrazzo@gmail.com</email>
</author>
<published>2017-11-29T15:28:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=a5fd594ea428e3e8c11a632b1e3fd47df0cec2ab'/>
<id>a5fd594ea428e3e8c11a632b1e3fd47df0cec2ab</id>
<content type='text'>
Closes #633.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #633.
</pre>
</div>
</content>
</entry>
<entry>
<title>Emulate timeradd and timersub on Solaris</title>
<updated>2017-10-26T18:21:30+00:00</updated>
<author>
<name>My Karlsson</name>
<email>mk@acc.umu.se</email>
</author>
<published>2017-10-26T18:11:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=f54783ae6e6de44dafcecefdc8963c58a2ed98b9'/>
<id>f54783ae6e6de44dafcecefdc8963c58a2ed98b9</id>
<content type='text'>
Solaris does not have timeradd and timersub. Add solaris_support.c which
provides emulated versions of them on Solaris.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Solaris does not have timeradd and timersub. Add solaris_support.c which
provides emulated versions of them on Solaris.
</pre>
</div>
</content>
</entry>
<entry>
<title>Check return code from decoding the connection status</title>
<updated>2017-06-15T16:33:05+00:00</updated>
<author>
<name>Daniele Varrazzo</name>
<email>daniele.varrazzo@gmail.com</email>
</author>
<published>2017-06-15T16:24:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=602c74faa662196f9c596fb67276c766c8dfdcbd'/>
<id>602c74faa662196f9c596fb67276c766c8dfdcbd</id>
<content type='text'>
It fails on Py3 after receiving a SIGABRT. Because we don't handle it
here it will resurface later with nonsense such as:

    SystemError: &lt;some function&gt; returned a result with an error set

Close #551
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It fails on Py3 after receiving a SIGABRT. Because we don't handle it
here it will resurface later with nonsense such as:

    SystemError: &lt;some function&gt; returned a result with an error set

Close #551
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't clobber a Python exception with an unknown error</title>
<updated>2017-04-05T13:54:07+00:00</updated>
<author>
<name>Daniele Varrazzo</name>
<email>daniele.varrazzo@gmail.com</email>
</author>
<published>2017-04-05T13:05:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=a66c34a6d098623617d675191a4c82f60de1d662'/>
<id>a66c34a6d098623617d675191a4c82f60de1d662</id>
<content type='text'>
Close #410
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close #410
</pre>
</div>
</content>
</entry>
<entry>
<title>Always raise OperationalError when connection was closed externally.</title>
<updated>2017-03-14T12:14:00+00:00</updated>
<author>
<name>Greg Ward</name>
<email>gward@dyn.com</email>
</author>
<published>2016-06-28T22:03:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=12317557da20d84baf12054d8dfce11ba8976cb6'/>
<id>12317557da20d84baf12054d8dfce11ba8976cb6</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Always detect when a connection is closed behind psycopg2's back.</title>
<updated>2017-03-14T12:08:03+00:00</updated>
<author>
<name>Greg Ward</name>
<email>gward@dyn.com</email>
</author>
<published>2016-06-28T21:46:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=b203a7c775c5f81f59c6b4205c3c33455ceeec3d'/>
<id>b203a7c775c5f81f59c6b4205c3c33455ceeec3d</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed MSVC compiler error and warning</title>
<updated>2017-02-10T03:54:29+00:00</updated>
<author>
<name>Jason Erickson</name>
<email>jerickso@stickpeople.com</email>
</author>
<published>2017-02-10T03:54:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=83cf908c88de1b6feff51f5529a0d14491354c5d'/>
<id>83cf908c88de1b6feff51f5529a0d14491354c5d</id>
<content type='text'>
MSVC doesn't like referencing new initialized variables in the variable
declaration section.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MSVC doesn't like referencing new initialized variables in the variable
declaration section.
</pre>
</div>
</content>
</entry>
<entry>
<title>Dropped compiler warning about signed/unsigned comparisons</title>
<updated>2017-02-08T08:44:08+00:00</updated>
<author>
<name>Daniele Varrazzo</name>
<email>daniele.varrazzo@gmail.com</email>
</author>
<published>2017-02-07T19:07:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=d2cd1236a8638eeee39d78187e76572ed6bfc19d'/>
<id>d2cd1236a8638eeee39d78187e76572ed6bfc19d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed BEGIN; SET TRANSACTION with PG 7.4</title>
<updated>2017-02-07T00:58:29+00:00</updated>
<author>
<name>Daniele Varrazzo</name>
<email>daniele.varrazzo@gmail.com</email>
</author>
<published>2017-02-07T00:40:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=7485fabe4fb460fdab33296cc86fc33e17aaef47'/>
<id>7485fabe4fb460fdab33296cc86fc33e17aaef47</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Set default_transaction_* GUC if session state is changed in autocomit</title>
<updated>2017-02-04T15:19:41+00:00</updated>
<author>
<name>Daniele Varrazzo</name>
<email>daniele.varrazzo@gmail.com</email>
</author>
<published>2017-02-04T15:19:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/psycopg2.git/commit/?id=9054eeccc0460908865e5462973fd82c148a9315'/>
<id>9054eeccc0460908865e5462973fd82c148a9315</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
