diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-01-19 00:03:57 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-01-19 00:04:46 +0200 |
commit | 719461b7a28c04a84b0fb1e5faa9b3cb5ee66605 (patch) | |
tree | ddf4b52e5137bc1755c9b9e36718b0e62da1fd2b /src/pl/plpython/plpython.c | |
parent | d9a95c0adb11f7a3ca5aa9ab8a900018832ed4ea (diff) | |
download | postgresql-719461b7a28c04a84b0fb1e5faa9b3cb5ee66605.tar.gz postgresql-719461b7a28c04a84b0fb1e5faa9b3cb5ee66605.zip |
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 * |