diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-06-08 10:59:27 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-06-08 10:59:27 +0100 |
commit | 1a51cfe2743e4355bd43d20e1a8315d574a16427 (patch) | |
tree | d68ae51de9a2028d021a8a6f5a560a4cd29ea48d | |
parent | 0a1bbb56cd4cb6d57d66935268032be839b9b2e7 (diff) | |
download | psycopg2-1a51cfe2743e4355bd43d20e1a8315d574a16427.tar.gz |
Better error message if deferrable is used in PG < 9.1
-rw-r--r-- | psycopg/connection_type.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index f3a17f9..13c017e 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; } |