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