• Stephen Frost's avatar
    Change the way pg_dump retrieves partitioning info · 44c52881
    Stephen Frost authored
    This gets rid of the code that issued separate queries to retrieve the
    partitioning parent-child relationship, parent partition key, and child
    partition bound information.  With this patch, the information is
    retrieved instead using the queries issued from getTables() and
    getInherits(), which is both more efficient than the previous approach
    and doesn't require any new code.
    
    Since the partitioning parent-child relationship is now retrieved with
    the same old code that handles inheritance, partition attributes receive
    a proper flagInhAttrs() treatment (that it didn't receive before), which
    is needed so that the inherited NOT NULL constraints are not emitted if
    we already emitted it for the parent.
    
    Also, fix a bug in pg_dump's --binary-upgrade code, which caused pg_dump
    to emit invalid command to attach a partition to its parent.
    
    Author: Amit Langote, with some additional changes by me.
    44c52881
pg_dump.h 21.4 KB