On Wed, Jul 13, 2016 at 03:25:54PM -0500, Justin Pryzby wrote:
> Is there an oid overflowing a 32 bit integer, or a %d rather than %lu ?
> 2016-07-12 15:46:21.055 
> EDT,"telsasoft","ts",16716,"[local]",5785468c.414c,620,"BIND",2016-07-12 
> 15:35:40 EDT,2/869507,0,ERROR,42601,"syntax error at or near 
> ""-""",,,,,"invalid type name ""-799870613""","SELECT oid, typname, 
> typname::regtype, typtype, typcategory, typdelim, typrelid FROM pg_type WHERE 
> oid=$1::regtype",,,""
> ts=# SELECT oid, oid::bigint-(2^32), oid::int, typname FROM pg_type WHERE 
> typname='geometry' ORDER BY 1 DESC LIMIT 99;
> -[ RECORD 1 ]--------
> oid      | 3495096683
> ?column? | -799870613
> oid      | -799870613
> typname  | geometry

Problem seems to be here:

cast_other (s=0x68ebac "0101000000713D0AD7A3A054C04260E5D022BB4240", size=42, 
encoding=6, pgtype=-799870613, cast_hook=0x2aaaaf70f230)

/* Cast an arbitrary type to a Python object using a callback function.
   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, 
PyObject *cast_hook)
{
[...]
        obj = PyObject_CallFunction(cast_hook, "(Oi)", obj, pgtype);

pg_type needs to be an unsigned long int, no ?

-- 
Justin Pryzby
System Administrator
Telsasoft
+1-952-707-8581
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to