diff options
author | Peter Eisentraut | 2011-01-18 22:03:57 +0000 |
---|---|---|
committer | Peter Eisentraut | 2011-01-18 22:04:46 +0000 |
commit | 719461b7a28c04a84b0fb1e5faa9b3cb5ee66605 (patch) | |
tree | ddf4b52e5137bc1755c9b9e36718b0e62da1fd2b /src/pl/plpython/plpython.c | |
parent | d9a95c0adb11f7a3ca5aa9ab8a900018832ed4ea (diff) |
Improve message for errors in compiling anonymous PL/Python blocks
The previous code would try to print out a null pointer.
Jan UrbaĆski
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 * |