From 3d4f6df0de210be48fabcad72c54a6915a630798 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 15 Aug 2016 02:17:47 +0100 Subject: [PATCH] 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. --- doc/src/install.rst | 3 ++- psycopg/pqpath.c | 2 +- psycopg/psycopg.h | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/src/install.rst b/doc/src/install.rst index 674bbac8..4611537e 100644 --- a/doc/src/install.rst +++ b/doc/src/install.rst @@ -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/ diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index d7283d0c..d02cb708 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -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, diff --git a/psycopg/psycopg.h b/psycopg/psycopg.h index 3174f309..82b4293c 100644 --- a/psycopg/psycopg.h +++ b/psycopg/psycopg.h @@ -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 #include