Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0626a7d

Browse files
committed
Reverse out use of Py_RETURN_TRUE in plpython, only supported in Python >=
2.3.
1 parent22bd156 commit0626a7d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/pl/plpython/plpython.c

Lines changed: 9 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.91 2007/01/2504:08:51 momjian Exp $
4+
*$PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.92 2007/01/2514:52:23 momjian Exp $
55
*
66
*********************************************************************
77
*/
@@ -1579,9 +1579,15 @@ PLy_typeinfo_dealloc(PLyTypeInfo * arg)
15791579
staticPyObject*
15801580
PLyBool_FromString(constchar*src)
15811581
{
1582+
/*
1583+
*We would like to use Py_RETURN_TRUE and Py_RETURN_FALSE here for
1584+
*generating SQL from trigger functions, but those are only
1585+
*supported in Python >= 2.3, and we support older
1586+
*versions. http://docs.python.org/api/boolObjects.html
1587+
*/
15821588
if (src[0]=='t')
1583-
Py_RETURN_TRUE;
1584-
Py_RETURN_FALSE;
1589+
returnPyInt_FromLong(1);
1590+
returnPyInt_FromLong(0);
15851591
}
15861592

15871593
staticPyObject*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp