mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-07 14:27:32 +08:00
Use errcontext mechanism in PL/Python
Error messages from PL/Python now always mention the function name in the CONTEXT: field. This also obsoletes the few places that tried to do the same manually. Regression test files are updated to work with Python 2.4-2.6. I don't have access to older versions right now.
This commit is contained in:
@ -38,6 +38,7 @@ SELECT global_test_two();
|
||||
--
|
||||
SELECT import_fail();
|
||||
NOTICE: ('import socket failed -- No module named foosocket',)
|
||||
CONTEXT: PL/Python function "import_fail"
|
||||
import_fail
|
||||
--------------------
|
||||
failed as expected
|
||||
@ -191,6 +192,7 @@ SELECT test_void_func1(), test_void_func1() IS NULL AS "is null";
|
||||
|
||||
SELECT test_void_func2(); -- should fail
|
||||
ERROR: PL/Python function with return type "void" did not return None
|
||||
CONTEXT: PL/Python function "test_void_func2"
|
||||
SELECT test_return_none(), test_return_none() IS NULL AS "is null";
|
||||
test_return_none | is null
|
||||
------------------+---------
|
||||
|
||||
Reference in New Issue
Block a user