* PreventCommandIfParallelMode: throw error if current (sub)transaction is * in parallel mode. * * This is useful partly to ensure consistency of the error message wording; * some callers have checked IsInParallelMode() for themselves. */
| 490 | * some callers have checked IsInParallelMode() for themselves. |
| 491 | */ |
| 492 | void |
| 493 | PreventCommandIfParallelMode(const char *cmdname) |
| 494 | { |
| 495 | if (IsInParallelMode()) |
| 496 | ereport(ERROR, |
| 497 | (errcode(ERRCODE_INVALID_TRANSACTION_STATE), |
| 498 | /* translator: %s is name of a SQL command, eg CREATE */ |
| 499 | errmsg("cannot execute %s during a parallel operation", |
| 500 | cmdname))); |
| 501 | } |
| 502 | |
| 503 | /* |
| 504 | * PreventCommandDuringRecovery: throw error if RecoveryInProgress |
no test coverage detected