Re: WIP: to_char, support for EEEE format - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: WIP: to_char, support for EEEE format
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: WIP: to_char, support for EEEE format  (Pavel Stehule <[email protected]>)
Responses Re: WIP: to_char, support for EEEE format
List pgsql-hackers
On Sat, Apr 11, 2009 at 3:51 AM, Pavel Stehule <[email protected]> wrote:
> So, please, if you can, propose these error messages (with hints)-
> result will be much better.
>

Hi Pavel,

I was doing some work on rewording these error messages, and I noticed
that the following code segment occurs identically in four different
locations:
    numstr = orgnum = (char *) palloc(MAXDOUBLEWIDTH + 1);    if (Num.pre != 1)        ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),                errmsg("invalid using of format EEEE")));
 

Rather than rewording all four copies of the message, I wonder if this
test might be better factored out into a separate function?

Cheers,
BJ


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: psql with "Function Type" in \df
Next
From: "Kevin Grittner"
Date:
Subject: Re: psql with "Function Type" in \df