aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpython.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-01-25 04:08:51 +0000
committerBruce Momjian <bruce@momjian.us>2007-01-25 04:08:51 +0000
commit251281767a9bc10f2e14f50ceb88f19c67113b57 (patch)
treea7a5a8237f8031ff757a74b0fcaa5fa6f57c6c79 /src/pl/plpython/plpython.c
parent6441288ec9d6c86c441ca31eb08799f12bc3b99c (diff)
downloadpostgresql-251281767a9bc10f2e14f50ceb88f19c67113b57.tar.gz
postgresql-251281767a9bc10f2e14f50ceb88f19c67113b57.zip
Fix for plpython functions; return true/false for boolean,
rather than 1/0. This helps when creating trigger functions that output SQL. Guido Goldstein
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r--src/pl/plpython/plpython.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 06313aceb6a..d5651c16f0c 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -1,7 +1,7 @@
/**********************************************************************
* 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)
{
if (src[0] == 't')
- return PyInt_FromLong(1);
- return PyInt_FromLong(0);
+ Py_RETURN_TRUE;
+ Py_RETURN_FALSE;
}
static PyObject *