mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-18 01:50:32 +03:00
Exposing ISOLATION_LEVEL_DEFAULT to Python
This is now the state that is returned to Python if nothing has been explicitly set.
This commit is contained in:
parent
c60682c230
commit
665e9dc665
|
@ -651,6 +651,15 @@ set to one of the following constants:
|
||||||
|
|
||||||
.. __: http://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-SERIALIZABLE
|
.. __: http://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-SERIALIZABLE
|
||||||
|
|
||||||
|
.. data:: ISOLATION_LEVEL_DEFAULT
|
||||||
|
|
||||||
|
Whatever is defined by the server, either via server configuration or by
|
||||||
|
statements executed within the session outside Pyscopg control; Psycopg
|
||||||
|
will not force an isolation level of its own. If you want to know what the
|
||||||
|
value is you can use a query such as :sql:`show transaction_isolation` or
|
||||||
|
:sql:`show default_transaction_isolation`.
|
||||||
|
|
||||||
|
.. versionadded:: 2.7
|
||||||
|
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
|
|
|
@ -72,6 +72,7 @@ ISOLATION_LEVEL_READ_UNCOMMITTED = 4
|
||||||
ISOLATION_LEVEL_READ_COMMITTED = 1
|
ISOLATION_LEVEL_READ_COMMITTED = 1
|
||||||
ISOLATION_LEVEL_REPEATABLE_READ = 2
|
ISOLATION_LEVEL_REPEATABLE_READ = 2
|
||||||
ISOLATION_LEVEL_SERIALIZABLE = 3
|
ISOLATION_LEVEL_SERIALIZABLE = 3
|
||||||
|
ISOLATION_LEVEL_DEFAULT = 5
|
||||||
|
|
||||||
|
|
||||||
"""psycopg connection status values."""
|
"""psycopg connection status values."""
|
||||||
|
|
|
@ -488,7 +488,7 @@ class IsolationLevelsTestCase(ConnectingTestCase):
|
||||||
conn = self.connect()
|
conn = self.connect()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
conn.isolation_level,
|
conn.isolation_level,
|
||||||
psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED)
|
psycopg2.extensions.ISOLATION_LEVEL_DEFAULT)
|
||||||
|
|
||||||
def test_encoding(self):
|
def test_encoding(self):
|
||||||
conn = self.connect()
|
conn = self.connect()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user