Re: [HACKERS] dubious error message from partition.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] dubious error message from partition.c
Date
Msg-id 31008.1502249653@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] dubious error message from partition.c  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] dubious error message from partition.c  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: [HACKERS] dubious error message from partition.c  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> On 2017/08/09 3:50, Robert Haas wrote:
>> In retrospect, I'm not thrilled by this error message, for two reasons:
>> 1. It gives no details, as other nearby messages do.  For example,
>> further down in the function, we have a message "partition \"%s\"
>> would overlap partition \"%s\", which tells you the names of the old
>> and new partitions.  But this message has no %-escapes at all.
>> ...
>> So, I suggest something like:
>> "lower bound %s for partition \"%s\" must precede upper bound %s"

> Or, we could specify extra information in the detail part in a way that is
> perhaps less confusing:

> ERROR: invalid range bound specification for partition \"%s\"
> DETAIL: specified lower bound %s succeeds upper bound %s

+1 for doing it more or less like that.  One of our basic message style
guidelines is that primary error texts shouldn't be very long, and it'd be
easy to break that rule if we embed data values in it.

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.)

Or you could just go with "follows" instead of "succeeds".
        regards, tom lane



pgsql-hackers by date:

Previous
From: Justin Workman
Date:
Subject: Re: [HACKERS] Possible issue with expanded object infrastructure onPostgres 9.6.1
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] "make check" with non-GNU make