plperl message style on newly added messages

Started by Alvaro Herreraabout 16 years ago3 messageshackers
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

Hi,

I notice that the new plperl error messages are somewhat out of line of
our usual style:

ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("while executing utf8fix"),
errdetail("%s", strip_trailing_ws(SvPV_nolen(ERRSV))) ));

I think the errdetail field should really be errmsg, and the errdetail
should be errcontext.

There are several messages like this.

Should this be fixed?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#2Robert Haas
robertmhaas@gmail.com
In reply to: Alvaro Herrera (#1)
Re: plperl message style on newly added messages

On Mon, Feb 15, 2010 at 10:02 AM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:

I notice that the new plperl error messages are somewhat out of line of
our usual style:

           ereport(ERROR,
                   (errcode(ERRCODE_INTERNAL_ERROR),
                       errmsg("while executing utf8fix"),
                       errdetail("%s", strip_trailing_ws(SvPV_nolen(ERRSV))) ));

I think the errdetail field should really be errmsg, and the errdetail
should be errcontext.

There are several messages like this.

Should this be fixed?

Yes.

...Robert

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#2)
Re: plperl message style on newly added messages

Robert Haas <robertmhaas@gmail.com> writes:

On Mon, Feb 15, 2010 at 10:02 AM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:

I notice that the new plperl error messages are somewhat out of line of
our usual style:

� � � � � �ereport(ERROR,
� � � � � � � � � �(errcode(ERRCODE_INTERNAL_ERROR),
� � � � � � � � � � � �errmsg("while executing utf8fix"),
� � � � � � � � � � � �errdetail("%s", strip_trailing_ws(SvPV_nolen(ERRSV))) ));

I think the errdetail field should really be errmsg, and the errdetail
should be errcontext.

There are several messages like this.

Should this be fixed?

Yes.

Yes. Message style policing is exactly the kind of thing we should be
doing now. While you're at it, get rid of the
errcode(ERRCODE_INTERNAL_ERROR) if you can't find a better errcode ---
that's the default anyway.

regards, tom lane