Re: Typo in "43.9.1. Reporting Errors and Messages"?
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: Bruce Momjian <bruce@momjian.us>, Euler Taveira <euler@eulerto.com>
Cc: eric.mutta@gmail.com, pgsql-docs@lists.postgresql.org,
Michael Paquier <michael@paquier.xyz>
Date: 2023-10-31T18:00:00Z
Lists: pgsql-hackers, pgsql-docs
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
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