Enforce dependency on libpq version >= 9.1

PGRES_COPY_BOTH was introduced in 9.1: we can ifdef the hell out of
pgpath, but we may as well bury the dead horses instead of beating
them.

They smell funny, too.
This commit is contained in:
Daniele Varrazzo 2016-08-15 02:17:47 +01:00
parent b006190312
commit 3d4f6df0de
3 changed files with 7 additions and 2 deletions

View File

@ -19,7 +19,8 @@ The current `!psycopg2` implementation supports:
- Python 2 versions from 2.6 to 2.7
- Python 3 versions from 3.1 to 3.5
- PostgreSQL versions from 7.4 to 9.4
- PostgreSQL server versions from 7.4 to 9.5
- PostgreSQL client library version from 9.1
.. _PostgreSQL: http://www.postgresql.org/
.. _Python: http://www.python.org/

View File

@ -1913,7 +1913,7 @@ pq_fetch(cursorObject *curs, int no_result)
break;
default:
/* PGRES_COPY_BOTH, PGRES_SINGLE_TUPLE, future statuses */
/* PGRES_SINGLE_TUPLE, future statuses */
Dprintf("pq_fetch: got unsupported result: status = %d pgconn = %p",
pgstatus, curs->conn);
PyErr_Format(NotSupportedError,

View File

@ -26,6 +26,10 @@
#ifndef PSYCOPG_H
#define PSYCOPG_H 1
#if PG_VERSION_NUM < 90100
#error "Psycopg requires PostgreSQL client library (libpq) >= 9.1"
#endif
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <libpq-fe.h>