pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Euler Taveira <euler@eulerto.com>
To: eric.mutta@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"?
Date: Tue, 02 Aug 2022 09:49:47 -0300
Message-ID: <e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.com> (raw)
In-Reply-To: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org>
References: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org>

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/

view thread (6+ messages)  latest in thread

Message-ID: <e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.com>
Permalink:  ../e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.com/
Also on:    postgresql.org/message-id/e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.com

 · 

reply

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: euler@eulerto.com, eric.mutta@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"?
  In-Reply-To: <e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.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