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
2b8afe61
Commit
2b8afe61
authored
Feb 28, 2006
by
Neil Conway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak the error message emitted when a void-returning PL/Python function
does not return None, per suggestion from Tom.
parent
87daae11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/pl/plpython/expected/plpython_test.out
src/pl/plpython/expected/plpython_test.out
+2
-2
src/pl/plpython/plpython.c
src/pl/plpython/plpython.c
+3
-3
No files found.
src/pl/plpython/expected/plpython_test.out
View file @
2b8afe61
...
@@ -190,8 +190,8 @@ SELECT test_void_func1(), test_void_func1() IS NULL AS "is null";
...
@@ -190,8 +190,8 @@ SELECT test_void_func1(), test_void_func1() IS NULL AS "is null";
(1 row)
(1 row)
SELECT test_void_func2(); -- should fail
SELECT test_void_func2(); -- should fail
ERROR:
unexpected return value from plpython procedure
ERROR:
invalid return value from plpython function
DETAIL:
void-returning functions must return "None"
DETAIL:
Functions returning type "void" must return "None".
SELECT test_return_none(), test_return_none() IS NULL AS "is null";
SELECT test_return_none(), test_return_none() IS NULL AS "is null";
test_return_none | is null
test_return_none | is null
------------------+---------
------------------+---------
...
...
src/pl/plpython/plpython.c
View file @
2b8afe61
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.7
2 2006/02/28 20:03:52
neilc Exp $
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.7
3 2006/02/28 20:56:14
neilc Exp $
*
*
*********************************************************************
*********************************************************************
*/
*/
...
@@ -769,8 +769,8 @@ PLy_function_handler(FunctionCallInfo fcinfo, PLyProcedure * proc)
...
@@ -769,8 +769,8 @@ PLy_function_handler(FunctionCallInfo fcinfo, PLyProcedure * proc)
if
(
plrv
!=
Py_None
)
if
(
plrv
!=
Py_None
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"
unexpected return value from plpython procedure
"
),
errmsg
(
"
invalid return value from plpython function
"
),
errdetail
(
"
void-returning functions must return
\"
None
\"
"
)));
errdetail
(
"
Functions returning type
\"
void
\"
must return
\"
None
\"
.
"
)));
fcinfo
->
isnull
=
false
;
fcinfo
->
isnull
=
false
;
rv
=
(
Datum
)
0
;
rv
=
(
Datum
)
0
;
...
...
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