Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIrMd-0005RL-L4 for pgsql-docs@arkaria.postgresql.org; Tue, 02 Aug 2022 12:51:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIrMa-0006x0-MJ for pgsql-docs@arkaria.postgresql.org; Tue, 02 Aug 2022 12:51:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIrMZ-0006wr-C5 for pgsql-docs@lists.postgresql.org; Tue, 02 Aug 2022 12:51:08 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIrMQ-0006RF-B5 for pgsql-docs@lists.postgresql.org; Tue, 02 Aug 2022 12:51:06 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6984E5C00EB; Tue, 2 Aug 2022 08:50:53 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute2.internal (MEProxy); Tue, 02 Aug 2022 08:50:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1659444653; x=1659531053; bh=O0+yBqWe2s 1pBcF6D9tda4/sxKboDoHaHlhnN88Xh9k=; b=CRJ00MpV/zkNk543rbpFzkFAn7 ekgWJmxBX4qB8VhAgRks41vNQ0D38s0N0Xb8xzW4obdGbyM05F0HbOG2iKZyEqcj TQ+yN2wkTwWhfOUrzX/IiOgFt6wDlxXMXj2gtLACw2RXEYMGHq6mBCvNo3Aq88cC IswCtbI97yXM/pacFsQ0lQvuGU/JahPLSX2H25NyN/opJ+Ti2on9QF/NMDT387RD Uy8Zib2uc8HciuqM9dtgqc8Ogu/DFRxTEAsmWHppZjq2nXEYSKOYaQvkQ8u9GvVC s8sN5sCfUhx4Aq5+ZYIB1YtUQ/UHcXko8FmzSt+st3f/d2mBpBYZgc0vsaDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1659444653; x=1659531053; bh=O0+yBqWe2s1pBcF6D9tda4/sxKbo DoHaHlhnN88Xh9k=; b=MPlxEEwJZAydC5DWw8Un/hG5MwNTd1ALWP89WOefh2Fl f7M6hI3sx7YAs6AED5gWkNDzrL09yEqFau3bCOerbJdx281DV4cc6MhH9Nic7Q+6 Tsd1/PsPrkbRcHeaHWqkBsy5WMFUGypOu6U5Or9jlalqhvL60oE73B+jTV7vqlLj P6f2L/JBjb72ZpIsEa6HEm3Z7X9eicjoqh4di3HkXVYd1hWAtzpvfSMwuPWhjakz 7dJCFlsOHB0Tz6f1FcYYEf0cNI0WPpGn6Eg+d5Su01RfNShjNC0Bo8TOpAupPAuQ l5nSnLpG6oRnrb/x0r5tJfDI1iP+zzm1Zks0C/JyMA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvhedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfgfhulhgvrhcuvfgrvhgvihhrrgdfuceovghulhgvrhes vghulhgvrhhtohdrtghomheqnecuggftrfgrthhtvghrnheptdejffeiueeigeegheeiue dtveelteetjeeitdfgheehfeeukeevffetudejhfffnecuffhomhgrihhnpehpohhsthhg rhgvshhqlhdrohhrghdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghulhgvrhht ohdrtghomh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DABFA15A0087; Tue, 2 Aug 2022 08:50:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-758-ge0d20a54e1-fm-20220729.001-ge0d20a54 Mime-Version: 1.0 Message-Id: In-Reply-To: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org> References: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org> Date: Tue, 02 Aug 2022 09:49:47 -0300 From: "Euler Taveira" To: eric.mutta@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"? Content-Type: multipart/alternative; boundary=34824d7b520541e8b8721a7779b0d476 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --34824d7b520541e8b8721a7779b0d476 Content-Type: text/plain 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 -- Euler Taveira EDB https://www.enterprisedb.com/ --34824d7b520541e8b8721a7779b0d476 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Sun, Jul 31,= 2022, at 8:37 PM, PG Doc comments form wrote:
Towards the end of the "43.9.1. Repo= rting Errors and Messages" section (here
we hav= e the following sentence:

> If no condit= ion name nor SQLSTATE is specified in a RAISE EXCEPTION
co= mmand, the default is to use ERRCODE_RAISE_EXCEPTION (P0001).
<= div>
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 a= nd should remove "ERRCODE_" and
simply read "RAISE_EXCEPTI= ON (P0001)" or perhaps "ERRCODE =3D
'RAISE_EXCEPTION'" sin= ce that's how the default behaviour would be written
in a = RAISE statement.
It is referring to the inter= nal constant (see src/backend/utils/errcodes.h). It
was li= ke you are proposing and it was changed in
66bde49d96a9dda= cc49dcbdf1b47b5bd6e31ead5. 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 refer= red to in [1]. I mean, change
ERRCODE_RAISE_EXCEPTION to r= aise_exception.


<= div>
--
Euler Taveira

--34824d7b520541e8b8721a7779b0d476--