pgsql: Disallow CREATE STATISTICS on system catalogs

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow CREATE STATISTICS on system catalogs
Date: 2021-01-15 22:47:57
Message-ID: E1l0Xsr-0002YX-Ge@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disallow CREATE STATISTICS on system catalogs

Add a check that CREATE STATISTICS does not add extended statistics on
system catalogs, similarly to indexes etc. It can be overriden using
the allow_system_table_mods GUC.

This bug exists since 7b504eb282c, adding the extended statistics, so
backpatch all the way back to PostgreSQL 10.

Author: Tomas Vondra
Reported-by: Dean Rasheed
Backpatch-through: 10
Discussion: https://postgr.es/m/CAEZATCXAPrrOKwEsyZKQ4uzzJQWBCt6QAvOcgqRGdWwT1zb%2BrQ%40mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/943a113bcb6fb913814ae32cbd4dd1ed29498750

Modified Files
--------------
src/backend/commands/statscmds.c | 7 +++++++
src/test/regress/expected/stats_ext.out | 12 +++++++-----
src/test/regress/sql/stats_ext.sql | 12 +++++++-----
3 files changed, 21 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2021-01-15 22:49:24 pgsql: Disallow CREATE STATISTICS on system catalogs
Previous Message Tomas Vondra 2021-01-15 22:46:21 pgsql: Disallow CREATE STATISTICS on system catalogs