Re: Typo in "43.9.1. Reporting Errors and Messages"?
Euler Taveira <euler@eulerto.com>
From: "Euler Taveira" <euler@eulerto.com>
To: eric.mutta@gmail.com, pgsql-docs@lists.postgresql.org
Date: 2022-08-02T12:49:47Z
Lists: pgsql-hackers, pgsql-docs
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/
Commits
-
doc: Replace reference to ERRCODE_RAISE_EXCEPTION by "raise_exception"
- f8b96c211da0 11.22 landed
- 616de5bb3573 12.17 landed
- aa0246ccf5bb 13.13 landed
- 52a105eff2ba 14.10 landed
- bbbf1510bc41 15.5 landed
- 354b3ebf17c4 16.1 landed
- 4210b55f5985 17.0 landed
-
Improve the protocol message descriptions for 2PC logical replication.
- 0e60a50e0bf1 16.0 landed
- c5d67881d343 15.0 landed
-
doc: Fix typos in protocol.sgml
- 5b94d3ccb7ad 15.0 landed
- a69959fab2f3 16.0 landed
-
Fix inconsistencies and typos in the tree, take 10
- 66bde49d96a9 13.0 cited