File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2889,6 +2889,17 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
2889
2889
exec_set_found (estate , false);
2890
2890
break ;
2891
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
+ ereport (ERROR ,
2899
+ (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2900
+ errmsg ("cannot begin/end transactions in PL/pgSQL" ),
2901
+ errhint ("Use a BEGIN block with an EXCEPTION clause instead." )));
2902
+
2892
2903
default :
2893
2904
elog (ERROR , "SPI_execute_plan_with_paramlist failed executing query \"%s\": %s" ,
2894
2905
expr -> query , SPI_result_code_string (rc ));
You can’t perform that action at this time.
0 commit comments