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
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>
signature.asc
Description: PGP signature