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.94.2) (envelope-from ) id 1qxq6L-003jgc-RS for pgsql-docs@arkaria.postgresql.org; Tue, 31 Oct 2023 14:52:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxq6K-002vHY-9h for pgsql-docs@arkaria.postgresql.org; Tue, 31 Oct 2023 14:52:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxq6K-002vHJ-2E for pgsql-docs@lists.postgresql.org; Tue, 31 Oct 2023 14:52:16 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxq6H-003InL-LW for pgsql-docs@lists.postgresql.org; Tue, 31 Oct 2023 14:52:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=vVNXPdiAoxW2PR7dDLrFEGjVp+sAJbftH+PuDpF/oOA=; b=u+azg sUxh7yuN7hN0KYmATa4ndxYmamX56Pz0v0l2WNhDDqheir1NF3j13GkFi+PPTV++lODQbMVm/dSH2 BMZplzYu9dYQBfBOGmqdrzVMlrHm9CbKpmxXgs9ae70TbHLEkovatUzDgJwSVsPrVpSHoherPqGxR 7/hrgu2tdgpXJV8RV2dscEni8w8dUt/Xcj9K5N1Y3BX92mkR7Y0ApeSIK+OOvNfBeTaNkLn5shIzz rRFylbfDc1/GMpxCpFGl/XTd5lWUO3yTcK/tCZKk00Isn+Uuse+TsC2kJi3sXOrqzOFkr8eNoRTf6 1R8JHG0yr8G7WlStTLUpWixm+PtoA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qxq6G-003vdD-1d; Tue, 31 Oct 2023 10:52:12 -0400 Date: Tue, 31 Oct 2023 10:52:12 -0400 From: Bruce Momjian To: Euler Taveira Cc: eric.mutta@gmail.com, pgsql-docs@lists.postgresql.org, Alexander Lakhin , Michael Paquier Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"? Message-ID: References: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 2, 2022 at 09:49:47AM -0300, Euler Taveira wrote: > On Sun, Jul 31, 2022, at 8:37 PM, PG Doc comments form wrote: > > Towards the end of the "43.9.1. Reporting Errors and Messages" section > (here > https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html# > PLPGSQL-STATEMENTS-RAISE) > we have the following sentence: > > > If no condition name nor SQLSTATE is specified in a RAISE EXCEPTION > command, the default is to use ERRCODE_RAISE_EXCEPTION (P0001). > > Looking at the list of error codes (here > https://www.postgresql.org/docs/current/errcodes-appendix.html) I think the > "ERRCODE_RAISE_EXCEPTION (P0001)" is a typo and should remove "ERRCODE_" > and > simply read "RAISE_EXCEPTION (P0001)" or perhaps "ERRCODE = > 'RAISE_EXCEPTION'" since that's how the default behaviour would be written > in a RAISE statement. > > It is referring to the internal constant (see src/backend/utils/errcodes.h). It > was like you are proposing and it was changed in > 66bde49d96a9ddacc49dcbdf1b47b5bd6e31ead5. Reading the original thread, there is > no explanation why it was changed. Refer to internal names is not good for a > user-oriented text. I think it would be better to use the condition name (in > lowercase) like it is referred to in [1]. I mean, change > ERRCODE_RAISE_EXCEPTION to raise_exception. > > [1] https://www.postgresql.org/docs/current/errcodes-appendix.html Alexander, Michael, can you explain why this commit removed ERRCODE_: commit 66bde49d96 Author: Michael Paquier Date: Tue Aug 13 13:53:41 2019 +0900 Fix inconsistencies and typos in the tree, take 10 This addresses some issues with unnecessary code comments, fixes various typos in docs and comments, and removes some orphaned structures and definitions. Author: Alexander Lakhin Discussion: https://postgr.es/m/9aabc775-5494-b372-8bcb-4dfc0bd37c68@gmail.com -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.