• Tomas Vondra's avatar
    Disallow extended statistics on system columns · 66061077
    Tomas Vondra authored
    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 a4d75c86, 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
    66061077
statscmds.c 26.6 KB