On Sun, 2026-08-31 at 07:47 +0200, Peter Eisentraut wrote:
> I don't find any documentation for the WAIT FOR NO_THROW option other
> than a few short sentences in the man page about what it does
> technically.  But I don't find anything about why one would want to use
> it (or not).

Hello,

Attached is a patch.

The reason I settled on is that the difference is transactional.  The
error raised without NO_THROW aborts the current transaction, so a
caller that treats a timeout as recoverable (retry, fall back to the
primary, report the delay) has to roll back first and discard whatever
else that transaction had done.  With NO_THROW the session is
unaffected and the caller can branch on the returned status.  I
confirmed this: a timeout inside a transaction block leaves it aborted,
while the same wait with NO_THROW leaves the session usable.

Regards,
Rithvika Devisetti

On Mon, Aug 31, 2026 at 7:47 AM Peter Eisentraut <[email protected]>
wrote:

> I don't find any documentation for the WAIT FOR NO_THROW option other
> than a few short sentences in the man page about what it does
> technically.  But I don't find anything about why one would want to use
> it (or not).  I suspect this option was added with some particular
> client control flow in mind, but I think this needs to be explained
> somewhere.
>
>
>

Attachment: 0001-doc-Explain-when-to-use-the-WAIT-FOR-NO_THROW-option.patch
Description: Binary data

Reply via email to