Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2512817

Browse files
committed
Fix for plpython functions; return true/false for boolean,
rather than 1/0. This helps when creating trigger functions that output SQL. Guido Goldstein
1 parent 6441288 commit 2512817

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pl/plpython/plpython.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.90 2006/11/21 21:51:05 tgl Exp $
4+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.91 2007/01/25 04:08:51 momjian Exp $
55
*
66
*********************************************************************
77
*/
@@ -1580,8 +1580,8 @@ static PyObject *
15801580
PLyBool_FromString(const char *src)
15811581
{
15821582
if (src[0] == 't')
1583-
return PyInt_FromLong(1);
1584-
return PyInt_FromLong(0);
1583+
Py_RETURN_TRUE;
1584+
Py_RETURN_FALSE;
15851585
}
15861586

15871587
static PyObject *

0 commit comments

Comments
 (0)