Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bfe8b89e
Commit
bfe8b89e
authored
Apr 03, 2007
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow pl/pythonu >= version 2.3 to return boolean, rather than 1/0.
Marko Kreen
parent
749167cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/pl/plpython/plpython.c
src/pl/plpython/plpython.c
+11
-3
No files found.
src/pl/plpython/plpython.c
View file @
bfe8b89e
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.9
8 2007/04/03 13:37:22
momjian Exp $
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.9
9 2007/04/03 15:50:58
momjian Exp $
*
*********************************************************************
*/
...
...
@@ -32,6 +32,14 @@ typedef int Py_ssize_t;
#define PY_SSIZE_T_MIN INT_MIN
#endif
/*
* PyBool_FromLong is supported from 2.3.
*/
#if PY_VERSION_HEX < 0x02030000
#define PyBool_FromLong(x) PyInt_FromLong(x)
#endif
#include "postgres.h"
/* system stuff */
...
...
@@ -1600,8 +1608,8 @@ PLyBool_FromString(const char *src)
* versions. http://docs.python.org/api/boolObjects.html
*/
if
(
src
[
0
]
==
't'
)
return
Py
Int
_FromLong
(
1
);
return
Py
Int
_FromLong
(
0
);
return
Py
Bool
_FromLong
(
1
);
return
Py
Bool
_FromLong
(
0
);
}
static
PyObject
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment