From: Alexander Lakhin <exclusion@gmail.com>
To: Bruce Momjian <bruce@momjian.us>
To: Euler Taveira <euler@eulerto.com>
Cc: eric.mutta@gmail.com, pgsql-docs@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>
Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"?
Date: Tue, 31 Oct 2023 21:00:00 +0300
Message-ID: <8247bd59-6c9d-b56b-94f0-6e01993473cd@gmail.com> (raw)
In-Reply-To: <ZUEUnLevXyW7DlCs@momjian.us>
References: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org>
<e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.com>
<ZUEUnLevXyW7DlCs@momjian.us>
Hi Bruce,
31.10.2023 17:52, Bruce Momjian wrote:
>
>> 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
I don't remember details, but I think the primary reason for the change
was that "RAISE_EXCEPTION" occurred in the whole tree only once (before
66bde49d96). Now I see, that I had chosen the wrong replacement — I agree
with Euler, change to "raise_exception" would be more appropriate.
(I've found a similar mention of ERRCODE_xxx in btree.sgml:
Before doing so, the function should check the sign
of <replaceable>offset</replaceable>: if it is less than zero, raise
error <literal>ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE</literal> (22013)
with error text like <quote>invalid preceding or following size in window
function</quote>.
but I think that's okay here, because that identifier supposed to be used
as-is in ereport/elog.)
Best regards,
Alexander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: exclusion@gmail.com, bruce@momjian.us, euler@eulerto.com, michael@paquier.xyz
Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"?
In-Reply-To: <8247bd59-6c9d-b56b-94f0-6e01993473cd@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox