Skip to content

v2.3.0

Choose a tag to compare

@gmr gmr released this 21 Sep 23:12
· 3 commits to main since this release
695f6c6

Added

  • Dump::sorts_on_save() and Dump::set_sort_on_save() to control whether saving reorders the TOC (#16)

Changed

  • Saving an archive that was loaded and not modified now preserves its TOC order instead of re-sorting it. pg_dump's ordering is authoritative, so rewriting it could only lose fidelity. Dumps built with new(), and loaded dumps whose entries are added to or modified, still sort on save as before (#16)
  • TOC sorting now reproduces pg_dump's placement rules: the ENCODING/STDSTRINGS/SEARCHPATH prelude keeps pg_dump's order, comments, security labels and ACLs follow the object they describe, constraint-like entries sort on the object name rather than the "<table> <name>" tag, and statistics sort by the kind of object they describe. Every test fixture except data-only archives now sorts into exactly the order pg_dump wrote (#16, #18)
  • Updated dependencies: lz4_flex from 0.11 to 0.14, zstd from 0.13 to 0.14, flate2 to 1.1.10, thiserror to 2.0.20 (#19)

Fixed

  • A dependency cycle no longer puts its members at the front of the archive, ahead of their schema and the prelude, which produced archives pg_restore could not read. One edge of the cycle is now dropped and the sort re-run, as pg_dump does (#15)
  • Column ACLs no longer sort to the end of the archive (#16)
  • get_entry_mut() no longer marks the TOC order stale when the lookup finds nothing (#16)

Known limitation

Data-only archives still sort differently from pg_dump. pg_dump orders TABLE DATA by foreign-key dependencies recorded against table entries that a data-only archive does not contain, so the order cannot be reconstructed from the archive. Loaded archives are no longer re-sorted on save, so this does not affect round-tripping.