[COMMITTERS] pgsql: Change CREATE STATISTICS syntax - Mailing list pgsql-committers

From Alvaro Herrera
Subject [COMMITTERS] pgsql: Change CREATE STATISTICS syntax
Date
Msg-id E1d9Ew9-0002mX-NV@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Change CREATE STATISTICS syntax

Previously, we had the WITH clause in the middle of the command, where
you'd specify both generic options as well as statistic types.  Few
people liked this, so this commit changes it to remove the WITH keyword
from that clause and makes it accept statistic types only.  (We
currently don't have any generic options, but if we invent in the
future, we will gain a new WITH clause, probably at the end of the
command).

Also, the column list is now specified without parens, which makes the
whole command look more similar to a SELECT command.  This change will
let us expand the command to supporting expressions (not just columns
names) as well as multiple tables and their join conditions.

Tom added lots of code comments and fixed some parts of the CREATE
STATISTICS reference page, too; more changes in this area are
forthcoming.  He also fixed a potential problem in the alter_generic
regression test, reducing verbosity on a cascaded drop to avoid
dependency on message ordering, as we do in other tests.

Tom also closed a security bug: we documented that table ownership was
required in order to create a statistics object on it, but didn't
actually implement it.

Implement tab-completion for statistics objects.  This can stand some
more improvement.

Authors: Alvaro Herrera, with lots of cleanup by Tom Lane
Discussion: https://postgr.es/m/20170420212426.ltvgyhnefvhixm6i@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bc085205c8a425fcaa54e27c6dcd83101130439b

Modified Files
--------------
doc/src/sgml/perform.sgml                    |   8 +-
doc/src/sgml/planstats.sgml                  |   4 +-
doc/src/sgml/ref/alter_statistics.sgml       |  28 +++----
doc/src/sgml/ref/create_statistics.sgml      |  85 +++++++++------------
doc/src/sgml/ref/drop_statistics.sgml        |  16 ++--
src/backend/commands/statscmds.c             | 109 +++++++++++++++++++--------
src/backend/nodes/copyfuncs.c                |   6 +-
src/backend/nodes/equalfuncs.c               |   6 +-
src/backend/nodes/outfuncs.c                 |   6 +-
src/backend/parser/gram.y                    |  42 +++++------
src/backend/utils/adt/ruleutils.c            |  10 +--
src/bin/pg_dump/t/002_pg_dump.pl             |  10 +--
src/bin/psql/describe.c                      |  14 ++--
src/bin/psql/tab-complete.c                  |  38 +++++++++-
src/include/nodes/parsenodes.h               |   8 +-
src/test/regress/expected/alter_generic.out  |  52 ++-----------
src/test/regress/expected/object_address.out |   2 +-
src/test/regress/expected/stats_ext.out      |  85 ++++++++++++---------
src/test/regress/sql/alter_generic.sql       |  12 +--
src/test/regress/sql/object_address.sql      |   2 +-
src/test/regress/sql/stats_ext.sql           |  64 ++++++++--------
21 files changed, 321 insertions(+), 286 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: [COMMITTERS] pgsql: Replace another "transaction log" with "write-ahead log"
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Fix dependencies for extended statistics objects.