aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/plpython.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 2cfdeade622..cd3486fa6d6 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -29,7 +29,7 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.6 2001/10/01 17:53:12 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.7 2001/10/04 15:45:49 momjian Exp $
*
*********************************************************************
*/
@@ -229,6 +229,7 @@ static PyObject *PLyDict_FromTuple(PLyTypeInfo *, HeapTuple, TupleDesc);
static PyObject *PLyBool_FromString(const char *);
static PyObject *PLyFloat_FromString(const char *);
static PyObject *PLyInt_FromString(const char *);
+static PyObject *PLyLong_FromString(const char *);
static PyObject *PLyString_FromString(const char *);
@@ -1378,12 +1379,16 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Form_pg_type typeStruct)
case 'i':
{
if ((strncasecmp("int", type, 3) == 0) &&
- ((type[3] == '4') || (type[3] == '2') || (type[3] == '8')) &&
+ ((type[3] == '4') || (type[3] == '2')) &&
(type[4] == '\0'))
{
arg->func = PLyInt_FromString;
return;
}
+ else if ( strcasecmp("int8", type) == 0 )
+ {
+ arg->func = PLyLong_FromString;
+ }
break;
}
case 'n':
@@ -1465,6 +1470,12 @@ PLyInt_FromString(const char *src)
}
PyObject *
+PLyLong_FromString(const char *src)
+{
+ return PyLong_FromString((char *)src,NULL,0);
+}
+
+PyObject *
PLyString_FromString(const char *src)
{
return PyString_FromString(src);