=pg8000

pg8000 is a pure-[[http://www.python.org/|Python]]
[[http://www.postgresql.org/|PostgreSQL]] driver that complies with
[[http://www.python.org/dev/peps/pep-0249/|DB-API 2.0]]. The driver
communicates with the database using the
[[http://www.postgresql.org/docs/9.1/static/protocol.html|PostgreSQL Backend
 / Frontend Protocol]].

Links:

* [[https://pypi.python.org/pypi/pg8000|User Docs]].
* [[https://groups.google.com/forum/#!forum/pg8000|Forum]]
* [[https://github.com/mfenniak/pg8000|Code, bugs, feature requests etc.]]

=Regression Tests

To run the regression tests, install [[http://testrun.org/tox/latest/|tox]]:

{{{
pip install tox
}}}

then add install all the supported Python versions, and add a line to
pg_hba.conf requiring md5 for the database pg8000_md5, eg.

{{{
host    pg8000_md5      all             127.0.0.1/32            md5
}}}

and run {{{tox}}} from the {{{pg8000}}} directory:

{{{
tox
}}}

The pg8000.tests.tests_1_8 package are a copy of the tests from the 1.8 release
and are kept to make sure we retain backward compatibility with it. It will
probably be removed in a 2.0 release.

Unfortunately, {{{tox}}} doesn't support Python 2.5, so to test CPython 2.5 and
Jython 2.5, run the {{{run_25}}} script.

==Performance Tests

To run the performance tests from the {{{pg8000}}} directory:

{{{
python -m pg8000.tests.performance
}}}

==Stress Test

There's a stress test that is run by doing:

{{{
python ./multi
}}}

The idea is to set {{{shared_buffers}} in postgresql.conf to 128kB, and then
run the stress test, and you should get {{{no unpinned buffers}}} errors.

=Building The Documentation

The docs are written using [[http://sphinx-doc.org/|Sphinx]]. To build them,
install sphinx:

{{{
pip install sphinx
}}}

Then type:

{{{
python setup.py build_sphinx
}}}

and the docs will appear in {{{build/sphinx/html}}}.

=Doing A Release Of pg8000

Run {{{tox}}} and {{{run_25}}} to make sure all tests pass, then update
{{{doc/release_notes.rst}} then do:

{{{
git tag -a x.y.z -m "Version x.y.z"
python setup.py register sdist upload build_sphinx upload_docs
}}}

Then post a message to the forum.
