• Peter Eisentraut's avatar
    Handle heap rewrites better in logical replication · ab28feae
    Peter Eisentraut authored
    A FOR ALL TABLES publication naturally considers all base tables to be a
    candidate for replication.  This includes transient heaps that are
    created during a table rewrite during DDL.  This causes failures on the
    subscriber side because it will not have a table like pg_temp_16386 to
    receive data (and if it did, it would be the wrong table).
    
    The prevent this problem, we filter out any tables that match this
    naming pattern and match an actual table from FOR ALL TABLES
    publications.  This is only a heuristic, meaning that user tables that
    match that naming could accidentally be omitted.  A more robust solution
    might require an explicit marking of such tables in pg_class somehow.
    Reported-by: default avataryxq <yxq@o2.pl>
    Bug: #14785
    Reviewed-by: default avatarAndres Freund <andres@anarazel.de>
    Reviewed-by: default avatarPetr Jelinek <petr.jelinek@2ndquadrant.com>
    ab28feae
006_rewrite.pl 2.29 KB