summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-08-10 10:24:02 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-08-10 10:24:02 -0400
commita793b8e05069db9ca97b6adbb36fa1110561d30e (patch)
tree26f9a489920a1c878478b2b555cbee5a952d94c9 /lib/sqlalchemy/dialects/postgresql/base.py
parent331141d936478b9d892fc51d094ef0c7e01f5d3e (diff)
downloadsqlalchemy-a793b8e05069db9ca97b6adbb36fa1110561d30e.tar.gz
- Fixed the psycopg2 dialect to use its
set_isolation_level() method instead of relying upon the base "SET SESSION ISOLATION" command, as psycopg2 resets the isolation level on each new transaction otherwise.
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 5eba16372..89769b8c0 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -39,16 +39,17 @@ apply; no RETURNING clause is emitted nor is the sequence pre-executed in this
case.
To force the usage of RETURNING by default off, specify the flag
-``implicit_returning=False`` to :func:`create_engine`.
+``implicit_returning=False`` to :func:`.create_engine`.
Transaction Isolation Level
---------------------------
-:func:`create_engine` accepts an ``isolation_level`` parameter which results
+: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``.
+and ``SERIALIZABLE``. Note that the psycopg2 dialect does *not* use this
+technique and uses psycopg2-specific APIs (see that dialect for details).
INSERT/UPDATE...RETURNING
-------------------------
@@ -57,7 +58,7 @@ The dialect supports PG 8.2's ``INSERT..RETURNING``, ``UPDATE..RETURNING`` and
``DELETE..RETURNING`` syntaxes. ``INSERT..RETURNING`` is used by default
for single-row INSERT statements in order to fetch newly generated
primary key identifiers. To specify an explicit ``RETURNING`` clause,
-use the :meth:`_UpdateBase.returning` method on a per-statement basis::
+use the :meth:`._UpdateBase.returning` method on a per-statement basis::
# INSERT..RETURNING
result = table.insert().returning(table.c.col1, table.c.col2).\\