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

Attachment: signature.asc
Description: PGP signature

Reply via email to