ereport(ERROR,
(errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),
/* translator: %s represents an SQL statement name */
- errmsg("%s cannot be executed from a function", stmtType)));
+ errmsg("%s cannot be executed from a function or procedure",
+ stmtType)));
/* If we got past IsTransactionBlock test, should be in default state */
if (CurrentTransactionState->blockState != TBLOCK_DEFAULT &&
if (HaveRegisteredOrActiveSnapshot())
ereport(ERROR,
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("WAIT FOR must be only called without an active or registered snapshot"),
- errdetail("WAIT FOR cannot be executed from a function or a procedure or within a transaction with an isolation level higher than READ COMMITTED."));
+ errmsg("WAIT FOR must be called without an active or registered snapshot"),
+ errdetail("WAIT FOR cannot be executed from a function or procedure, nor within a transaction with an isolation level higher than READ COMMITTED."));
/*
* As the result we should hold no snapshot, and correspondingly our xmin
"BEGIN ISOLATION LEVEL REPEATABLE READ; SELECT 1; WAIT FOR LSN '${lsn3}';",
stderr => \$stderr);
ok( $stderr =~
- /WAIT FOR must be only called without an active or registered snapshot/,
+ /WAIT FOR must be called without an active or registered snapshot/,
"get an error when running in a transaction with an isolation level higher than REPEATABLE READ"
);
"SELECT pg_wal_replay_wait_wrap('${lsn3}');",
stderr => \$stderr);
ok( $stderr =~
- /WAIT FOR must be only called without an active or registered snapshot/,
+ /WAIT FOR must be called without an active or registered snapshot/,
"get an error when running within another function");
# 5. Check parameter validation error cases on standby before promotion
CREATE FUNCTION func() RETURNS VOID AS
$$ ALTER SUBSCRIPTION regress_testsub SET PUBLICATION mypub WITH (refresh = true) $$ LANGUAGE SQL;
SELECT func();
-ERROR: ALTER SUBSCRIPTION with refresh cannot be executed from a function
+ERROR: ALTER SUBSCRIPTION with refresh cannot be executed from a function or procedure
CONTEXT: SQL function "func" statement 1
ALTER SUBSCRIPTION regress_testsub DISABLE;
ALTER SUBSCRIPTION regress_testsub SET (slot_name = NONE);