Re: not fully correct error message

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: not fully correct error message
Date: 2026-01-03 12:39:28
Message-ID: 8fa16ea7-09a1-4ec2-b668-1e36d4c8ace4@proxel.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/3/26 1:22 PM, Marcos Pegoraro wrote:
> Em sáb., 3 de jan. de 2026 às 03:35, Pavel Stehule
> <pavel(dot)stehule(at)gmail(dot)com <mailto:pavel(dot)stehule(at)gmail(dot)com>> escreveu:
>
> here is a patch (with small regress test)
>
>
> An anonymous block doesn't accept vacuum too.
> Wouldn't it be better to specify what kind of block you are running
> instead of
> function, procedure or anonymous block ?

Maybe out of some kind of correctness, but it seems less useful to me
since the obvious question an end user would ask after trying to run
VACUUM in a function is if they can do so in a procedure instead so we
may as well tell them right away.

A potential third option would be to take your solution but to add a
HINT about that it needs to run as a top-level statement outside any
transactions, but I kinda liked how simple the original patch was.

Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dewei Dai 2026-01-03 12:45:44 Re: Re: postgres_fdw: Use COPY to speed up batch inserts
Previous Message Pavel Stehule 2026-01-03 12:34:46 Re: not fully correct error message