public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: John Naylor <[email protected]>
Cc: Yugo Nagata <[email protected]>
Cc: Pgsql Hackers <[email protected]>
Subject: Re: Adjust error message for CREATE STATISTICS to account for expressions
Date: Fri, 27 Mar 2026 08:23:45 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANWCAZYjDSsvC6M6pas26ffbj-TZmXOHHC1-DwRM2LFa+qr3GQ@mail.gmail.com>
References: <[email protected]>
<CANWCAZYdyQzCoAiq9kybHT2RcnC1CgrxbCpyxeV3+KZn2xj2UA@mail.gmail.com>
<[email protected]>
<CANWCAZYjDSsvC6M6pas26ffbj-TZmXOHHC1-DwRM2LFa+qr3GQ@mail.gmail.com>
On Thu, Mar 26, 2026 at 04:22:07PM +0700, John Naylor wrote:
> I'd probably write this as "extended statistics on a single column are
> not supported" (no need to send a new patch).
>
> Any objections?
None. I have found this error message puzzling while doing some of my
recent work for extended statistics, because extended statistics can
be created if there is a single element made of an expression in the
list given in input.
> Also, I'm leaning towards not backpatching -- I figure a user that got
> here by fat-fingering an expression is not likely to be too confused.
- errmsg("extended statistics require at least 2 columns")));
+ errmsg("extended statistics are not supported on a single column")));
Now our documentation also tells that the former message is not the
preferred project style (full sentences usually avoided in primary
messages):
https://www.postgresql.org/docs/devel/error-style-guide.html#ERROR-STYLE-GUIDE-GRAMMAR-PUNCTUATION
Perhaps something like "could not create extended statistics" with a
hint describing the cause would be better.. Full sentences usually
apply to errdetails or errhints. If we're on it, we could just as
well improve the whole thing, I guess?
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, 2-signature.asc)
download
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Adjust error message for CREATE STATISTICS to account for expressions
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox