summaryrefslogtreecommitdiff
path: root/psycopg/adapter_binary.c
diff options
context:
space:
mode:
authorJames Henstridge <james@jamesh.id.au>2009-02-17 16:00:52 +0900
committerJames Henstridge <james@jamesh.id.au>2009-02-17 16:00:52 +0900
commit9067bde8030eb22cbbd289c1a173af8e68956fc0 (patch)
tree2ebc83f30e2e685584c249109514c7e1d84d3a08 /psycopg/adapter_binary.c
parent2a94dfae47c10426be7e9b7babdf89548cfbe24d (diff)
downloadpsycopg2-9067bde8030eb22cbbd289c1a173af8e68956fc0.tar.gz
* psycopg/utils.c (psycopg_escape_string): same here.
* psycopg/adapter_binary.c (binary_escape): simplify PostgreSQL version check. * setup.py (psycopg_build_ext.finalize_options): use a single define of the PostgreSQL version in a form that can easily be used by #ifdefs.
Diffstat (limited to 'psycopg/adapter_binary.c')
-rw-r--r--psycopg/adapter_binary.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c
index 306c9e5..76ce92d 100644
--- a/psycopg/adapter_binary.c
+++ b/psycopg/adapter_binary.c
@@ -42,9 +42,7 @@ static unsigned char *
binary_escape(unsigned char *from, size_t from_length,
size_t *to_length, PGconn *conn)
{
-#if PG_MAJOR_VERSION > 8 || \
- (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION > 1) || \
- (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION == 1 && PG_PATCH_VERSION >= 4)
+#if PG_VERSION_HEX >= 0x080104
if (conn)
return PQescapeByteaConn(conn, from, from_length, to_length);
else