Re: Make name optional in CREATE STATISTICS - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Make name optional in CREATE STATISTICS
Date
Msg-id 20220721174212.cmitjpuimx6ssyyj@alvherre.pgsql
Whole thread Raw
In response to Re: Make name optional in CREATE STATISTICS  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Make name optional in CREATE STATISTICS
Re: Make name optional in CREATE STATISTICS
List 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  —  https://www.EnterpriseDB.com/

Attachment

pgsql-hackers by date:

Previous
From: Martin Kalcher
Date:
Subject: Re: [PATCH] Introduce array_shuffle() and array_sample()
Next
From: Bruce Momjian
Date:
Subject: Re: First draft of the PG 15 release notes