• Alvaro Herrera's avatar
    Change CREATE STATISTICS syntax · bc085205
    Alvaro Herrera authored
    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
    bc085205
create_statistics.sgml 4.81 KB