• Alvaro Herrera's avatar
    Allow a partdesc-omitting-partitions to be cached · d6b8d294
    Alvaro Herrera authored
    Makes partition descriptor acquisition faster during the transient
    period in which a partition is in the process of being detached.
    
    This also adds the restriction that only one partition can be in
    pending-detach state for a partitioned table.
    
    While at it, return find_inheritance_children() API to what it was
    before 71f4c8c6, and create a separate
    find_inheritance_children_extended() that returns detailed info about
    detached partitions.
    
    (This incidentally fixes a bug in 8aba9322 whereby a memory context
    holding a transient partdesc is reparented to a NULL PortalContext,
    leading to permanent leak of that memory.  The fix is to no longer rely
    on reparenting contexts to PortalContext.   Reported by Amit Langote.)
    
    Per gripe from Amit Langote
    Discussion: https://postgr.es/m/CA+HiwqFgpP1LxJZOBYGt9rpvTjXXkg5qG2+Xch2Z1Q7KrqZR1A@mail.gmail.com
    d6b8d294
partdesc.c 14.3 KB