aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2011-03-07 23:01:54 +0200
committerPeter Eisentraut <peter_e@gmx.net>2011-03-07 23:47:43 +0200
commit804d13adfd2f66c70d8d95a606dde621b3213179 (patch)
tree6eae0df359f3e916cb0a08030caabdb87e56c80a /src
parent8f76324352986287c04832f8e6450d4d2952a030 (diff)
downloadpostgresql-804d13adfd2f66c70d8d95a606dde621b3213179.tar.gz
postgresql-804d13adfd2f66c70d8d95a606dde621b3213179.zip
Fix behavior when raising plpy.Fatal()
It should cause a elog(FATAL) error, and it fact it was simply causing a elog(ERROR). Jan UrbaƄski
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/plpython.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 43d332de209..1f8c27f632a 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -4381,8 +4381,13 @@ PLy_elog(int elevel, const char *fmt,...)
int position = 0;
PyErr_Fetch(&exc, &val, &tb);
- if (exc != NULL && PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
- PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
+ if (exc != NULL)
+ {
+ if (PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
+ PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
+ else if (PyErr_GivenExceptionMatches(val, PLy_exc_fatal))
+ elevel = FATAL;
+ }
PyErr_Restore(exc, val, tb);
xmsg = PLy_traceback(&xlevel);