Re: TABLESAMPLE patch is really in pretty sad shape

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: TABLESAMPLE patch is really in pretty sad shape
Дата
Msg-id 20150716132830.GM2301@postgresql.org
обсуждение исходный текст
Ответ на Re: TABLESAMPLE patch is really in pretty sad shape  (Petr Jelinek <petr@2ndquadrant.com>)
Список pgsql-hackers
Petr Jelinek wrote:
> On 2015-07-13 15:39, Tom Lane wrote:

> >I don't find this to be good error message style.  The secondary comment
> >is not a "hint", it's an ironclad statement of what you did wrong, so if
> >we wanted to phrase it like this it should be an errdetail not errhint.
> >But the whole thing is overly cute anyway because there is no reason at
> >all not to just say what we mean in the primary error message, eg
> >         ereport(ERROR,
> >                 (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
> >                  errmsg("sample size must be greater than zero")));
> 
> Same as above, although now that I re-read the standard I am sure I
> misunderstand it the first time - it says:
> "If S is the null value or if S < 0 (zero) or if S > 100, then an exception
> condition is raised: data exception — invalid sample size."
> I took it as literal error message originally but they just mean status code
> by it.

Yes, must use a new errcode ERRCODE_INVALID_SAMPLE_SIZE defined to 2202H
here.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: TABLESAMPLE patch is really in pretty sad shape
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: TABLESAMPLE patch is really in pretty sad shape