]> granicus.if.org Git - postgresql/commitdiff
Python handle as string all int8 values from postgresql. This could be
authorBruce Momjian <bruce@momjian.us>
Tue, 16 Oct 2001 13:42:57 +0000 (13:42 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 16 Oct 2001 13:42:57 +0000 (13:42 +0000)
view when using the aggregate function count() and function nextval
that returns an int8 value, but in python is represented like string:

>> db.query("select nextval('my_seq')").getresult()
[('2',)]

>> db.query("select count(*) from films").dictresult()
[{'count': '120'}]

Ricardo Caesar Lenzi

src/interfaces/python/pgmodule.c

index 52d10b7ba8738388ecd92a4da02fe96b3310175f..ea077b201a3ad028557f5593dbdced20551668a7 100644 (file)
@@ -286,6 +286,7 @@ get_type_array(PGresult *result, int nfields)
                {
                        case INT2OID:
                        case INT4OID:
+                       case INT8OID:
                        case OIDOID:
                                typ[j] = 1;
                                break;
@@ -1793,6 +1794,7 @@ pgquery_getresult(pgqueryobject * self, PyObject * args)
                {
                        case INT2OID:
                        case INT4OID:
+                       case INT8OID:
                        case OIDOID:
                                typ[j] = 1;
                                break;
@@ -1940,6 +1942,7 @@ pgquery_dictresult(pgqueryobject * self, PyObject * args)
                {
                        case INT2OID:
                        case INT4OID:
+                       case INT8OID:
                        case OIDOID:
                                typ[j] = 1;
                                break;