Make name optional in CREATE STATISTICS

Simon Riggs <simon.riggs@enterprisedb.com>

From: Simon Riggs <simon.riggs@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-05-15T12:20:34Z
Lists: pgsql-hackers

Attachments

Currently, CREATE STATS requires you to think of a name for each stats
object, which is fairly painful, so users would prefer an
automatically assigned name.

Attached patch allows this, which turns out to be very simple, since a
name assignment function already exists.

The generated name is simple, but that's exactly what users do anyway,
so it is not too bad.

Tests, docs included.

-- 
Simon Riggs                http://www.EnterpriseDB.com/

Commits

  1. Fix a few issues with REINDEX grammar

  2. Rework grammar for REINDEX

  3. parser: centralize common auxiliary productions

  4. Make the name optional in CREATE STATISTICS.