mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Better error message if deferrable is used in PG < 9.1
This commit is contained in:
parent
0a1bbb56cd
commit
1a51cfe274
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user