Re: TABLESAMPLE patch is really in pretty sad shape

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TABLESAMPLE patch is really in pretty sad shape
Date: 2015-07-16 13:28:30
Message-ID: 20150716132830.GM2301@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-07-16 13:33:59 Re: TABLESAMPLE patch is really in pretty sad shape
Previous Message Petr Jelinek 2015-07-16 13:25:47 Re: TABLESAMPLE patch is really in pretty sad shape