• Alvaro Herrera's avatar
    Fix partitioned index creation bug with dropped columns · 126d6312
    Alvaro Herrera authored
    ALTER INDEX .. ATTACH PARTITION fails if the partitioned table where the
    index is defined contains more dropped columns than its partition, with
    this message:
      ERROR:  incorrect attribute map
    The cause was that one caller of CompareIndexInfo was passing the number
    of attributes of the partition rather than the parent, which confused
    the length check.  Repair.
    
    This can cause pg_upgrade to fail when used on such a database.  Leave
    some more objects around after regression tests, so that the case is
    detected by pg_upgrade test suite.
    
    Remove some spurious empty lines noticed while looking for other cases
    of the same problem.
    
    Discussion: https://postgr.es/m/20190326213924.GA2322@alvherre.pgsql
    126d6312
tablecmds.c 479 KB