Re: WIP: to_char, support for EEEE format

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: to_char, support for EEEE format
Date: 2009-04-21 16:45:33
Message-ID: 37ed240d0904210945q753fa95ej8b4bd3f8abb583ec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 11, 2009 at 3:51 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-04-21 16:50:06 Re: psql with "Function Type" in \df
Previous Message Kevin Grittner 2009-04-21 16:45:19 Re: psql with "Function Type" in \df