From: Peter Eisentraut Date: Tue, 18 Jan 2011 22:03:57 +0000 (+0200) Subject: Improve message for errors in compiling anonymous PL/Python blocks X-Git-Tag: REL9_1_ALPHA4~421 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=719461b7a28c04a84b0fb1e5faa9b3cb5ee66605;p=postgresql Improve message for errors in compiling anonymous PL/Python blocks The previous code would try to print out a null pointer. Jan UrbaƄski --- diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 03d6962ca0..99424d3513 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 *