From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Change CREATE STATISTICS syntax
Date: Fri, 12 May 2017 18:05:09 +0000
Message-ID: <E1d9Ew9-0002mX-NV@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Change CREATE STATISTICS syntax
In-Reply-To: <E1d9Ew9-0002mX-NV@gemulon.postgresql.org>
References: <E1d9Ew9-0002mX-NV@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox