Re: Adjust error message for CREATE STATISTICS to account for expressions - Mailing list pgsql-hackers

From Chao Li
Subject Re: Adjust error message for CREATE STATISTICS to account for expressions
Date
Msg-id E0E9225B-82B0-485E-8E8B-07330D217383@gmail.com
Whole thread Raw
In response to Re: Adjust error message for CREATE STATISTICS to account for expressions  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-hackers

> On Mar 27, 2026, at 08:45, John Naylor <johncnaylorls@gmail.com> wrote:
>
> On Fri, Mar 27, 2026 at 6:23 AM Michael Paquier <michael@paquier.xyz> wrote:
>> -    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
>
> My reading of that is that hints/details need to be complete
> sentences, and primary messages don't need to be.

+1


> From: Dean Rasheed <dean.a.rasheed@gmail.com>
>
>
> If we were to give more detail, it should probably be to point out
> that regular statistics will already be built for single columns,
> which is why single-column extended statistics would be redundant. So
> perhaps something like this:
>
> Error: cannot create extended statistics on a single column
> Detail: Univariate statistics are already built for each individual
> table column.

I like this version.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Eager aggregation, take 3
Next
From: "David G. Johnston"
Date:
Subject: Re: docs: warn about post-data-only schema dumps with parallel restore.