summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-02-12 18:07:41 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-02-12 18:07:41 -0500
commitd101c597f57bfa7a72636b8e76a14d5c9f82bfd4 (patch)
treecfa685294da543c57fec0ee2edd9b09710f86ff8 /lib/sqlalchemy/dialects/postgresql/base.py
parentd50ea3eabf49a8f881a4a21dbafd471bd6510ba8 (diff)
downloadsqlalchemy-d101c597f57bfa7a72636b8e76a14d5c9f82bfd4.tar.gz
- [feature] Added support for the "isolation_level"
parameter to all MySQL dialects. Thanks to mu_mind for the patch here. [ticket:2394] - add documentation examples for mysql, postgresql - pep8ing
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 69c11d80f..c4c2bbdb4 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -47,9 +47,18 @@ Transaction Isolation Level
:func:`.create_engine` accepts an ``isolation_level`` parameter which results
in the command ``SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL
<level>`` being invoked for every new connection. Valid values for this
-parameter are ``READ_COMMITTED``, ``READ_UNCOMMITTED``, ``REPEATABLE_READ``,
-and ``SERIALIZABLE``. Note that the psycopg2 dialect does *not* use this
-technique and uses psycopg2-specific APIs (see that dialect for details).
+parameter are ``READ COMMITTED``, ``READ UNCOMMITTED``, ``REPEATABLE READ``,
+and ``SERIALIZABLE``::
+
+ engine = create_engine(
+ "postgresql+pg8000://scott:tiger@localhost/test",
+ isolation_level="READ UNCOMMITTED"
+ )
+
+When using the psycopg2 dialect, a psycopg2-specific method of setting
+transaction isolation level is used, but the API of ``isolation_level``
+remains the same - see :ref:`psycopg2_isolation`.
+
Remote / Cross-Schema Table Introspection
-----------------------------------------