postgres.git / summary / log / commit / refs

commit    719461b7a28c04a84b0fb1e5faa9b3cb5ee66605
Author:   Peter Eisentraut <peter_e@gmx.net>
Date:     Tue Jan 18 22:03:57 2011 +0000
First released in: 9.1.0

    Improve message for errors in compiling anonymous PL/Python blocks
    
    The previous code would try to print out a null pointer.
    
    Jan UrbaƄski


src/pl/plpython/plpython.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 03d6962ca02..99424d35133 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -1625,7 +1625,11 @@ PLy_procedure_compile(PLyProcedure *proc, const char *src) return; } - PLy_elog(ERROR, "could not compile PL/Python function \"%s\"", proc->proname); + if (proc->proname) + PLy_elog(ERROR, "could not compile PL/Python function \"%s\"", + proc->proname); + else + PLy_elog(ERROR, "could not compile anonymous PL/Python code block"); } static char * [parent: d9a95c0adb11]