Better error message if deferrable is used in PG < 9.1

This commit is contained in:
Daniele Varrazzo 2011-06-08 10:59:27 +01:00
parent 0a1bbb56cd
commit 1a51cfe274

View File

@ -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;
}