• Alvaro Herrera's avatar
    Tweak catalog indexing abstraction for upcoming WARM · 2f5c9d9c
    Alvaro Herrera authored
    Split the existing CatalogUpdateIndexes into two different routines,
    CatalogTupleInsert and CatalogTupleUpdate, which do both the heap
    insert/update plus the index update.  This removes over 300 lines of
    boilerplate code all over src/backend/catalog/ and src/backend/commands.
    The resulting code is much more pleasing to the eye.
    
    Also, by encapsulating what happens in detail during an UPDATE, this
    facilitates the upcoming WARM patch, which is going to add a few more
    lines to the update case making the boilerplate even more boring.
    
    The original CatalogUpdateIndexes is removed; there was only one use
    left, and since it's just three lines, we can as well expand it in place
    there.  We could keep it, but WARM is going to break all the UPDATE
    out-of-core callsites anyway, so there seems to be no benefit in doing
    so.
    
    Author: Pavan Deolasee
    Discussion: https://www.postgr.es/m/CABOikdOcFYSZ4vA2gYfs=M2cdXzXX4qGHeEiW3fu9PCfkHLa2A@mail.gmail.com
    2f5c9d9c
aclchk.c 154 KB