summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-06-15 22:58:04 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-06-15 22:58:04 -0400
commitd826d99544c5c2ec2f7ba1645273fa138b5ec74a (patch)
tree47261da67ea070dd7da9f25f4c1b9777aa19bc6a
parent9612e2fbb5b8e49b58c0a93a6cb154f81545f2db (diff)
downloadsqlalchemy-d826d99544c5c2ec2f7ba1645273fa138b5ec74a.tar.gz
- changelog
- docs
-rw-r--r--doc/build/changelog/changelog_08.rst8
-rw-r--r--doc/build/changelog/changelog_09.rst9
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py5
-rw-r--r--lib/sqlalchemy/dialects/postgresql/psycopg2.py6
4 files changed, 25 insertions, 3 deletions
diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst
index ffb2a24d4..1eed675eb 100644
--- a/doc/build/changelog/changelog_08.rst
+++ b/doc/build/changelog/changelog_08.rst
@@ -7,6 +7,14 @@
:version: 0.8.2
.. change::
+ :tags: feature, postgresql
+ :tickets: 2072
+
+ Added support for "AUTOCOMMIT" isolation when using the psycopg2
+ DBAPI. The keyword is available via the ``isolation_level``
+ execution option. Patch courtesy Roman Podolyaka.
+
+ .. change::
:tags: bug, orm
:tickets: 2759
diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst
index 288642817..98577a02e 100644
--- a/doc/build/changelog/changelog_09.rst
+++ b/doc/build/changelog/changelog_09.rst
@@ -7,6 +7,15 @@
:version: 0.9.0
.. change::
+ :tags: feature, postgresql
+ :tickets: 2072
+
+ Added support for "AUTOCOMMIT" isolation when using the psycopg2
+ DBAPI. The keyword is available via the ``isolation_level``
+ execution option. Patch courtesy Roman Podolyaka.
+ Also in 0.8.2.
+
+ .. change::
:tags: bug, orm
:tickets: 2759
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 0810e0384..bb2a44cd2 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -47,7 +47,7 @@ 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``,
+parameter include ``READ COMMITTED``, ``READ UNCOMMITTED``, ``REPEATABLE READ``,
and ``SERIALIZABLE``::
engine = create_engine(
@@ -57,7 +57,8 @@ and ``SERIALIZABLE``::
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`.
+remains the same. The psycopg2 dialect also includes support
+for ``AUTOCOMMIT`` isolation - see :ref:`psycopg2_isolation`.
Remote / Cross-Schema Table Introspection
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
index c7f9f0187..7b64f8292 100644
--- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py
+++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
@@ -61,7 +61,11 @@ The following DBAPI-specific options are respected when used with
* isolation_level - Set the transaction isolation level for the lifespan of a
:class:`.Connection` (can only be set on a connection, not a statement
or query). This includes the options ``SERIALIZABLE``, ``READ COMMITTED``,
- ``READ UNCOMMITTED`` and ``REPEATABLE READ``.
+ ``READ UNCOMMITTED``, ``REPEATABLE READ``, and ``AUTOCOMMIT``.
+
+ .. versionadded:: 0.8.2 support for AUTOCOMMIT isolation level when using
+ psycopg2.
+
* stream_results - Enable or disable usage of server side cursors.
If ``None`` or not set, the ``server_side_cursors`` option of the
:class:`.Engine` is used.