pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Disallow extended statistics on system columns
2+ messages / 1 participants
[nested] [flat]

* pgsql: Disallow extended statistics on system columns
@ 2021-09-19 23:01 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2021-09-19 23:01 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Disallow extended statistics on system columns

Since introduction of extended statistics, we've disallowed references
to system columns. So for example

    CREATE STATISTICS s ON ctid FROM t;

would fail. But with extended statistics on expressions, it was possible
to work around this limitation quite easily

    CREATE STATISTICS s ON (ctid::text) FROM t;

This is an oversight in a4d75c86bf, fixed by adding a simple check.
Backpatch to PostgreSQL 14, where support for extended statistics on
expressions was introduced.

Backpatch-through: 14
Discussion: https://postgr.es/m/20210816013255.GS10479%40telsasoft.com

Branch
------
master

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

Modified Files
--------------
src/backend/commands/statscmds.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Disallow extended statistics on system columns
@ 2021-09-19 23:01 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2021-09-19 23:01 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Disallow extended statistics on system columns

Since introduction of extended statistics, we've disallowed references
to system columns. So for example

    CREATE STATISTICS s ON ctid FROM t;

would fail. But with extended statistics on expressions, it was possible
to work around this limitation quite easily

    CREATE STATISTICS s ON (ctid::text) FROM t;

This is an oversight in a4d75c86bf, fixed by adding a simple check.
Backpatch to PostgreSQL 14, where support for extended statistics on
expressions was introduced.

Backpatch-through: 14
Discussion: https://postgr.es/m/20210816013255.GS10479%40telsasoft.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/66061077155d68463ec00604ba7d6f0ae69716e8

Modified Files
--------------
src/backend/commands/statscmds.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-09-19 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-19 23:01 pgsql: Disallow extended statistics on system columns Tomas Vondra <tomas.vondra@postgresql.org>
2021-09-19 23:01 pgsql: Disallow extended statistics on system columns Tomas Vondra <tomas.vondra@postgresql.org>

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