pg_dump: Fix object-type sort priority for large objects.
authorNathan Bossart <nathan@postgresql.org>
Thu, 10 Jul 2025 20:52:41 +0000 (15:52 -0500)
committerNathan Bossart <nathan@postgresql.org>
Thu, 10 Jul 2025 20:52:41 +0000 (15:52 -0500)
Commit a45c78e328 moved large object metadata from SECTION_PRE_DATA
to SECTION_DATA but neglected to move PRIO_LARGE_OBJECT in
dbObjectTypePriorities accordingly.  While this hasn't produced any
known live bugs, it causes problems for a proposed patch that
optimizes upgrades with many large objects.  Fixing the priority
might also make the topological sort step marginally faster by
reducing the number of ordering violations that have to be fixed.

Reviewed-by: Nitin Motiani <nitinmotiani@google.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/aBkQLSkx1zUJ-LwJ%40nathan
Discussion: https://postgr.es/m/aG_5DBCjdDX6KAoD%40nathan
Backpatch-through: 17

src/bin/pg_dump/pg_dump_sort.c

index 0b0977788f13dadff7cb2e0044efcda262b55370..538e7dcb493578ca92da0b3f2f1d38fc23c41c0d 100644 (file)
@@ -76,10 +76,10 @@ enum dbObjectTypePriorities
    PRIO_TABLE_ATTACH,
    PRIO_DUMMY_TYPE,
    PRIO_ATTRDEF,
-   PRIO_LARGE_OBJECT,
    PRIO_PRE_DATA_BOUNDARY,     /* boundary! */
    PRIO_TABLE_DATA,
    PRIO_SEQUENCE_SET,
+   PRIO_LARGE_OBJECT,
    PRIO_LARGE_OBJECT_DATA,
    PRIO_STATISTICS_DATA_DATA,
    PRIO_POST_DATA_BOUNDARY,    /* boundary! */