• Andrew Dunstan's avatar
    Allow for pg_upgrade of attributes with missing values · 2448adf2
    Andrew Dunstan authored
    Commit 16828d5c neglected to do this, so upgraded databases would
    silently get null instead of the specified default in rows without the
    attribute defined.
    
    A new binary upgrade function is provided to perform this and pg_dump is
    adjusted to output a call to the function if required in binary upgrade
    mode.
    
    Also included is code to drop missing attribute values for dropped
    columns. That way if the type is later dropped the missing value won't
    have a dangling reference to the type.
    
    Finally the regression tests are adjusted to ensure that there is a row
    with a missing value so that this code is exercised in upgrade testing.
    
    Catalog version unfortunately bumped.
    
    Regression test changes from Tom Lane.
    Remainder from me, reviewed by Tom Lane, Andres Freund, Alvaro Herrera
    
    Discussion: https://postgr.es/m/19987.1529420110@sss.pgh.pa.us
    2448adf2
heap.c 107 KB