Skip to content

Commit 076026b

Browse files
committed
Python handle as string all int8 values from postgresql. This could be
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
1 parent cfe0179 commit 076026b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/interfaces/python/pgmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ get_type_array(PGresult *result, int nfields)
286286
{
287287
case INT2OID:
288288
case INT4OID:
289+
case INT8OID:
289290
case OIDOID:
290291
typ[j] = 1;
291292
break;
@@ -1793,6 +1794,7 @@ pgquery_getresult(pgqueryobject * self, PyObject * args)
17931794
{
17941795
case INT2OID:
17951796
case INT4OID:
1797+
case INT8OID:
17961798
case OIDOID:
17971799
typ[j] = 1;
17981800
break;
@@ -1940,6 +1942,7 @@ pgquery_dictresult(pgqueryobject * self, PyObject * args)
19401942
{
19411943
case INT2OID:
19421944
case INT4OID:
1945+
case INT8OID:
19431946
case OIDOID:
19441947
typ[j] = 1;
19451948
break;

0 commit comments

Comments
 (0)