public inbox for [email protected]  
help / color / mirror / Atom feed
From: John Naylor <[email protected]>
To: Yugo Nagata <[email protected]>
Cc: Pgsql Hackers <[email protected]>
Subject: Re: Adjust error message for CREATE STATISTICS to account for expressions
Date: Wed, 25 Mar 2026 08:24:40 +0700
Message-ID: <CANWCAZYdyQzCoAiq9kybHT2RcnC1CgrxbCpyxeV3+KZn2xj2UA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Tue, Mar 24, 2026 at 6:34 PM Yugo Nagata <[email protected]> wrote:
>
> Hi,
>
> I've attached a patch to adjust the error message for CREATE STATISTICS
> to account for expressions.
>
> Previously, when attempting to create extended statistics on a single column,
> the following error is raised.
>
>  ERROR:  extended statistics require at least 2 columns
>
> However, this message assumed only columns. In reality, an expression on a
> single column is also allowed, so two columns are not necessarily required.
> Thgis patch updates the message to:
>
>  ERROR:  extended statistics require at least 2 columns or an expression

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?

--
John Naylor
Amazon Web Services





view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Adjust error message for CREATE STATISTICS to account for expressions
  In-Reply-To: <CANWCAZYdyQzCoAiq9kybHT2RcnC1CgrxbCpyxeV3+KZn2xj2UA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox