Skip to content

Commit

Permalink
Fix issue with pg types with OID >= 0x80000000
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jul 16, 2016
1 parent 570476f commit 5a02166
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/contents/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Version 5.0.1
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).

Expand Down
4 changes: 2 additions & 2 deletions pgmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ cast_sized_text(char *s, Py_ssize_t size, int encoding, int type)
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;
Expand All @@ -453,7 +453,7 @@ cast_other(char *s, Py_ssize_t size, int encoding, int pgtype,
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;
Expand Down

0 comments on commit 5a02166

Please sign in to comment.