• Tom Lane's avatar
    Mark finished Plan nodes with parallel_safe flags. · 003d80f3
    Tom Lane authored
    We'd managed to avoid doing this so far, but it seems pretty obvious
    that it would be forced on us some day, and this is much the cleanest
    way of approaching the open problem that parallel-unsafe subplans are
    being transmitted to parallel workers.  Anyway there's no space cost
    due to alignment considerations, and the time cost is pretty minimal
    since we're just copying the flag from the corresponding Path node.
    (At least in most cases ... some of the klugier spots in createplan.c
    have to work a bit harder.)
    
    In principle we could perhaps get rid of SubPlan.parallel_safe,
    but I thought it better to keep that in case there are reasons to
    consider a SubPlan unsafe even when its child plan is parallel-safe.
    
    This patch doesn't actually do anything with the new flags, but
    I thought I'd commit it separately anyway.
    
    Note: although this touches outfuncs/readfuncs, there's no need for
    a catversion bump because Plan trees aren't stored on disk.
    
    Discussion: https://postgr.es/m/87tw5x4vcu.fsf@credativ.de
    003d80f3
createplan.c 192 KB