Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vc0us-000vBy-0j for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jan 2026 12:39:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vc0ur-00CiB2-0Y for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Jan 2026 12:39:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vc0uq-00CiAu-2R for pgsql-hackers@lists.postgresql.org; Sat, 03 Jan 2026 12:39:33 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vc0up-004FBZ-1E for pgsql-hackers@lists.postgresql.org; Sat, 03 Jan 2026 12:39:33 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 907844D006F for ; Sat, 03 Jan 2026 13:39:29 +0100 (CET) Received: from s981.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 8177C4D0B04; Sat, 03 Jan 2026 13:39:29 +0100 (CET) Received: from s474.loopia.se (unknown [172.22.191.6]) by s981.loopia.se (Postfix) with ESMTP id 7F12022B1779; Sat, 03 Jan 2026 13:39:29 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s474.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=proxel.se Received: from s980.loopia.se ([172.22.191.6]) by s474.loopia.se (s474.loopia.se [172.22.190.14]) (amavisd-new, port 10024) with LMTP id tWDQzBnf4hKG; Sat, 3 Jan 2026 13:39:29 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 147.28.75.140 Received: from [192.168.0.121] (customer-147-28-75-140.stosn.net [147.28.75.140]) (Authenticated sender: andreas@proxel.se) by s980.loopia.se (Postfix) with ESMTPSA id EBE09220163C; Sat, 03 Jan 2026 13:39:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1767443969; bh=vZuBqa9oboDKU1WtvrVFmB6tGT5Y645iA0nTE3xE7W0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=RcmqQZUtYL14pYJGprL5r3JjbDk7ejjHuIjz4InM5DuaApjZ3LrMDxk+DPOmEugOY 1PBMNX8aKD0kD/C+h80YcKQcZg8woUDAfnWMq88x20FCrsntEZ6AT3QtZHI47nYev2 NEcIHm9Ko8cfcrUeMGgFK/pqxLECjr959z9isY2ZaI+Dx7kt0d8+tHlftaaaXIJry6 T50Hqbyue2zy0VsXaXXJkN4Fpxn/uerwYogvwnPBLjVQQg1gyzn9r49RvXB+gQpM+b K5bCGoSrVpTw2wyf9a+qSAMsuMH40wX0H5I8U2TicGllBgovY5OJ2fhwY6CQjJEwYG MDhcT7YjmKO7Q== Message-ID: <8fa16ea7-09a1-4ec2-b668-1e36d4c8ace4@proxel.se> Date: Sat, 3 Jan 2026 13:39:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: not fully correct error message To: Marcos Pegoraro , Pavel Stehule Cc: jian he , PostgreSQL Hackers References: From: Andreas Karlsson Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/3/26 1:22 PM, Marcos Pegoraro wrote: > Em sáb., 3 de jan. de 2026 às 03:35, Pavel Stehule > > 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