Re: dubious error message from partition.c

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dubious error message from partition.c
Date: 2017-08-09 20:38:21
Message-ID: 20170809203821.xwqxpuanqbfyhznf@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dean Rasheed wrote:
> On 9 August 2017 at 13:03, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > On Tue, Aug 8, 2017 at 11:34 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> A small suggestion is that it'd be better to write it like "Specified
> >> upper bound \"%s\" precedes lower bound \"%s\"." I think "succeeds" has
> >> more alternate meanings than "precedes", so the wording you have seems
> >> more confusing than it needs to be. (Of course, the situation could be
> >> the opposite in other languages, but translators have the ability to
> >> reverse the ordering if they need to.)
> >
> > I think that doesn't quite work, because the failure is caused by LB
> > <= UB, not LB < UB. We could fix that by writing "precedes or equals"
> > but that seems lame. Maybe:
> >
> > Lower bound %s does not precede upper bound %s.
>
> There was an earlier suggestion to use "greater than or equal to". I
> think that would work quite well:
>
> ERROR: invalid range bounds for partition \"%s\"
> DETAIL: lower bound %s is greater than or equal to upper bound %s.

Is it possible to detect the equality case specifically and use a
different errdetail? Something like "the lower bound %s is equal to the
upper bound" (obviously without including both in the message.)

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-08-09 20:59:21 Re: dubious error message from partition.c
Previous Message Robert Haas 2017-08-09 20:25:26 Re: pl/perl extension fails on Windows