Fix for plpython functions; return true/false for boolean,
rather than 1/0. This helps when creating trigger functions that output SQL. Guido Goldstein
This commit is contained in:
parent
6441288ec9
commit
251281767a
@ -1,7 +1,7 @@
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* plpython.c - python as a procedural language for PostgreSQL
|
* plpython.c - python as a procedural language for PostgreSQL
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.90 2006/11/21 21:51:05 tgl Exp $
|
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.91 2007/01/25 04:08:51 momjian Exp $
|
||||||
*
|
*
|
||||||
*********************************************************************
|
*********************************************************************
|
||||||
*/
|
*/
|
||||||
@ -1580,8 +1580,8 @@ static PyObject *
|
|||||||
PLyBool_FromString(const char *src)
|
PLyBool_FromString(const char *src)
|
||||||
{
|
{
|
||||||
if (src[0] == 't')
|
if (src[0] == 't')
|
||||||
return PyInt_FromLong(1);
|
Py_RETURN_TRUE;
|
||||||
return PyInt_FromLong(0);
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user