From 1a51cfe2743e4355bd43d20e1a8315d574a16427 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 8 Jun 2011 10:59:27 +0100 Subject: [PATCH] Better error message if deferrable is used in PG < 9.1 --- psycopg/connection_type.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index f3a17f93..13c017e8 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -499,6 +499,12 @@ psyco_conn_set_transaction(connectionObject *self, PyObject *args, PyObject *kwa } } if (Py_None != deferrable) { + if (self->server_version < 90100) { + PyErr_SetString(ProgrammingError, + "the 'deferrable' setting is only available" + " from PostgreSQL 9.1"); + return NULL; + } if (!(c_deferrable = _psyco_conn_parse_onoff(deferrable))) { return NULL; }