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

From John Naylor
Subject Re: Adjust error message for CREATE STATISTICS to account for expressions
Date
Msg-id CANWCAZaYOdb7p=xndzgDfvJ-0NN_HTyx54LVUX2i1Xs7cPSzbw@mail.gmail.com
Whole thread
In response to Re: Adjust error message for CREATE STATISTICS to account for expressions  (Yugo Nagata <nagata@sraoss.co.jp>)
Responses Re: Adjust error message for CREATE STATISTICS to account for expressions
List pgsql-hackers
On Sat, Mar 28, 2026 at 1:04 PM Yugo Nagata <nagata@sraoss.co.jp> wrote:
>
> On Fri, 27 Mar 2026 09:50:07 +0000
> Dean Rasheed <dean.a.rasheed@gmail.com> wrote:

> > 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.
>
> That makes sense to me.
>
> Using an errdetail to explain the reason sounds reasonable.

Works for me.

> > > On Fri, 27 Mar 2026 07:45:37 +0700
> > > John Naylor <johncnaylorls@gmail.com> wrote:
> > > > Looking elsewhere in this file, however, I
> > > > do see some messages with "cannot do X because ....", and I'd be more
> > > > motivated to turn those "because" phrases into errdetails.

Did you also want to try tackling this while we're here?

--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Fix "could not find memoization table entry"
Next
From: "David G. Johnston"
Date:
Subject: Re: [PATCH] Report column-level error when lacking privilege