pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Euler Taveira <euler@eulerto.com>
Cc: eric.mutta@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Typo in "43.9.1. Reporting Errors and Messages"?
Date: Wed, 1 Nov 2023 09:18:47 +0900
Message-ID: <ZUGZZ-J_AeeWM4_o@paquier.xyz> (raw)
In-Reply-To: <8247bd59-6c9d-b56b-94f0-6e01993473cd@gmail.com>
References: <165931062346.271448.12881330344096283605@wrigleys.postgresql.org>
	<e222845e-8ee4-4aba-8dab-dc59827c61c6@www.fastmail.com>
	<ZUEUnLevXyW7DlCs@momjian.us>
	<8247bd59-6c9d-b56b-94f0-6e01993473cd@gmail.com>

On Tue, Oct 31, 2023 at 09:00:00PM +0300, Alexander Lakhin wrote:
> 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.

Indeed, it looks like the origin of the confusion is the casing here,
so changing to "raise_exception" like in the appendix sounds good to
me:
https://www.postgresql.org/docs/devel/errcodes-appendix.html

So you mean something like the attached then?

> (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.)

Yep, still this one is not that old (0a459cec96d3).
--
Michael

Attachments:

  [text/x-diff] plpg-errcode-doc.patch (669B, ../ZUGZZ-J_AeeWM4_o@paquier.xyz/2-plpg-errcode-doc.patch)
  download | inline diff:
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
index 83f867f91d..5977534a62 100644
--- a/doc/src/sgml/plpgsql.sgml
+++ b/doc/src/sgml/plpgsql.sgml
@@ -3942,7 +3942,7 @@ RAISE unique_violation USING MESSAGE = 'Duplicate user ID: ' || user_id;
    <para>
     If no condition name nor SQLSTATE is specified in a
     <command>RAISE EXCEPTION</command> command, the default is to use
-    <literal>ERRCODE_RAISE_EXCEPTION</literal> (<literal>P0001</literal>).
+    <literal>raise_exception</literal> (<literal>P0001</literal>).
     If no message text is specified, the default is to use the condition
     name or SQLSTATE as message text.
    </para>

  [application/pgp-signature] signature.asc (832B, ../ZUGZZ-J_AeeWM4_o@paquier.xyz/3-signature.asc)
  download

view thread (6+ messages)  latest in thread

Message-ID: <ZUGZZ-J_AeeWM4_o@paquier.xyz>
Permalink:  ../ZUGZZ-J_AeeWM4_o@paquier.xyz/
Also on:    postgresql.org/message-id/ZUGZZ-J_AeeWM4_o@paquier.xyz

 ·  · 

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: michael@paquier.xyz, exclusion@gmail.com, bruce@momjian.us, 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: <ZUGZZ-J_AeeWM4_o@paquier.xyz>

* 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