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 1vbFZ4-003L6s-0Q for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jan 2026 10:05:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vbFZ1-0080vp-2x for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jan 2026 10:05:52 +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 1vbFZ1-0080vh-21 for pgsql-hackers@lists.postgresql.org; Thu, 01 Jan 2026 10:05:52 +0000 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vbFYz-003uXt-2F for pgsql-hackers@lists.postgresql.org; Thu, 01 Jan 2026 10:05:51 +0000 Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-5de23ddba5eso8403529137.3 for ; Thu, 01 Jan 2026 02:05:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767261948; x=1767866748; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/dAMpEPsNvP2brbwQjCpN8VEuGiYTiAO92VZou6qpNI=; b=OLelUY/+FOhuHcv+tJM7xcFKXIjCNxNUGIbZq11EJdFC66+pC8RLn2o5KP9+IVS0bH u7B/0SDpWVgEhZ5Wr00w4wHDFra5qIypCw2bac8+uW9QT3uF1ZTahem7Zk/3LTF6AyOi V6c1WCkfmklcMoiDgqfXpIk2UlaugqEKCsEkaIy4k/nhuK9eheUaEv1fA8TfwY41mjAH 4PmPhNbK8zZE2DP725iihp89TLYawAufbpXLCzdfnazmSJjU9O7nNxoCuoFyLn0pJWSb G/KRVUptgX3mN6i1D4WJSJE42THKq9Z8AxV6CE4423OL5ZQ7xDsMWbqV6N/YDzBGz2N6 Qo0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767261948; x=1767866748; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/dAMpEPsNvP2brbwQjCpN8VEuGiYTiAO92VZou6qpNI=; b=YKhArDPNQ5WtNF84OoEf8mpcK0uRgiCrE2MeorWUjE/pbavps7ietblk8lvErNpPh5 60e3v3xo8CoR9CoAYCF77eiAv13ZIGLkqcU8nfUzePLSpPXHGjRMCWQwK1RKJG4DYAyN fTntfvOuRH3669cDB2+9NM+1FLTpziyMCeN56Pn2SOehN0CDGJ+qoxkFQ1F9EsWCcD4+ c4f59o18IgKY1VhyJzQ4hWJf4N6z6B9c6o3/voSJjpCcz8KVcdoh0pakHXxJQh+pGoqA RtfNRK0ypKRkjnsdhYh9c5XCG62Twf1Jned7UdCLpQq83vqSFA8NdP2+0k9tIatjBNvS g5ig== X-Gm-Message-State: AOJu0YxgTtbFIppSeiPGnwnZef83gS+7ELpGniNd/SjIu+wDD9BUcyiN rh823YepYU6VhWgYu30tmEKPvdayLugkr+X2A4o6X+seTRr1hq1wbIjTbhIbCJlgHziN11YmowO DCt+OKgHPSJFa57Yic3nqmURlVZ92dc4= X-Gm-Gg: AY/fxX4rfTMFXOEe/IEXMPW95pilPiaRX60QyBp1/Qq8FB4JkmK8C0ffwnyciCceCyW i/nYJCcasQ2OwZ6si6kmsMzeS2PoEdRfe+YhE+sLRDuUyD4hjo4YKBpf9fPlMPtquB2BnsN3Owm QveG4AjK5z5fB6ujIUCuB81DghXmy3cXwnq+M9aKdrAoOfajhUHhJL+DbaccAo90Fu7pGkbB0CK AvKosuBNiJNRea8uQQMw9KS4VVQS9EEz3TyAAmKGMNUnjevObVaBP66e0XzAsSYGNgBdM3rItF/ J3i8LARKUNlGrBmJah1IvgHOlnA3Yju/4aCPyKXml9/gEW22B3gOnYreshBbwvTK8Y74ZvAJTep wirdWUovr2BLeVH61ZGmcNBICVYaFLlT8bhtAVNJ6C/94zjepm/8H+gxMjQ== X-Google-Smtp-Source: AGHT+IHHjbjnuhuYr2okQ5HWs73CV3XNfx3tB1oRP3pj5AdULn2NXxGEIIt2ujC9YMkzw8yUpQYceRtZnq59NDxAmyU= X-Received: by 2002:a05:6102:2b90:b0:5d7:ddf6:8951 with SMTP id ada2fe7eead31-5eb1a617d2cmr12439618137.1.1767261948020; Thu, 01 Jan 2026 02:05:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: jian he Date: Thu, 1 Jan 2026 18:05:12 +0800 X-Gm-Features: AQt7F2pyxmFjhmLM5Gmos2rm_A-m9VQu026OzSbT6-oN3KlROmqaC_HhRFOMFw4 Message-ID: Subject: Re: not fully correct error message To: Pavel Stehule Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 1, 2026 at 3:10=E2=80=AFPM Pavel Stehule wrote: > > Hi > > I tested one use case, and maybe I found little bit possible error messag= e > > create procedure test() > as $$ > begin > vacuum; > end; > $$ language plpgsql; > > (2026-01-01 08:04:05) postgres=3D# call test(); > ERROR: 25001: VACUUM cannot be executed from a function > CONTEXT: SQL statement "vacuum" > PL/pgSQL function test() line 3 at SQL statement > LOCATION: PreventInTransactionBlock, xact.c:3695 > (2026-01-01 08:09:18) postgres=3D# > > should be "VACUUM cannot be executed from a function or a procedure" inst= ead ? > hi. "VACUUM cannot be executed from a function or a procedure" looks good to me. similarly, in ExecWaitStmt we have: ereport(ERROR, errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("WAIT FOR must be only called without an active or registered snapshot"), errdetail("WAIT FOR cannot be executed from a function or a procedure or within a transaction with an isolation level higher than READ COMMITTED.")); PreventInTransactionBlock is used in so many places, but this error message= : `` (errmsg("%s cannot be executed from a function", stmtType))); `` only appears once in the regress tests. maybe we can add some dummy tests for it.