summaryrefslogtreecommitdiff
path: root/psycopg/adapter_binary.c
diff options
context:
space:
mode:
Diffstat (limited to 'psycopg/adapter_binary.c')
-rw-r--r--psycopg/adapter_binary.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c
index 1a074ad..48489c2 100644
--- a/psycopg/adapter_binary.c
+++ b/psycopg/adapter_binary.c
@@ -41,9 +41,11 @@ static unsigned char *
binary_escape(unsigned char *from, unsigned int from_length,
unsigned int *to_length, PGconn *conn)
{
+#if PG_MAJOR_VERSION >= 8 && PG_MINOR_VERSION >= 1 && PG_PATCH_VERSION >= 4
if (conn)
return PQescapeByteaConn(conn, from, from_length, to_length);
else
+#endif
return PQescapeBytea(from, from_length, to_length);
}
#else