Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Python PostgreSQL adapter - piro's development branches
C Python Other
Pull request Compare This branch is even with psycopg:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
doc Add psycopg2.extensions.quote_ident.
examples cleanup remaining GPL license text
lib Add psycopg2.extensions.quote_ident.
psycopg Fix stale Dprintfs in pqpath.c referring to 'status'
sandbox cleanup remaining GPL license text
scripts Don't need to build the env for a sdist
tests Proper unicode handling in quote_ident.
.gitignore Added scripts to release and upload docs
.travis.yml Add .travis.yml for Travis CI (
AUTHORS Preparing release 2.3.0-beta1
INSTALL Dropped content from the INSTALL file
LICENSE Changes license to LGPL3 + OpenSSL exception on all source files Added missing files needed to build the docs
Makefile Docs build process and docs cleaned up
NEWS Mention quote_ident() in NEWS file
README.rst Direct link to the install docs in the readme
psycopg2.cproj Dropped outdated HACKING file
psycopg2.sln New 'withhold' parameter for connection.cursor()
setup.cfg Dropped PG_VERSION_HEX constant
tox.ini Dropped Zope support


psycopg2 - Python-PostgreSQL Database Adapter

Psycopg is the most popular PostgreSQL database adapter for the Python programming language. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share the same connection). It was designed for heavily multi-threaded applications that create and destroy lots of cursors and make a large number of concurrent "INSERT"s or "UPDATE"s.

Psycopg 2 is mostly implemented in C as a libpq wrapper, resulting in being both efficient and secure. It features client-side and server-side cursors, asynchronous communication and notifications, "COPY TO/COPY FROM" support. Many Python types are supported out-of-the-box and adapted to matching PostgreSQL data types; adaptation can be extended and customized thanks to a flexible objects adaptation system.

Psycopg 2 is both Unicode and Python 3 friendly.


Documentation is included in the 'doc' directory and is available online.


If all the dependencies are met (i.e. you have the Python and libpq development packages installed in your system) the standard:

python build
sudo python install

should work no problem. In case you have any problem check the 'install' and the 'faq' documents in the docs or online.

For any other resource (source code repository, bug tracker, mailing list) please check the project homepage.

Something went wrong with that request. Please try again.