• Stephen Frost's avatar
    pg_dump performance and other fixes · 5d589993
    Stephen Frost authored
    Do not try to dump objects which do not have ACLs when only ACLs are
    being requested.  This results in a significant performance improvement
    as we can avoid querying for further information on these objects when
    we don't need to.
    
    When limiting the components to dump for an extension, consider what
    components have been requested.  Initially, we incorrectly hard-coded
    the components of the extension objects to dump, which would mean that
    we wouldn't dump some components even with they were asked for and in
    other cases we would dump components which weren't requested.
    
    Correct defaultACLs to use 'dump_contains' instead of 'dump'.  The
    defaultACL is considered a member of the namespace and should be
    dumped based on the same set of components that the other objects in
    the schema are, not based on what we're dumping for the namespace
    itself (which might not include ACLs, if the namespace has just the
    default or initial ACL).
    
    Use DUMP_COMPONENT_ACL for from-initdb objects, to allow users to
    change their ACLs, should they wish to.  This just extends what we
    are doing for the pg_catalog namespace to objects which are not
    members of namespaces.
    
    Due to column ACLs being treated a bit differently from other ACLs
    (they are actually reset to NULL when all privileges are revoked),
    adjust the query which gathers column-level ACLs to consider all of
    the ACL-relevant columns.
    5d589993
pg_dump.c 537 KB