• T
    Mega-commit to make heap_open/heap_openr/heap_close take an · bd272cac
    Tom Lane 提交于
    additional argument specifying the kind of lock to acquire/release (or
    'NoLock' to do no lock processing).  Ensure that all relations are locked
    with some appropriate lock level before being examined --- this ensures
    that relevant shared-inval messages have been processed and should prevent
    problems caused by concurrent VACUUM.  Fix several bugs having to do with
    mismatched increment/decrement of relation ref count and mismatched
    heap_open/close (which amounts to the same thing).  A bogus ref count on
    a relation doesn't matter much *unless* a SI Inval message happens to
    arrive at the wrong time, which is probably why we got away with this
    sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
    DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
    Recommend 'make clean all' after pulling this update; I modified the
    Relation struct layout slightly.
    Will post further discussion to pghackers list shortly.
    bd272cac
creatinh.c 12.9 KB