8000 Revert part of the previous patch that avoided using PLy_elog(). · lhcezar/postgres@b4234f8 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit b4234f8

Browse files
committed
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.
1 parent 138313e commit b4234f8

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/pl/plpython/plpython.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4928,16 +4928,7 @@ PLyUnicode_Bytes(PyObject *unicode)
49284928

49294929
rv = PyUnicode_AsEncodedString(unicode, serverenc, "strict");
49304930
if (rv == NULL)
4931-
{
4932-
/*
4933-
* Use a plain ereport instead of PLy_elog to avoid recursion, if
4934-
* the traceback formatting functions try to do unicode to bytes
4935-
* conversion again.
4936-
*/
4937-
ereport(ERROR,
4938-
(errcode(ERRCODE_INTERNAL_ERROR),
4939-
errmsg("could not convert Python Unicode object to PostgreSQL server encoding")));
4940-
}
4931+
PLy_elog(ERROR, "could not convert Python Unicode object to PostgreSQL server encoding");
49414932
return rv;
49424933
}
49434934

0 commit comments

Comments
 (0)
0