INFO: read committed
INFO: repeatable read
INFO: read committed
--- error case
+-- error cases
DO LANGUAGE plpgsql $$
BEGIN
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
ERROR: SET TRANSACTION ISOLATION LEVEL must be called before any query
CONTEXT: SQL statement "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ"
PL/pgSQL function inline_code_block line 3 at SET
+DO LANGUAGE plpgsql $$
+BEGIN
+ SAVEPOINT foo;
+END;
+$$;
+ERROR: unsupported transaction command in PL/pgSQL
+CONTEXT: PL/pgSQL function inline_code_block line 3 at SQL statement
+DO LANGUAGE plpgsql $$
+BEGIN
+ EXECUTE 'COMMIT';
+END;
+$$;
+ERROR: EXECUTE of transaction commands is not implemented
+CONTEXT: PL/pgSQL function inline_code_block line 3 at EXECUTE
DROP TABLE test1;
DROP TABLE test2;
DROP TABLE test3;
(void *) expr,
cursorOptions);
if (plan == NULL)
- {
- /* Some SPI errors deserve specific error messages */
- switch (SPI_result)
- {
- case SPI_ERROR_COPY:
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot COPY to/from client in PL/pgSQL")));
- break;
- 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;
- default:
- elog(ERROR, "SPI_prepare_params failed for \"%s\": %s",
- expr->query, SPI_result_code_string(SPI_result));
- break;
- }
- }
+ elog(ERROR, "SPI_prepare_params failed for \"%s\": %s",
+ expr->query, SPI_result_code_string(SPI_result));
if (keepplan)
SPI_keepplan(plan);
expr->plan = plan;
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.")));
+ errmsg("unsupported transaction command in PL/pgSQL")));
break;
default:
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.")));
+ errmsg("EXECUTE of transaction commands is not implemented")));
break;
default: