mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +03:00
PostgreSQL database adapter for the Python programming language
f64cbeda46
over some tests for serialisation and deadlock errors, demonstrating that TransactionRollbackError is generated. (QueryCancelationTests): add a test to show that QueryCanceledError is raised on statement timeouts. * psycopg2da/adapter.py (_handle_psycopg_exception): rather than checking exception messages, check for TransactionRollbackError. * psycopg/pqpath.c (exception_from_sqlstate): return TransactionRollbackError for 40xxx errors, and QueryCanceledError for 57014 errors. (pq_raise): If we are using an old server, use TransactionRollbackError if the error message contains "could not serialize" or "deadlock detected". * psycopg/psycopgmodule.c (_psyco_connect_fill_exc): remove function, since we no longer need to store pointers to the exceptions in the connection. This also fixes a reference leak. (psyco_connect): remove _psyco_connect_fill_exc() function call. * psycopg/connection.h (connectionObject): remove exception members from struct. * psycopg/connection_type.c (connectionObject_getsets): modify the exception attributes on the connection object from members to getsets. This reduces the size of the struct. * lib/extensions.py: import the two new extensions. * psycopg/psycopgmodule.c (exctable): add new QueryCanceledError and TransactionRollbackError exceptions. |
||
---|---|---|
debian | ||
doc | ||
examples | ||
lib | ||
psycopg | ||
psycopg2da | ||
sandbox | ||
scripts | ||
tests | ||
ZPsycopgDA | ||
AUTHORS | ||
ChangeLog | ||
INSTALL | ||
LICENSE | ||
Makefile | ||
MANIFEST.in | ||
NEWS | ||
psycopg2.mdp | ||
psycopg2.mds | ||
psycopg2.usertasks | ||
README | ||
setup.cfg | ||
setup.py |
psycopg - Python-PostgreSQL Database Adapter ******************************************** psycopg is a PostgreSQL database adapter for the Python programming language. This is version 2, a complete rewrite of the original code to provide new-style classes for connection and cursor objects and other sweet candies. Like the original, psycopg 2 was written with the aim of being very small and fast, and stable as a rock. psycopg is different from the other database adapter because it was designed for heavily multi-threaded applications that create and destroy lots of cursors and make a conspicuous number of concurrent INSERTs or UPDATEs. psycopg 2 also provide full asycronous operations for the really brave programmer. There are confirmed reports of psycopg 1.x compiling and running on Linux and FreeBSD on i386, Solaris, MacOS X and win32 architectures. psycopg 2 does not introduce build-wise incompatible changes so it should be able to compile on all architectures just as its predecessor did. Now go read the INSTALL file. More information about psycopg extensions to the DBAPI-2.0 is available in the files located in the doc/ direcory. psycopg is free software ("free as in freedom" but I like beer too.) Licensing information is available in the LICENSE file. Contributors ------------ A short list of contributors to psycopg2 follows (if you feel you belong to this list and you can't find yourself here just drop me a mail): * Kudos to piro for all the documentation work. * Peter Fein contributed a logging connection/cursor class that even if it was not used directly heavily influenced the implementation currently in psycopg2.extras.