• Alvaro Herrera's avatar
    Fix for dropped columns in a partitioned table's default partition · 23cccb17
    Alvaro Herrera authored
    We forgot to map column numbers to/from the default partition for
    various operations, leading to valid cases failing with spurious
    errors, such as
    ERROR:  attribute N of type some_partition has been dropped
    
    It was also possible that the search for conflicting rows in the default
    partition when attaching another partition would fail to detect some.
    Secondarily, it was also possible that such a search should be skipped
    (because the constraint was implied) but wasn't.
    
    Fix all this by mapping column numbers when necessary.
    
    Reported by: Daniel Wilches
    Author: Amit Langote
    Discussion: https://postgr.es/m/15873-8c61945d6b3ef87c@postgresql.org
    23cccb17
alter_table.sql 99.9 KB