Tighten up relation kind checks for extended statistics
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 17 Apr 2017 20:55:17 +0000 (17:55 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 17 Apr 2017 20:55:55 +0000 (17:55 -0300)
commit8c5cdb7f4f6e1d6a6104cb58ce4f23453891651b
tree25a5dfbae4b5d274b17cdb592ad120e36469c06e
parent76799fc89d2ca6f357c188daa4e1b38f0a59e360
Tighten up relation kind checks for extended statistics

We were accepting creation of extended statistics only for regular
tables, but they can usefully be created for foreign tables, partitioned
tables, and materialized views, too.  Allow those cases.

While at it, make sure all the rejected cases throw a consistent error
message, and add regression tests for the whole thing.

Author: David Rowley, Álvaro Herrera
Discussion: https://postgr.es/m/CAKJS1f-BmGo410bh5RSPZUvOO0LhmHL2NYmdrC_Jm8pk_FfyCA@mail.gmail.com
doc/src/sgml/ref/create_statistics.sgml
src/backend/commands/statscmds.c
src/bin/pg_dump/pg_dump.c
src/test/regress/expected/stats_ext.out
src/test/regress/sql/stats_ext.sql