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

Commit2b8afe6

Browse files
author
Neil Conway
committed
Tweak the error message emitted when a void-returning PL/Python function
does not return None, per suggestion from Tom.
1 parent87daae1 commit2b8afe6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/pl/plpython/expected/plpython_test.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ SELECT test_void_func1(), test_void_func1() IS NULL AS "is null";
190190
(1 row)
191191

192192
SELECT test_void_func2(); -- should fail
193-
ERROR:unexpected return value from plpythonprocedure
194-
DETAIL:void-returningfunctionsmust return "None"
193+
ERROR:invalid return value from plpythonfunction
194+
DETAIL:Functionsreturningtype "void"must return "None".
195195
SELECT test_return_none(), test_return_none() IS NULL AS "is null";
196196
test_return_none | is null
197197
------------------+---------

‎src/pl/plpython/plpython.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
3030
*
3131
* IDENTIFICATION
32-
*$PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.72 2006/02/28 20:03:52 neilc Exp $
32+
*$PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.73 2006/02/28 20:56:14 neilc Exp $
3333
*
3434
*********************************************************************
3535
*/
@@ -769,8 +769,8 @@ PLy_function_handler(FunctionCallInfo fcinfo, PLyProcedure * proc)
769769
if (plrv!=Py_None)
770770
ereport(ERROR,
771771
(errcode(ERRCODE_DATATYPE_MISMATCH),
772-
errmsg("unexpected return value from plpythonprocedure"),
773-
errdetail("void-returningfunctionsmust return \"None\"")));
772+
errmsg("invalid return value from plpythonfunction"),
773+
errdetail("Functionsreturningtype \"void\"must return \"None\".")));
774774

775775
fcinfo->isnull= false;
776776
rv= (Datum)0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp