Re: Make name optional in CREATE STATISTICS

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, 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 17:42:12
Message-ID: 20220721174212.cmitjpuimx6ssyyj@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2022-Jul-21, Dean Rasheed wrote:

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

Thanks. I was looking at the recently modified REINDEX syntax and
noticed there another spot for taking an optional name. I ended up
reusing OptSchemaName for that, as in the attached patch. I think
adding production-specific additional productions is pointless and
probably bloats the grammar. So let me +1 your push of the patch you
posted, just to keep things moving forward, but in addition I propose to
later rename OptSchemaName to something more generic and use it in these
three places.

Álvaro Herrera Breisgau, Deutschland —

Attachment Content-Type Size
0001-Rework-grammar-for-REINDEX.patch text/x-diff 5.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2022-07-21 17:44:13 Re: First draft of the PG 15 release notes
Previous Message Martin Kalcher 2022-07-21 17:29:12 Re: [PATCH] Introduce array_shuffle() and array_sample()