Author: cito
Date: Sat Jul 16 05:36:09 2016
New Revision: 877

Log:
Fix issue with pg types with OID >= 0x80000000

Modified:
   trunk/docs/contents/changelog.rst
   trunk/pgmodule.c

Modified: trunk/docs/contents/changelog.rst
==============================================================================
--- trunk/docs/contents/changelog.rst   Thu Jul 14 08:21:19 2016        (r876)
+++ trunk/docs/contents/changelog.rst   Sat Jul 16 05:36:09 2016        (r877)
@@ -8,6 +8,11 @@
   with PyGreSQL 4.x and allows updating the primary key itself if an OID 
exists.
 - The connect() function of the DB API 2.0 module now accepts additional 
keyword
   parameters such as "application_name" which will be passed on to PostgreSQL.
+- PyGreSQL now adapts some queries to be able to access older PostgreSQL 8.x
+  databases (as suggested on the mailing list by Andres Mejia). However, these
+  old versions of PostgreSQL are not officially supported and tested any more.
+- Fixed an issue with Postgres types that have an OID >= 0x80000000 (reported
+  on the mailing list by Justin Pryzby).
 - Made C extension compatible with MSVC 9 again (this was needed to compile for
   Python 2 on Windows).
 

Modified: trunk/pgmodule.c
==============================================================================
--- trunk/pgmodule.c    Thu Jul 14 08:21:19 2016        (r876)
+++ trunk/pgmodule.c    Sat Jul 16 05:36:09 2016        (r877)
@@ -443,7 +443,7 @@
    This needs the character string, size, encoding, the Postgres type
    and the external typecast function to be called. */
 static PyObject *
-cast_other(char *s, Py_ssize_t size, int encoding, int pgtype,
+cast_other(char *s, Py_ssize_t size, int encoding, Oid pgtype,
        PyObject *cast_hook)
 {
        PyObject *obj;
@@ -453,7 +453,7 @@
        if (cast_hook)
        {
                PyObject *tmp_obj = obj;
-               obj = PyObject_CallFunction(cast_hook, "(Oi)", obj, pgtype);
+               obj = PyObject_CallFunction(cast_hook, "(OI)", obj, pgtype);
                Py_DECREF(tmp_obj);
        }
        return obj;
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to