Re: Make name optional in CREATE STATISTICS
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, Simon Riggs <simon.riggs@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-07-21T17:42:12Z
Lists: pgsql-hackers
Attachments
- 0001-Rework-grammar-for-REINDEX.patch (text/x-diff)
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 — https://www.EnterpriseDB.com/
Commits
-
Fix a few issues with REINDEX grammar
- 0a5f06b84de7 16.0 landed
-
Rework grammar for REINDEX
- 83011ce7d7f4 16.0 landed
-
parser: centralize common auxiliary productions
- 7d158e8cb44b 16.0 landed
-
Make the name optional in CREATE STATISTICS.
- 624aa2a13bd0 16.0 landed