Thread

  1. [PATCH] Postpone PROPERTY GRAPH creation in pg_dump to POST-DATA when it depends on a unique constraint

    SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com> — 2026-05-10T14:38:38Z

    Hi Hackers,
    
    A property graph that references a vertex (or edge) table with a
    PRIMARY KEY creates a circular dependency for pg_dump.
    
    When we dump the database with such a table pg_dump emitted a
    'could not resolve dependency loop' warning and then wrote the
    property graph in PRE-DATA before the ADD CONSTRAINT line that
    creates the required unique index.  On a restore, the
    CREATE PROPERTY GRAPH then errored out with 'there is no unique
    constraint matching the key for element ...', leaving the property
    graph silently absent from the restored database.
    
    The fix is to resolve it the same way as for materialized views. When a
    property graph is involved in a multi-object loop with the PRE-DATA
    boundary,
    break the boundary's dependency on it and postpone the property graph
    into POST-DATA via the existing TableInfo.postponed_def flag (already
    honoured by the section assignment in dumpTableSchema()).
    As part of the change I renamed repairMatViewBoundaryMultiLoop to
    repairPostponableBoundaryMultiLoop. This function now handles both
    matview and and propgraph. Patch includes a test.
    
    Thanks,
    Satya