Re: Typo in "43.9.1. Reporting Errors and Messages"?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: eric(dot)mutta(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org, Alexander Lakhin <exclusion(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"?
Date: 2023-10-31 14:52:12
Message-ID: ZUEUnLevXyW7DlCs@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

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 <michael(at)paquier(dot)xyz>
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 <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2023-10-31 17:20:09 Re: doc-fix-for-POSIX-Time-Zone-Specifications
Previous Message Bruce Momjian 2023-10-31 14:21:50 Re: 'value' has special behaviour in alter system

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-10-31 15:02:19 Re: Should fix a comment referring to stats collector?
Previous Message hubert depesz lubaczewski 2023-10-31 14:11:03 Re: pgBufferUsage.blk_{read|write}_time are zero although there are pgBufferUsage.local_blks_{read|written}