Skip site navigation (1) Skip section navigation (2)

plperl message style on newly added messages

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: plperl message style on newly added messages
Date: 2010-02-15 15:02:50
Message-ID: 20100215150250.GD2982@alvh.no-ip.org (view raw)
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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl message style on newly added messages
Date: 2010-02-15 15:10:57
Message-ID: 603c8f071002150710o6bd7e23eya42ffedfbf516363@mail.gmail.com (view raw)
On Mon, Feb 15, 2010 at 10:02 AM, Alvaro Herrera
<alvherre(at)commandprompt(dot)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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl message style on newly added messages
Date: 2010-02-15 16:03:39
Message-ID: 29805.1266249819@sss.pgh.pa.us (view raw)
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Feb 15, 2010 at 10:02 AM, Alvaro Herrera
> <alvherre(at)commandprompt(dot)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


Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group