summaryrefslogtreecommitdiff
path: root/psycopg/connection_int.c
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-06-03 00:40:54 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-06-03 00:40:54 +0100
commit4d3c6865eea89c99ed67a3a5765932cff5dda514 (patch)
tree2f35b2da9cf856c6d2f6a0d11d710f73637e867b /psycopg/connection_int.c
parentc2d1f1f2e6832384ca01466cfbefecfa877e6850 (diff)
downloadpsycopg2-4d3c6865eea89c99ed67a3a5765932cff5dda514.tar.gz
Use only the isolation levels available on old PG versions
Diffstat (limited to 'psycopg/connection_int.c')
-rw-r--r--psycopg/connection_int.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c
index de7083f..0544957 100644
--- a/psycopg/connection_int.c
+++ b/psycopg/connection_int.c
@@ -1042,6 +1042,13 @@ conn_switch_isolation_level(connectionObject *self, int level)
{
int curr_level;
+ /* use only supported levels on older PG versions */
+ if (self->server_version < 80000) {
+ if (level == 1 || level == 3) {
+ ++level;
+ }
+ }
+
if (-1 == (curr_level = conn_get_isolation_level(self))) {
return -1;
}