Re: WAIT FOR NO_THROW option could use some documentation

From: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Xuneng Zhou <xunengzhou(at)gmail(dot)com>, Kiran Kaki <itskkpg(at)gmail(dot)com>, Rithvika Devisetti <devisettirithvika(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAIT FOR NO_THROW option could use some documentation
Date: 2026-09-03 23:00:31
Message-ID: CAHg+QDfTaDHm1NVtysOa1HPCRAhNstconXQxkrVbOS3vfr5mKQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Sep 3, 2026 at 1:39 PM Peter Eisentraut <peter(at)eisentraut(dot)org>
wrote:

> On 03.09.26 17:21, SATYANARAYANA NARLAPURAM wrote:
> > Maybe something along these lines - "NO_THROW option safely prevents the
> > database
> > from aborting an active transaction, allowing subsequent queries within
> > the transaction
> > to proceed without losing prior work"?
>
> Maybe that's what it is meant for, but that seems separate from the
> status reporting mechanism. It could also send an error message to the
> client but not abort the transaction on the server.
>

Curious, Is there an existing precedent for this in the core where we send
an error
but not abort a transaction on the server? Parsing error messages is
painful compared
to reading the result set it seems.

Additionally, I see the information passed to the client when an error is
thrown much richer
than a row returned like timeout. Perhaps if we decide to support NO_THROW
should
we consider adding a current replay LSN as well?

postgres=# WAIT FOR LSN '0/306EE20' WITH (TIMEOUT '0.1s');
ERROR: timed out while waiting for target LSN 0/306EE20 to be replayed;
current replay LSN 0/306EA60

postgres=# WAIT FOR LSN '0/306EE20' WITH (TIMEOUT '100ms', NO_THROW);
status
---------
timeout
(1 row)

Thanks,
Satya

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-03 23:08:09 Re: Offline data checksum changes can cause incorrect checksum state on standbys
Previous Message Peter Smith 2026-09-03 22:28:20 Re: Crashes on a partition whose concurrent detach never finished