Re: Re: Bug: WAIT FOR LSN crashes with assertion failure inside PL/pgSQL DO blocks and procedures - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Re: Bug: WAIT FOR LSN crashes with assertion failure inside PL/pgSQL DO blocks and procedures
Date
Msg-id CAPpHfdts2dMoMvCbUtbYHYFXWbfi9WM-pz2ZzJwE3NaYcGsTWg@mail.gmail.com
Whole thread Raw
In response to Re: Re: Bug: WAIT FOR LSN crashes with assertion failure inside PL/pgSQL DO blocks and procedures  (Xuneng Zhou <xunengzhou@gmail.com>)
List pgsql-hackers
On Fri, Apr 10, 2026 at 10:36 AM Xuneng Zhou <xunengzhou@gmail.com> wrote:
> I’ve revised the patch. Moving the non–top-level rejection to the
> beginning of the function may help avoid unnecessary parsing and
> validation work, although it could make the reasoning slightly less
> localized.
>
> Since this is user-facing, should we explicitly document this
> constraint to make the behavior less surprising? The rejection applies
> not only to wrapping the command in a procedure or function, but also
> within a DO block.
>
> It might also be worth adding a regression test and refining the error
> message accordingly. With this new constraint, some existing comments
> were outdated and have been updated as well.

Accepted, thank you.  Also, I've added errdetail() to clarify when the
statement could be not top-level.  Pushed.

------
Regards,
Alexander Korotkov
Supabase



pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Reduce build times of pg_trgm GIN indexes
Next
From: Amit Kapila
Date:
Subject: Re: Parallel Apply