git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6441288)
Fix for plpython functions; return true/false for boolean,
2007年1月25日 04:08:51 +0000 (04:08 +0000)
2007年1月25日 04:08:51 +0000 (04:08 +0000)
rather than 1/0. This helps when creating trigger functions that output
SQL.

Guido Goldstein


diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 06313aceb6ac904f47881d66264aed50516d24c2..d5651c16f0cff90f27839205a5f7b6a0f11c328e 100644 (file)
--- 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 *
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /