diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 4a9e2a4f181507e66a3b701f9d09524222dea0c7..43d332de209d0a40253ccdb3dec1a497763ef39f 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -1157,9 +1157,7 @@ PLy_function_handler(FunctionCallInfo fcinfo, PLyProcedure *proc) PLy_function_delete_args(proc); if (has_error) - ereport(ERROR, - (errcode(ERRCODE_DATA_EXCEPTION), - errmsg("error fetching next item from iterator"))); + PLy_elog(ERROR, "error fetching next item from iterator"); /* Disconnect from the SPI manager before returning */ if (SPI_finish() != SPI_OK_FINISH)