On 1/3/26 7:34 AM, Pavel Stehule wrote:
here is a patch (with small regress test)
Looks like a good change to me since the obvious question many people would ask themselves after seeing this error is if running it in a procedure would work instead and it does not. And this error message changes saves those people time which is a great thing.
Tried out this patch and it worked and, as expected, also improved the error for other commands like CREATE DATABASE and REINDEX CONCURRENTLY so when this is commit the commit message should make it clear this is not just about VACUUM.
A small suggestion is to change the message from: "%s cannot be executed from a function or a procedure" to: "%s cannot be executed from a function or procedure" I am not a native speaker but I think the second flows better. Andreas
