diff --git a/doc/src/sgml/ref/wait.sgml b/doc/src/sgml/ref/wait.sgml index 9056eb6726b..68ca7101eba 100644 --- a/doc/src/sgml/ref/wait.sgml +++ b/doc/src/sgml/ref/wait.sgml @@ -54,8 +54,8 @@ WAIT FOR LSN 'lsn' (standby_replay, standby_write, standby_flush), an error is also emitted if the server is promoted before the lsn is reached. - If NO_THROW is specified, the command returns - a status string instead of throwing errors. + If NO_THROW is specified, the command reports + these outcomes as a status string instead of raising an error. @@ -172,6 +172,39 @@ WAIT FOR LSN 'lsn' running on the primary. In this case the result status can be obtained from the return value. + + + Use this option when timeout or + not in recovery is an expected result that the + application intends to handle, for example by retrying the wait, + reporting replication delay, or choosing another server for a + subsequent operation. The command then returns the result as a + status, which the application must check before assuming that the + target LSN was reached. Omit the option when + the application must not proceed unless the target + LSN is reached, so that an unsuccessful wait + stops normal execution with an error. + + + + Returning a status also leaves an explicit transaction usable; + without this option, the corresponding error requires rolling back + the transaction, or rolling back to a savepoint, before further + commands can be issued. + + + + This option changes only how timeout and + not in recovery are reported. Other errors are + still raised. That covers invalid input, such as a malformed + LSN or an unrecognized option value, and every + condition that is checked before the wait begins, such as + requesting primary_flush during recovery or + holding a lock while waiting for a standby + LSN. The option also does not limit the + duration of the wait; specify TIMEOUT for that + purpose. +