aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2012-07-05 23:40:25 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2012-07-05 23:44:45 +0300
commitb4234f8fc49fc58ea904f0b9eea0336d5a7930d8 (patch)
treea4b5cf0f23ce5a1e451bcb38d22e5f68001359d3
parent138313ebaa985030d75d429c3b3cb7138e62b10f (diff)
downloadpostgresql-b4234f8fc49fc58ea904f0b9eea0336d5a7930d8.tar.gz
postgresql-b4234f8fc49fc58ea904f0b9eea0336d5a7930d8.zip
Revert part of the previous patch that avoided using PLy_elog().
That caused the plpython_unicode regression test to fail on SQL_ASCII encoding, as evidenced by the buildfarm. The reason is that with the patch, you don't get the detail in the error message that you got before. That detail is actually very informative, so rather than just adjust the expected output, let's revert that part of the patch for now to make the buildfarm green again, and figure out some other way to avoid the recursion of PLy_elog() that doesn't lose the detail.
-rw-r--r--src/pl/plpython/plpython.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 2f67caba6db..c0030d05a84 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -4928,16 +4928,7 @@ PLyUnicode_Bytes(PyObject *unicode)
rv = PyUnicode_AsEncodedString(unicode, serverenc, "strict");
if (rv == NULL)
- {
- /*
- * Use a plain ereport instead of PLy_elog to avoid recursion, if
- * the traceback formatting functions try to do unicode to bytes
- * conversion again.
- */
- ereport(ERROR,
- (errcode(ERRCODE_INTERNAL_ERROR),
- errmsg("could not convert Python Unicode object to PostgreSQL server encoding")));
- }
+ PLy_elog(ERROR, "could not convert Python Unicode object to PostgreSQL server encoding");
return rv;
}