summaryrefslogtreecommitdiff
path: root/psycopg/connection_int.c
diff options
context:
space:
mode:
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;
}