Re: Make name optional in CREATE STATISTICS

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make name optional in CREATE STATISTICS
Date: 2022-07-07 10:58:37
Message-ID: CAEze2WhShe3BvKQZJC19=ER+WuicMPoW0kYCk7sZENimC39J0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 7 Jul 2022 at 12:55, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com> wrote:
> There are various other ways of doing this and, yes, we could refactor
> other parts of the grammar to make this work. There is a specific
> guideline about patch submission that says the best way to get a patch
> rejected is to include unnecessary changes. With that in mind, let's
> keep the patch simple and exactly aimed at the original purpose.
>
> I'll leave it for committers to decide whether other refactoring is wanted.

Fair enough.

> I have made the comment show that the name is optional, thank you.

The updated comment implies that IF NOT EXISTS is allowed without a
defined name, which is false:

> + * CREATE STATISTICS [IF NOT EXISTS] [stats_name] [(stat types)]

A more correct version would be

+ * CREATE STATISTICS [ [IF NOT EXISTS] stats_name ]
[(stat types)]

> Patch v4 attached

Thanks for working on this!

Kind regards,

Matthias van de Meent

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-07-07 11:00:15 Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Previous Message Simon Riggs 2022-07-07 10:54:51 Re: Make name optional in CREATE STATISTICS