Re: WIP: to_char, support for EEEE format

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: WIP: to_char, support for EEEE format
Дата
Msg-id 162867790904211713h44dcfa73s625853f0d307e3a9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: to_char, support for EEEE format  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: WIP: to_char, support for EEEE format  (Brendan Jurd <direvus@gmail.com>)
Список pgsql-hackers
2009/4/21 Brendan Jurd <direvus@gmail.com>:
> On Sat, Apr 11, 2009 at 3:51 AM, Pavel Stehule <pavel.stehule@gmail.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?

maybe macro is better - it is too short and without any semantic for
function, but maybe not. The length of source code is not problem -
the short function will be inlined, so total length will be same. What
should be name for this function or for this macro? It hasn't any
semantic. There should be readable macro only for ereport function -
some

#define RAISE_EEEE_FORMAT_ERROR        ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), errmsg("invalid using of format
EEEE")));

regards
Pavel Stehule

>
> Cheers,
> BJ
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: KaiGai Kohei
Дата:
Сообщение: Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] unalias of ACL_SELECT_FOR_UPDATE