Re: Make name optional in CREATE STATISTICS

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make name optional in CREATE STATISTICS
Date: 2022-07-21 14:12:29
Message-ID: CAEZATCW993Lt_bsT90VFMpxF-0s6aKw_4TesB_F5GqM8e1oP9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 20 Jul 2022 at 12:01, Matthias van de Meent
<boekewurm+postgres(at)gmail(dot)com> wrote:
>
> On Wed, 13 Jul 2022 at 08:07, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com> wrote:
> >
> > > + * CREATE STATISTICS [ [IF NOT EXISTS] stats_name ]
>
> I think this is ready for a committer, so I've marked it as such.
>

Picking this up...

I tend to agree with Matthias' earlier point about avoiding code
duplication in the grammar. Without going off and refactoring other
parts of the grammar not related to this patch, it's still a slightly
smaller, simpler change, and less code duplication, to do this using a
new opt_stats_name production in the grammar, as in the attached.

I also noticed a comment in CreateStatistics() that needed updating.

Barring any further comments, I'll push this shortly.

Regards,
Dean

Attachment Content-Type Size
0001-Make-the-name-optional-in-CREATE-STATISTICS.patch text/x-patch 20.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2022-07-21 14:21:35 Re: [PATCH v1] eliminate duplicate code in table.c
Previous Message Aleksander Alekseev 2022-07-21 14:05:30 Re: [PATCH v1] eliminate duplicate code in table.c