diff options
author | Blake Rouse <blake.rouse@canonical.com> | 2014-09-08 12:05:28 -0400 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-12-25 15:06:18 +0100 |
commit | cd67d3d2fe085b207268be649ef282fc6032a8cc (patch) | |
tree | 1346cede4416632b751902bc5998db1ec296c8c0 /setup.py | |
parent | e13ec67da393480e7cec408f94f21a8e9d266bc3 (diff) | |
download | psycopg2-cd67d3d2fe085b207268be649ef282fc6032a8cc.tar.gz |
Modify truncate to use lo_truncate64. Use HAVE_LO64 define to use new lo_*64 methods. Check size of offset and length for versions without LO64.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -415,6 +415,13 @@ class psycopg_build_ext(build_ext): define_macros.append(("PG_VERSION_HEX", "0x%02X%02X%02X" % (int(pgmajor), int(pgminor), int(pgpatch)))) + + # enable lo64 if postgres >= 9.3 + if int(pgmajor) >= 9 and int(pgminor) >= 3: + define_macros.append(("HAVE_LO64", "1")) + else: + define_macros.append(("HAVE_LO64", "0")) + except Warning: w = sys.exc_info()[1] # work around py 2/3 different syntax sys.stderr.write("Error: %s\n" % w) |