mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Add NUMERICOID return type. Treat it as floating point for now. This
could be changed if we create a new Python type that matches it better but NUMERIC <==> FLOAT probably works fine for most cases.
This commit is contained in:
@ -43,6 +43,7 @@
|
|||||||
#define FLOAT4OID 700
|
#define FLOAT4OID 700
|
||||||
#define FLOAT8OID 701
|
#define FLOAT8OID 701
|
||||||
#define CASHOID 790
|
#define CASHOID 790
|
||||||
|
#define NUMERICOID 1700
|
||||||
|
|
||||||
static PyObject *PGError;
|
static PyObject *PGError;
|
||||||
static const char *PyPgVersion = "3.1";
|
static const char *PyPgVersion = "3.1";
|
||||||
@ -298,6 +299,7 @@ get_type_array(PGresult *result, int nfields)
|
|||||||
|
|
||||||
case FLOAT4OID:
|
case FLOAT4OID:
|
||||||
case FLOAT8OID:
|
case FLOAT8OID:
|
||||||
|
case NUMERICOID:
|
||||||
typ[j] = 2;
|
typ[j] = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1805,6 +1807,7 @@ pgquery_getresult(pgqueryobject * self, PyObject * args)
|
|||||||
|
|
||||||
case FLOAT4OID:
|
case FLOAT4OID:
|
||||||
case FLOAT8OID:
|
case FLOAT8OID:
|
||||||
|
case NUMERICOID:
|
||||||
typ[j] = 2;
|
typ[j] = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1940,6 +1943,7 @@ pgquery_dictresult(pgqueryobject * self, PyObject * args)
|
|||||||
|
|
||||||
case FLOAT4OID:
|
case FLOAT4OID:
|
||||||
case FLOAT8OID:
|
case FLOAT8OID:
|
||||||
|
case NUMERICOID:
|
||||||
typ[j] = 2;
|
typ[j] = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user