I notice there are still several places in pl_exec.c like this:
case SPI_ERROR_TRANSACTION:
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot begin/end transactions in PL/pgSQL"),
errhint("Use a BEGIN block with an EXCEPTION clause instead.")));
break;
At best, the wording of these error messages is now obsolete. I'm not
sure if we expect them to be reachable at all. If they should be
can't-happen cases, I'd suggest just deleting them and letting control
fall to the generic default: cases in each switch. If they are reachable,
the messages need work.
regards, tom lane