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

From Yugo Nagata
Subject Re: Adjust error message for CREATE STATISTICS to account for expressions
Date
Msg-id 20260326190329.7a85cb47b158cf21e960c185@sraoss.co.jp
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
That sounds good to me.That sounds good to me.On Thu, 26 Mar 2026 16:22:07 +0700
John Naylor <johncnaylorls@gmail.com> wrote:

> On Wed, Mar 25, 2026 at 11:15 AM Yugo Nagata <nagata@sraoss.co.jp> wrote:
> >
> > On Wed, 25 Mar 2026 08:24:40 +0700
> > John Naylor <johncnaylorls@gmail.com> wrote:
> 
> > > I'm ambivalent about this. Instead of trying to document all the
> > > possible valid possibilities (which may get out of date again), maybe
> > > we can say that it's not allowed on a single column?
> >
> > Thank you for the suggestion. I agree that this is a simpler approach,
> > so I've attached a revised patch.
> 
> - errmsg("extended statistics require at least 2 columns")));
> + errmsg("extended statistics are not supported on a single column")));
> 
> I'd probably write this as "extended statistics on a single column are
> not supported" (no need to send a new patch).
> 
> Any objections?

That sounds good to me.

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

+1

Regards,
Yugo Nagata

> I looked in the feature thread and saw that this was actually raised
> during development of the feature:
> 
> https://www.postgresql.org/message-id/CAEZATCU9uPo7JYdx4k0-ufXXZH8t7itodibUwCva%2Bs%2BAvAKcnw%40mail.gmail.com
> 
> -- 
> John Naylor
> Amazon Web Services


-- 
Yugo Nagata <nagata@sraoss.co.jp>



pgsql-hackers by date:

Previous
From: Alexandre Felipe
Date:
Subject: Re: SLOPE - Planner optimizations on monotonic expressions.
Next
From: Amit Kapila
Date:
Subject: Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?