• Tom Lane's avatar
    Simplify psql \d's rule for ordering the indexes of a table. · 4d6603f2
    Tom Lane authored
    The previous rule was "primary key (if any) first, then other unique
    indexes in name order, then all other indexes in name order".
    But the preference for unique indexes seems a bit obsolete since the
    introduction of exclusion constraints.   It's no longer the case
    that unique indexes are the only ones that constrain what data can
    be in the table, and it's hard to see what other rationale there is
    for separating out unique indexes.  Other new features like the
    possibility for some indexes to be INVALID (hence, not constraining
    anything) make this even shakier.
    
    Hence, simplify the sort order to be "primary key (if any) first,
    then all other indexes in name order".
    
    No documentation change, since this was never documented anyway.
    A couple of existing regression test cases change output, though.
    
    Discussion: https://postgr.es/m/14422.1561474929@sss.pgh.pa.us
    4d6603f2
create_index.out 109 KB