Re: Adjust error message for CREATE STATISTICS to account for expressions

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, John Naylor <johncnaylorls(at)gmail(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Subject: Re: Adjust error message for CREATE STATISTICS to account for expressions
Date: 2026-03-30 03:19:36
Message-ID: E0E9225B-82B0-485E-8E8B-07330D217383@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Mar 27, 2026, at 08:45, John Naylor <johncnaylorls(at)gmail(dot)com> wrote:
>
> On Fri, Mar 27, 2026 at 6:23 AM Michael Paquier <michael(at)paquier(dot)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(dot)a(dot)rasheed(at)gmail(dot)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/

In response to

Browse pgsql-hackers by date

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