2010-02-09 07:58:28 +03:00
|
|
|
=================================================
|
|
|
|
Psycopg -- PostgreSQL database adapter for Python
|
|
|
|
=================================================
|
|
|
|
|
|
|
|
.. sectionauthor:: Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
|
|
|
|
2012-10-07 05:07:47 +04:00
|
|
|
Psycopg_ is the most popular PostgreSQL_ database adapter for the Python_
|
|
|
|
programming language. Its main features are the complete implementation of
|
|
|
|
the Python |DBAPI|_ 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
|
2012-12-02 20:00:31 +04:00
|
|
|
of concurrent :sql:`INSERT`\s or :sql:`UPDATE`\s.
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2011-12-16 02:13:20 +04:00
|
|
|
Psycopg 2 is mostly implemented in C as a libpq_ wrapper, resulting in being
|
|
|
|
both efficient and secure. It features client-side and :ref:`server-side
|
|
|
|
<server-side-cursors>` cursors, :ref:`asynchronous communication
|
|
|
|
<async-support>` and :ref:`notifications <async-notify>`, |COPY-TO-FROM|__
|
|
|
|
support, and a flexible :ref:`objects adaptation system
|
2011-12-16 01:42:08 +04:00
|
|
|
<python-types-adaptation>`. Many basic Python types are supported
|
|
|
|
out-of-the-box and mapped to matching PostgreSQL data types, such as strings
|
2012-10-07 05:07:47 +04:00
|
|
|
(both byte strings and Unicode), numbers (ints, longs, floats, decimals),
|
|
|
|
booleans and date/time objects (both built-in and `mx.DateTime`_), several
|
|
|
|
types of :ref:`binary objects <adapt-binary>`. Also available are mappings
|
|
|
|
between lists and PostgreSQL arrays of any supported type, between
|
|
|
|
:ref:`dictionaries and PostgreSQL hstore <adapt-hstore>`, between
|
|
|
|
:ref:`tuples/namedtuples and PostgreSQL composite types <adapt-composite>`,
|
|
|
|
and between Python objects and :ref:`JSON <adapt-json>`.
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2011-12-16 02:13:20 +04:00
|
|
|
Psycopg 2 is both Unicode and Python 3 friendly.
|
2011-12-16 01:42:08 +04:00
|
|
|
|
|
|
|
|
|
|
|
.. _Psycopg: http://initd.org/psycopg/
|
2010-02-09 07:58:28 +03:00
|
|
|
.. _PostgreSQL: http://www.postgresql.org/
|
|
|
|
.. _Python: http://www.python.org/
|
2012-02-28 20:28:07 +04:00
|
|
|
.. _libpq: http://www.postgresql.org/docs/current/static/libpq.html
|
2010-02-11 06:15:14 +03:00
|
|
|
.. |COPY-TO-FROM| replace:: :sql:`COPY TO/COPY FROM`
|
2012-02-28 20:28:07 +04:00
|
|
|
.. __: http://www.postgresql.org/docs/current/static/sql-copy.html
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2010-02-15 06:10:43 +03:00
|
|
|
|
|
|
|
.. rubric:: Contents
|
2010-02-09 07:58:28 +03:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 2
|
|
|
|
|
2012-10-07 05:04:39 +04:00
|
|
|
install
|
2010-02-09 07:58:28 +03:00
|
|
|
usage
|
|
|
|
module
|
|
|
|
connection
|
|
|
|
cursor
|
|
|
|
advanced
|
|
|
|
extensions
|
|
|
|
tz
|
2010-02-26 02:00:52 +03:00
|
|
|
pool
|
2010-02-09 07:58:28 +03:00
|
|
|
extras
|
2010-02-13 08:25:21 +03:00
|
|
|
errorcodes
|
2010-02-18 06:51:17 +03:00
|
|
|
faq
|
2013-03-18 19:42:10 +04:00
|
|
|
news
|
2010-02-09 07:58:28 +03:00
|
|
|
|
|
|
|
|
2010-02-14 17:45:15 +03:00
|
|
|
.. ifconfig:: builder != 'text'
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2010-02-14 17:45:15 +03:00
|
|
|
.. rubric:: Indices and tables
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2010-02-14 17:45:15 +03:00
|
|
|
* :ref:`genindex`
|
|
|
|
* :ref:`search`
|
2010-02-09 07:58:28 +03:00
|
|
|
|
|
|
|
|
2010-02-14 17:45:15 +03:00
|
|
|
.. ifconfig:: todo_include_todos
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2010-02-14 17:45:15 +03:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
**To Do items in the documentation**
|
2010-02-09 07:58:28 +03:00
|
|
|
|
2010-02-14 17:45:15 +03:00
|
|
|
.. todolist::
|
2010-02-09 07:58:28 +03:00
|
|
|
|