• Tom Lane's avatar
    Invent "amadjustmembers" AM method for validating opclass members. · 9f968278
    Tom Lane authored
    This allows AM-specific knowledge to be applied during creation of
    pg_amop and pg_amproc entries.  Specifically, the AM knows better than
    core code which entries to consider as required or optional.  Giving
    the latter entries the appropriate sort of dependency allows them to
    be dropped without taking out the whole opclass or opfamily; which
    is something we'd like to have to correct obsolescent entries in
    extensions.
    
    This callback also opens the door to performing AM-specific validity
    checks during opclass creation, rather than hoping than an opclass
    developer will remember to test with "amvalidate".  For the most part
    I've not actually added any such checks yet; that can happen in a
    follow-on patch.  (Note that we shouldn't remove any tests from
    "amvalidate", as those are still needed to cross-check manually
    constructed entries in the initdb data.  So adding tests to
    "amadjustmembers" will be somewhat duplicative, but it seems like
    a good idea anyway.)
    
    Patch by me, reviewed by Alexander Korotkov, Hamid Akhtar, and
    Anastasia Lubennikova.
    
    Discussion: https://postgr.es/m/4578.1565195302@sss.pgh.pa.us
    9f968278
spgvalidate.c 11.3 KB