Re: TABLESAMPLE patch is really in pretty sad shape - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: TABLESAMPLE patch is really in pretty sad shape
Date
Msg-id 20150716132830.GM2301@postgresql.org
Whole thread Raw
In response to Re: TABLESAMPLE patch is really in pretty sad shape  (Petr Jelinek <petr@2ndquadrant.com>)
List 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 by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: TABLESAMPLE patch is really in pretty sad shape
Next
From: Alvaro Herrera
Date:
Subject: Re: TABLESAMPLE patch is really in pretty sad shape