We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c3c7b5 commit f184de3Copy full SHA for f184de3
src/pl/plpgsql/src/pl_exec.c
@@ -2889,6 +2889,17 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
2889
exec_set_found(estate, false);
2890
break;
2891
2892
+ /* Some SPI errors deserve specific error messages */
2893
+ case SPI_ERROR_COPY:
2894
+ ereport(ERROR,
2895
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2896
+ errmsg("cannot COPY to/from client in PL/pgSQL")));
2897
+ case SPI_ERROR_TRANSACTION:
2898
2899
2900
+ errmsg("cannot begin/end transactions in PL/pgSQL"),
2901
+ errhint("Use a BEGIN block with an EXCEPTION clause instead.")));
2902
+
2903
default:
2904
elog(ERROR, "SPI_execute_plan_with_paramlist failed executing query \"%s\": %s",
2905
expr->query, SPI_result_code_string(rc));
0 commit comments